# CRX API > CRX account, trading and maker calls. - API: https://api.crxfx.com - API reference (OpenAPI): https://discover.crxfx.com/openapi-taker.yaml Taker calls read markets, open RFQs, accept quotes, read the account, move collateral and grant read-only viewers. Maker calls send and cancel firm quotes, decline RFQs and request a test trade. **Authentication.** Every call except `GET /health` and `GET /markets` carries the signed headers `x-crx-address`, `x-crx-ts` and `x-crx-sig`; add `x-crx-signer` when a delegate signs. `x-crx-sig` is the `personal_sign` (EIP-191) signature of this message, lines joined with `\n`, no trailing newline: ```text CRX-REST-LOGIN Audience: crx-gateway Method: Path: Custody: Signer: Timestamp: Body: 0x ``` Each signed call is accepted once. A session token from `POST /session` replaces the signed headers on the calls that list it. **Signatures.** The signed headers and `POST /session` sign the EIP-191 text message `CRX-REST-LOGIN`; the stream logon signs `CRX-WS-LOGIN`. An accept, a withdrawal and a quote sign EIP-712 typed data. A custodian must allow both kinds. No text signature moves money. **Errors.** A refusal returns `error` and `code`; most add `outcome` and `message`, and some add `details`. Branch on `code`; show `message` to users. During a restart, any POST, PUT or DELETE can return `503` `service_restarting` with `Retry-After`. An unsupported method returns `405` `method_not_allowed`. **Versions.** Paths carry no version. Responses can add fields, enum values and error codes; ignore unknown ones. **Rate limits.** Rate-limited calls return `ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset` and `ratelimit-refill`; a `429` adds `Retry-After`. **Units.** Amounts and rates are decimal strings. Times are Unix time in milliseconds unless a field states seconds. **Events.** `GET /trades` returns your account's events. The schema `Event` types each event by its `type`. `seq` numbers your account's events from 1. A number can be skipped. Each event keeps its `seq` and `ts` on every read. Ignore an unknown `type`. **Cache and source age.** | Read | Cache | Source age | | --- | --- | --- | | `GET /markets` | 60 s. Chain data in it can be up to 300 s old. A market change clears it sooner. Each request computes `session`. | A pair whose read fails keeps its last row for 30 s, then leaves the list. | | `GET /balance` | None. Checks behind `state` and account approval: up to 30 s. | `as_of` and `as_of_block` date the figures. `state` `stale` with `seat_view.reason` `behind` keeps figures up to 7,200 s old. | | `GET /positions` | None. | `mark_time` dates `mark_price`: a spot price at most 180 s old, else a forward curve at most 3,720 s old, else `null`. | | `GET /trades` | None. | `ts` is the event time. | **Upcoming changes.** | Effective (UTC) | Change | Required action | | --- | --- | --- | | — | None scheduled. | None. | ## GET /markets: List markets Lists the pairs a chain offers, with trading hours and limits. ## POST /rfqs: Open a request for quotes Opens an RFQ and returns the winning quote when quoting closes, 5 seconds after the open. The RFQ stays open 120 seconds, until `closes_at`. Set your HTTP timeout to 30 seconds. With no quote, `quote` is `null` and `outcome` says why. A quote outside the chain's off-market band never wins; if none remains, the RFQ ends `cancelled` with a `reason`. ## GET /rfqs/{rfq_id}/accept-check: Check an accept before you sign Runs the checks of `POST /rfqs/{rfq_id}/accept` on `quote_id`, in the same order and with the same refusals, without a `sig`. It reserves nothing and opens no trade. A pass returns the `trade_template` the accept takes a signature over. The state can change before the accept, and the accept runs every check again. ## POST /rfqs/{rfq_id}/accept: Accept a quote Accepts the winning `quote` before `closes_at`. `sig` signs the quote's `trade_template`; see `TradeTemplate`. CRX submits the trade on chain; you send no transaction. The result arrives on `GET /trades` as `trade.opened` or `trade.refused`. ## POST /rfqs/{rfq_id}/quotes: Send a firm quote Sends a firm quote for an RFQ within 5 seconds of `rfq.opened`. Makers only. The quote must expire at least 60 seconds after it is sent. To replace a quote, send it again with the same `leg_id` within the 5-second quote window, with a new `client_quote_id` or none. Follow it on `GET /trades`: `rfq.quoted`, then `rfq.accepted`, `rfq.expired`, `quote.expired` or `quote.dropped`. ## DELETE /rfqs/{rfq_id}/quotes/{leg_id}: Cancel a quote Cancels your quote immediately. Makers only. Follow `quote.dropped` on `GET /trades`. ## POST /rfqs/{rfq_id}/decline: Decline an RFQ Declines an RFQ you have not quoted, within its quote window. Makers only. Send `{}` or one `reason`. ## GET /balance: Read your balance Returns your collateral, margin, and last deposit and withdrawal. Granted viewers can call it. ## GET /positions: List your open positions Lists your open positions. Granted viewers can call it. ## GET /trades: Read your event tape Lists your past events, oldest first. For the next page, pass the returned `seq` as `after`. Granted viewers can call it. ## POST /deposit: Get deposit transactions Returns the unsigned approve (when the allowance is short) and deposit transactions. Send them from your account. Credited in about a minute. Track it on `deposit.last` (`GET /balance`) or the `deposit.*` events on `GET /trades`. ## POST /withdraw: Withdraw Withdraws collateral to the account wallet only. Sign the EIP-712 struct `WithdrawIntent(address account,uint256 amount,uint64 nonce,uint64 deadline)`, with `account` set to your account and `amount` in USD × 1e6, in the domain with name `CRX`, version `rulebook-1.0`, and the `chain_id` and `core` from `GET /health`. Withdrawal approval time: 60 minutes. Follow `withdraw.last` on `GET /balance` until `final` is `true`. ## POST /session: Mint a session token Returns a token that replaces the signed headers for 8 hours, on the calls that list it. Send no body. The token can read the account, open RFQs, cancel quotes and decline RFQs; an accept, a quote and a withdrawal still need the account key's signature. A session token cannot grant or remove a viewer or mint a session. The token can end before 8 hours. Mint a new token after a `401` `unauthorized`. ## DELETE /session: End session tokens With `x-crx-session`, the call ends that token only. Without it, a call signed by the account wallet ends all session tokens of the account. This includes the tokens of its delegates. Stream connections do not close.