CRX API (GraphQL)
What is the CRX indexer?
The system of record for everything the CRX core emits. It scans Base Sepolia forward-only, persists every one of the 26 core events to its own database, and serves a read-only GraphQL API. After first boot, history lives in the indexer; upstream log pruning never matters again.
It is the durable counterpart to the live reads. The relayer is fast and the chain is authoritative, but neither retains history: the public RPC prunes old getLogs, and the relayer holds only what is in flight. The indexer retains all of it, queryable.
The API is read-only. There are no mutations; it indexes the chain, it never writes to it.
Where is it?
One GraphQL endpoint, same-origin path-prefix as the rest of the venue:
INDEXER="https://app.crxfx.com/svc/indexer"
# POST GraphQL here
curl -s -X POST "$INDEXER/graphql" \
-H 'content-type: application/json' \
-d '{"query":"{ syncStatus { lastBlock head healthy } }"}'
# {"data":{"syncStatus":{"lastBlock":"…","head":"…","healthy":true}}}A GET /svc/indexer/graphiql playground, a GET /svc/indexer/healthz, and a GET /svc/indexer/status (JSON sync state) sit beside it. Big numbers, addresses, and ids are strings (decimal or 0x-hex); times are ISO-8601.
Read one party's positions
positions(party:) matches a firm on the long or the short side. The shape mirrors the on-chain Position 1:1.
query Positions($party: String!) {
positions(party: $party, first: 100) {
id
acaId
longAcct
shortAcct
notional
pair
lockedRate
status # open | settled | closed | force_closed
finalRate
openedTime
closedTime
}
}curl -s -X POST "$INDEXER/graphql" \
-H 'content-type: application/json' \
-d '{"query":"query($p:String!){positions(party:$p,first:100){id pair notional status}}","variables":{"p":"0xYourAddress"}}'Read the markets
markets returns per-pair stats, computed in SQL at query time: open interest, rolling volume, trade count, and the last trade.
query Markets {
markets {
pair # "USD/PHP"
whitelisted
oracle
openInterest
volume24h
volume7d
tradeCount
lastTradeTime
}
}What does it index?
All 26 core events, none dropped; every one also lands raw, keyed by (txHash, logIndex), so re-scanning a range is harmless. The query surface groups them into entities:
| Query | What it returns |
|---|---|
syncStatus | Last indexed block, chain head, healthy flag |
positions / position | Bound positions, by party / pair / status, or by id |
trades | Bound events, newest first |
markets | Per-pair open interest, volumes, trade count, last trade |
firms / firm | Registered makers and takers, with their state flags |
vmSettlements | Variation-margin transfers |
collateralFlows | Deposits, withdrawals, allocations, fills, claims |
creditEvents | Liquidations, cascades, defaults, suspensions, terminations |
NoteThe chain is still the ledger. When an indexed figure and an on-chain read diverge, the on-chain read is authoritative.