USD prices, OHLCV candles and volumes for Stellar assets, built from the Stellar DEX (SDEX order book) and the Soroban AMMs (Soroswap, Phoenix, Aquarius, SushiSwap V3), with a public REST API and a self-service portal for API keys.
- API:
https://prices-api.sorobanscan.rumblefish.dev(key-gated/v1/*; the OpenAPI document is public at/api-docs-json) - Portal (key sign-up):
https://sorobanscan.rumblefish.dev/prices-api/ - Endpoint reference:
docs/scf/api-endpoints.md - Architecture overview:
docs/prices-api-general-overview.md
Rust Lambdas on AWS (no VPC) read Stellar ledgers from S3, extract trades, and write candles to ClickHouse over HTTPS with mutual TLS. Scheduled workers enrich candles with USD values, roll them up to coarser intervals and watch freshness; one API Lambda behind API Gateway serves the read surface.
This project is a tenant of the Soroban Block Explorer platform
(rumblefishdev/soroban-block-explorer).
That platform provides the ledger bucket, the ledger-events SNS topic, and the
ClickHouse server on a Hetzner dedicated machine behind a Caddy mTLS proxy.
This repo owns the prices database on that server, its own AWS stacks, and
nothing else.
| Path | What |
|---|---|
packages/ |
Rust crates: API (prices-api), live ingestion (ledger-processor, venue extractors), scheduled workers, backfills, and prices-clickhouse (schema + client) |
infra/ |
AWS CDK app (TypeScript), one stack per file, config in infra/envs/*.json |
web/portal/ |
The self-service key portal (built here, hosted by the explorer's CDN) |
docs/ |
Architecture, runbooks (docs/runbooks/), SCF milestone evidence (docs/scf/) |
tools/scripts/ |
Build, verification and operator scripts |
lore/ |
Task and decision records |
nvm use # Node 22.22.0 (.nvmrc)
npm ci
docker compose up -d clickhouse # ClickHouse 26.3, same version as production
cargo test --workspace # unit tests
npx nx run-many -t test # the whole workspace through NxThe ClickHouse-backed integration tests and the schema applier are described in
packages/prices-clickhouse/README.md.
On macOS, infra:test needs bash ≥ 4 and GNU coreutils. It runs in the
last command above and in the git hooks, whenever a change reaches infra.
Set them up as in infra/README.md §1,
"On macOS".
infra/README.md is the deployment runbook, including
a deployment into a fresh AWS account. In short:
- Platform first. Deploy the Soroban Block Explorer platform by following
its own fresh-account runbook. That covers the AWS stacks and the Hetzner
ClickHouse machine (ordered by hand, then configured with Ansible). The
platform publishes the five
/platform/<env>/*SSM parameters this app reads. - Tenant on the ClickHouse server. Issue the two service certificates
(CNs
prices-ingestion-<env>andprices-api-<env>) and map them toprices_writerandprices_reader. Then apply thepricesschema. - Secrets and seeds. Upload the two mTLS bundles and the Discord OAuth bundle to Secrets Manager, and seed three SSM parameters.
cdk deploy. Runnpm run infra:bootstrap, thennpm run infra:deploy:production.
Some steps are manual by design, and infra/README.md lists each one. The
Hetzner server is ordered by hand. Client certificates are issued from the
platform's CA. The Discord application is registered by hand. DNS is a hosted
zone you own.