chordDocs

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

MethodPathReturns
GET/health{ status: "ok" } when the process is up
GET/ready{ status: "ready", slot } when the database and verified chain state are reachable
GET/configProgram, config, chain domain, pair, reference price, settlement delegate, symbols, and the market’s phase lengths and order cap
GET/marketThe current processed slot and the 24 latest batches with counts and committed prices
GET/batchesThe 50 latest batches
GET/batches/:idOne batch with its orders, quotes and fills, and its committed price
POST/intentsSubmits a signed order. 201 with the stored order
GET/intents?owner=That owner’s 100 latest orders
GET/intents/:hashOne order and its finalized accounting
POST/intents/:hash/reconcileRefreshes one order from finalized chain state
GET/intents/:hash/cancellation-transactionAn unsigned cancel_nonce transaction for the owner to sign
POST/candidatesSubmits a solver quote. 201 with the stored quote
GET/batches/:id/solver-signature-requestThe winning commit, waiting for the solver’s signature
POST/transactions/:id/solver-signatureThe solver’s signature for that exact message
GET/tokenCHORD supply and authorities, total staked, cooling and burned, solver minimum, cooldown
GET/stakes/:ownerOne staker’s active and cooling stake, cooldown end and voting power; with ?proposal=, the weight a vote on it counts
GET/marketsEvery market: pair, window lengths, order cap, enabled
GET/governanceRealm, governance, treasury balance, proposal threshold, quorum, voting and hold-up times
GET/governance/proposalsEvery proposal with its state and tally
GET/governance/proposals/:addressOne proposal and its transactions

#Config

Terminal
curl "$CHORD_API/config"
JSON
{
  "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

Terminal
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.

CodeWhen
BAD_SIGNATUREThe signature doesn’t verify against the canonical order
UNKNOWN_BATCHThe batch isn’t indexed
COLLECTION_CLOSEDThe batch’s collection window has ended
BATCH_NOT_OPENThe batch isn’t collecting on chain
BATCH_FULLThe batch reached its order cap
SHORT_EXPIRYThe order expires before the batch’s settlement deadline
WRONG_PAIRThe order’s mints aren’t this market’s pair
TOKEN_OWNER_MISMATCHThe source or destination doesn’t belong to the signer
TOKEN_MINT_MISMATCHA token account holds the wrong mint
FROZEN_ACCOUNTA token account is frozen
DELEGATION_REVOKEDThe allowance is missing, names another delegate, or is too small
INSUFFICIENT_USER_FUNDSThe source can’t cover the sell amount
NONCE_INVALIDATEDThe nonce is below the owner’s on-chain floor
NONCE_CONSUMEDThe nonce already has an on-chain receipt
NONCE_REPLAYThe owner already submitted a different order with this nonce
INTENT_EXPIREDThe expiry slot has passed
SOLVE_WINDOW_CLOSEDA quote arrived outside the solve window
DEPENDENCY_UNAVAILABLEThe database or finalized chain state can’t be read