Overview
What lives in server/, which tree is deployed, and the one directory that is a trap.
server/ holds everything that is not the browser or the BFF.
docker-compose.yml · Makefile · markets.json
The deployed indexer is server/indexer. A standalone titan/indexer tree also exists at
the repository root and is stale — never implement there. Changes made in the wrong tree
build fine, test fine, and ship nothing.
Who talks to whom
| From | To | Via |
|---|---|---|
| Engine | Canton ledger | Daml commands (commitments, withdrawal decisions) |
| Engine | Indexer | Signed WAL firehose |
| Engine | BFF | REST (signed proxy) + admin SSE |
| Oracle | Engine | Redis (index price per asset) |
| Indexer | Postgres | Writes — the only writer |
| BFF | Postgres | Reads — read-only Drizzle |
markets.json
The engine's market config is the upstream source that interface/src/lib/tokens/markets.ts
mirrors:
{
"BTC-USDCX": { "maxLeverage": 40, "szDecimals": 5 },
"ETH-USDCX": { "maxLeverage": 25, "szDecimals": 4 },
"SOL-USDCX": { "maxLeverage": 20, "szDecimals": 2 }
}Adding a market means changing it here first, then letting GET /v1/markets propagate it. The
interface seed exists only to make synchronous route validation possible — see
Add a market.
Running the stack
cd server
docker compose up -d # postgres, redis, canton
make build # build the Go binariesFull sequence in Local setup.