Developers
Collector API
Every public endpoint, with request and response shapes.
The collector is an HTTP API over JSON. Every u64 is a decimal string, slots included. It is served under /api/chord on the app’s own origin, so the browser never talks to a second host. The examples below use $CHORD_API for that base URL.
#Endpoints
| Method | Path | Returns |
|---|---|---|
GET | /health | { status: "ok" } when the process is up |
GET | /ready | { status: "ready", slot } when the database and verified chain state are reachable |
GET | /config | Program, config, chain domain, pair, reference price, settlement delegate, symbols, and the market’s phase lengths and order cap |
GET | /market | The current processed slot and the 24 latest batches with counts and committed prices |
GET | /batches | The 50 latest batches |
GET | /batches/:id | One batch with its orders, quotes and fills, and its committed price |
POST | /intents | Submits a signed order. 201 with the stored order |
GET | /intents?owner= | That owner’s 100 latest orders |
GET | /intents/:hash | One order and its finalized accounting |
POST | /intents/:hash/reconcile | Refreshes one order from finalized chain state |
GET | /intents/:hash/cancellation-transaction | An unsigned cancel_nonce transaction for the owner to sign |
POST | /candidates | Submits a solver quote. 201 with the stored quote |
GET | /batches/:id/solver-signature-request | The winning commit, waiting for the solver’s signature |
POST | /transactions/:id/solver-signature | The solver’s signature for that exact message |
GET | /token | CHORD supply and authorities, total staked, cooling and burned, solver minimum, cooldown |
GET | /stakes/:owner | One staker’s active and cooling stake, cooldown end and voting power; with ?proposal=, the weight a vote on it counts |
GET | /markets | Every market: pair, window lengths, order cap, enabled |
GET | /governance | Realm, governance, treasury balance, proposal threshold, quorum, voting and hold-up times |
GET | /governance/proposals | Every proposal with its state and tally |
GET | /governance/proposals/:address | One proposal and its transactions |
#Config
curl "$CHORD_API/config"{
"programId": "DosESkyr8zE6V98GyS5VkStkknYkeVJzUxYx6AMKT2od",
"config": "…",
"chainDomainHex": "…",
"mintA": "…",
"mintB": "…",
"symbolA": "SOL",
"symbolB": "USDC",
"referencePrice": { "numerator": "711", "denominator": "5000" },
"maxBatchOrders": 32,
"settlement": "…",
"market": { "address": "…", "enabled": true },
"slots": { "collection": 96, "solve": 64, "settle": 512 },
"priceUnits": "token-B-base-units per token-A-base-unit"
}Check chainDomainHex before signing anything: it must equal the SHA-256 of your RPC’s getGenesisHash string. The app does this on load.
#Submitting an order
curl -X POST "$CHORD_API/intents" \
-H 'content-type: application/json' \
-d '{ "intent": { …IntentWire… }, "signature": "<64 bytes, base64>" }'The body must be exactly { intent, signature }, with canonical base58 keys, canonical decimal integers and a canonical base64 signature. Unknown fields are rejected. Submitting the same signed order twice returns the stored one.
#Errors
Errors are JSON: { "error": "CODE", "message": "…" }. Bad input is 400, unknown records 404, conflicts with chain or batch state 409, and an unreachable database or RPC 503.
| Code | When |
|---|---|
BAD_SIGNATURE | The signature doesn’t verify against the canonical order |
UNKNOWN_BATCH | The batch isn’t indexed |
COLLECTION_CLOSED | The batch’s collection window has ended |
BATCH_NOT_OPEN | The batch isn’t collecting on chain |
BATCH_FULL | The batch reached its order cap |
SHORT_EXPIRY | The order expires before the batch’s settlement deadline |
WRONG_PAIR | The order’s mints aren’t this market’s pair |
TOKEN_OWNER_MISMATCH | The source or destination doesn’t belong to the signer |
TOKEN_MINT_MISMATCH | A token account holds the wrong mint |
FROZEN_ACCOUNT | A token account is frozen |
DELEGATION_REVOKED | The allowance is missing, names another delegate, or is too small |
INSUFFICIENT_USER_FUNDS | The source can’t cover the sell amount |
NONCE_INVALIDATED | The nonce is below the owner’s on-chain floor |
NONCE_CONSUMED | The nonce already has an on-chain receipt |
NONCE_REPLAY | The owner already submitted a different order with this nonce |
INTENT_EXPIRED | The expiry slot has passed |
SOLVE_WINDOW_CLOSED | A quote arrived outside the solve window |
DEPENDENCY_UNAVAILABLE | The database or finalized chain state can’t be read |