1. CRX
  2. API reference

CRX API v3

CRX account, trading and maker calls.

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:

CRX-REST-LOGIN
Audience: crx-gateway
Method: <HTTP method, uppercase>
Path: <request path, no query string>
Custody: <x-crx-address, 0x + 40 lowercase hex>
Signer: <x-crx-signer if sent, else x-crx-address; 0x + 40 lowercase hex>
Timestamp: <x-crx-ts>
Body: 0x<keccak256 of the exact body bytes sent, zero bytes if none; 64 lowercase hex>

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.

Error

FieldTypeDescription
error requiredstring

Technical error text. Subject to change.

code requiredstring

Stable error code; branch on this value.

outcomestring

One-word outcome. Not on every error; new values can appear.

messagestring

Text to show the user. On a 400 or 422, it names the field and the value to send.

detailsobject

Error details. Omitted if the code has none.

details.limitstring

Limit breached, on outside_limits. min_size, max_size, tenor, premium, pair, open_limit, quotes or fee.

details.pair_statusstring paused delisted

Pair status, on market_paused.

details.delisting_atintegerminimum 0

Scheduled delisting time, on market_paused.

Base URL

https://api.crxfx.com

Production. Ethereum (ethereum) and USDC.

Headers

HeaderDescription
x-crx-address

The account wallet, as 0x hex.

x-crx-signer

The signing delegate or viewer, as 0x hex. Send only when the account wallet does not sign.

x-crx-ts

Signing time, in Unix time (milliseconds). At most 5 seconds ahead of and 120 seconds behind server time; use a new value for every call.

x-crx-sig

EIP-191 signature of the CRX-REST-LOGIN message by the account, a delegate or a viewer, as 0x hex. The message format is under Authentication.

x-crx-session

Session token from POST /session, valid for 8 hours. Replaces the signed headers.

Market data

Service status and markets. No signature required.

GET /healthRead service status
GET /marketsList markets

RFQs

Request quotes and accept one.

POST /rfqsOpen a request for quotes
POST /rfqs/{rfq_id}/acceptAccept a quote
GET /rfqs/{rfq_id}/accept-checkCheck an accept before you sign

Maker

Send, cancel and decline quotes; request a test trade. Makers only.

POST /test-requestsRequest a maker test trade
POST /rfqs/{rfq_id}/quotesSend a firm quote
DELETE /rfqs/{rfq_id}/quotes/{leg_id}Cancel a quote
POST /rfqs/{rfq_id}/declineDecline an RFQ

Account

Balance, positions and events.

GET /balanceRead your balance
GET /positionsList your open positions
GET /tradesRead your event tape

Viewers

Read-only access for other wallets.

GET /viewersList your viewers
PUT /viewers/{viewer}Grant a viewer
DELETE /viewers/{viewer}Remove a viewer

Funds

Deposit and withdraw collateral.

POST /depositGet deposit transactions
POST /rpcSend a chain call
POST /withdrawWithdraw

Session

Session tokens that replace the signed headers.

POST /sessionMint a session token
DELETE /sessionEnd session tokens