Titandocs

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

FromToVia
EngineCanton ledgerDaml commands (commitments, withdrawal decisions)
EngineIndexerSigned WAL firehose
EngineBFFREST (signed proxy) + admin SSE
OracleEngineRedis (index price per asset)
IndexerPostgresWrites — the only writer
BFFPostgresReads — 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 binaries

Full sequence in Local setup.

On this page