Open a request for quotes
POST/rfqs
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.
Authentication
x-crx-addressx-crx-tsx-crx-sigx-crx-addressx-crx-signerx-crx-tsx-crx-sigx-crx-session
Request body
| Field | Type | Description |
|---|---|---|
chain required | string | A |
pair required | string |
|
side required | string buy sell |
|
notional required | string | Amount in the base currency, up to 6 decimal places, within the |
expiry required | integerminimum 0 | Maturity, within the |
premium_bps | integer-10000 to 10000default 0 | Upfront premium in basis points; positive if the taker pays. Within ± |
quote_expiry | integerminimum 0 | Latest quote expiry you accept, in Unix time (milliseconds). The answer's |
client_rfq_id | stringlength 1 to 128 | Your RFQ ID: 1 to 128 printable ASCII characters. The same ID and terms, |
settlement_fixing | string BRL_PTAX MXN_FIX PHP_BAP | Settle at an official fixing: |
Responses
200
The RFQ and its winning quote.
| Field | Type | Description |
|---|---|---|
rfq_id required | string | |
client_rfq_id required | string or null | Your RFQ ID, or |
kind required | string open | |
status required | string open quoted accepted opened settled expired cancelled | |
leg_id required | string | Your leg ID. The last 8 bytes are |
chain required | string | Chain key. |
pair required | string | Pair in compact form, such as |
notional required | string | Decimal string. |
premium_bps required | integer | Premium in basis points; positive if the taker pays. |
taker_ref | string or null | The |
side required | integer 1 -1 | Your side: |
expiry required | integerminimum 0 | Unix time in milliseconds. |
closes_at required | integerminimum 0 | RFQ end, 120 seconds after the open. No accept after it. |
quote_expiry_max required | integer | Latest quote expiry, in Unix time (seconds). The last 8 bytes of your |
quotes required | array of object |
|
quotes[].quote_id required | string | Quote ID to send on accept. |
quotes[].rate required | string | Quoted rate. |
quotes[].expires_at required | integerminimum 0 | Quote expiry, in Unix time (milliseconds). |
quotes[].status required | string quoted expired accepted declined dropped | Only a |
quotes[].pyth_spot | string | The pair's Pyth spot when the quote was posted, in the pair's orientation, 6 decimals. Omitted with no current spot. |
quotes[].pyth_spot_at | integerminimum 0 | The time of |
quotes[].forward_points | string |
|
quotes[].margin_impact | object | What this trade does to your margin: on a quote, your side at the quote's rate; on |
quotes[].margin_impact.im_added required | string | The change in your initial margin the trade causes, USD, 6 decimals, signed. Negative when the trade offsets your positions. |
quotes[].margin_impact.free_after required | string | Free collateral after the trade, USD, 6 decimals, taking that change, the trade's premium and any immediate mark loss. |
quotes[].margin_impact.covered required | boolean | Whether CRX's pre-trade collateral check lets the trade through. This check is stricter than |
quotes[].margin_impact.as_of required | integerminimum 0 | The time of the figures. |
quote required | object or null | The winning quote, or |
quote.quote_id required | string | Quote ID to send on accept. |
quote.rate required | string | Quoted rate. |
quote.expires_at required | integerminimum 0 | Quote expiry, in Unix time (milliseconds). |
quote.status required | string quoted expired accepted declined dropped | Only a |
quote.pyth_spot | string | The pair's Pyth spot when the quote was posted, in the pair's orientation, 6 decimals. Omitted with no current spot. |
quote.pyth_spot_at | integerminimum 0 | The time of |
quote.forward_points | string |
|
quote.margin_impact | object | What this trade does to your margin: on a quote, your side at the quote's rate; on |
quote.margin_impact.im_added required | string | The change in your initial margin the trade causes, USD, 6 decimals, signed. Negative when the trade offsets your positions. |
quote.margin_impact.free_after required | string | Free collateral after the trade, USD, 6 decimals, taking that change, the trade's premium and any immediate mark loss. |
quote.margin_impact.covered required | boolean | Whether CRX's pre-trade collateral check lets the trade through. This check is stricter than |
quote.margin_impact.as_of required | integerminimum 0 | The time of the figures. |
quote.trade_template | object | The Build your own
Sign your own object with |
quote.trade_template.typed_data required | object | The An |
quote.trade_template.typed_data.types required | object | |
quote.trade_template.typed_data.primaryType required | string |
|
quote.trade_template.typed_data.domain required | object | |
quote.trade_template.typed_data.message required | object | The struct's fields. For |
reason | string | Cancel reason: |
price_expected_by | integerminimum 0 | Time the next price is expected. Present only on a |
price_expected_by_at | string |
|
outcome | string | Why |
message | string | Text to show the user. On a cancel with |
400
bad_request, notional_below_minimum, notional_above_maximum, invalid_signature. fixing_unavailable: CRX does not offer settlement at the requested fixing for this pair, expiry or account now; message says why.
code bad_request notional_below_minimum notional_above_maximum invalid_signature fixing_unavailable
401
unauthorized: a header is missing or malformed, x-crx-ts is out of range, the call was already used, the signature does not match, or the caller lacks access.
code unauthorized
403
not_whitelisted: the account is not approved for this call. setup_pending: the account is approved and its setup is in progress. seat_cannot_sign: the account wallet cannot sign trades. Contract wallets such as a Safe are refused; an EOA with an EIP-7702 delegation is accepted.
code not_whitelisted setup_pending seat_cannot_sign
408
timeout: no answer within 30 seconds. Resend with the same client_rfq_id and terms.
code timeout
409
conflict: the same client_rfq_id with other terms. market_paused: the pair accepts no new RFQs. platform_paused: CRX is paused.
code conflict market_paused platform_paused
413
payload_too_large: the body is over 2 MiB.
code payload_too_large
415
unsupported_media_type: send content-type: application/json.
code unsupported_media_type
422
unprocessable_entity: a field has the wrong type. insufficient_collateral: free collateral does not cover the margin this trade adds; details carries side, required and available in USD. expiry_outside_hours, expiry_past_fence: the expiry is outside the hours CRX accepts, or past its latest date. expiry_after_delist: the expiry is at or after delisting_at on GET /markets.
code unprocessable_entity insufficient_collateral expiry_outside_hours expiry_past_fence expiry_after_delist
429
rate_limited: retry after Retry-After seconds.
code rate_limited
| Header | Type | Description |
|---|---|---|
Retry-After | integer | Seconds until the next call is accepted. |
ratelimit-limit | integer | Maximum calls in a burst. |
ratelimit-remaining | integer | Calls remaining before the limit. |
ratelimit-reset | integer | Seconds until the full limit is restored. |
ratelimit-refill | integer | Calls restored per minute. |
502
upstream: a chain read failed. Retry shortly.
code upstream
503
collateral_unverified: no current collateral figure; retry shortly. withdraw_pending: a pending withdrawal blocks the collateral check; details carries step, reason (withdraw_unconfirmed or withdraw_above_free), expected_by and expected_by_at. Retry after expected_by_at.
code collateral_unverified withdraw_pending
Schemas
TradeTypedData
The Trade struct, one line, no space after a comma:
Trade(string summary,string pair,string side,uint256 notionalE6,uint64 rateE6,int16 premiumBps,uint40 maturity,bytes32 pairC,bytes32 ownLegId,uint64 ownNonce,bytes32 ownSalt)
Typehash 0x2a4f432dd51178481baaacab72453a149e29560e5d366c2ebb93bb767fab4630. Build each field from your own RFQ and the quote:
| Field | From | Form |
|---|---|---|
summary | the fields below | one line, rules below |
pair | the RFQ pair | slash form, USDBRL → USD/BRL |
side | the RFQ side | 1 → buy, -1 → sell: your side, in the first currency |
notionalE6 | the RFQ notional | × 10^6, exact; refuse more than 6 decimal places |
rateE6 | the quote rate | × 10^6, exact |
premiumBps | the RFQ premium_bps | signed. Positive: you pay |
maturity | the RFQ expiry | Unix time in seconds, floor(expiry / 1000) |
pairC, ownSalt | the template | as served |
ownLegId | the template | bytes 24–31 equal the RFQ's quote_expiry_max |
ownNonce | the template | at most now + 24 hours, Unix time in milliseconds |
summary: <side> <size> <BASE> vs <QUOTE> at <rate> <QUOTE> per <BASE>, matures <date>, upfront <up>. <size> and <rate> are the integer part, then . and the fraction with trailing zeros cut (no . when whole). <size> groups thousands with one space; <rate> is not grouped. <date> is YYYY-MM-DDTHH:MM:SSZ, UTC. <up> is none, taker pays <P> % or maker pays <P> %. <P> is the premium in basis points / 100, with two decimal places. ASCII only, one space between words, no trailing space.
QuoteTypedData
The Quote a maker signs for POST /rfqs/{rfq_id}/quotes, as an eth_signTypedData_v4 object (see TypedData). The struct, one line, no space after a comma:
Quote(address seat,bytes32 legId,bytes32 pair,int8 side,uint256 notional,uint64 rate,int16 premiumBps,uint40 expiry,uint64 nonce,bytes32 salt,bytes32 takerRef)
Typehash 0x00fc8b1401eebfc809c01d3a7351526ef07cfd5902793c3d279de280c0aec2cb. Domain: name CRX, version rulebook-1.0, and the chain_id and core from GET /health, whose chains[].domain is the separator. Build each field from the RFQ and your quote:
| Field | From | Form |
|---|---|---|
seat | your account | x-crx-address |
legId | your leg_id | 24 random bytes, then quote_expiry_max as 8 bytes big endian |
pair | the RFQ pair | keccak256 of the slash form: USDBRL → keccak256("USD/BRL") |
side | the RFQ side | your side, as the RFQ shows it to you: 1 long base, -1 short |
notional | the RFQ notional | × 10^6, exact |
rate | your rate | × 10^6, exact; refuse more than 6 decimal places |
premiumBps | the RFQ premium_bps | signed |
expiry | the RFQ expiry | Unix time in seconds, floor(expiry / 1000) |
nonce | your leg_id | bytes 16–23, big endian. The body does not send it |
salt | your salt | as sent |
takerRef | the RFQ taker_ref | as served |
Test vector on chain ID 1, with an example core that is not deployed. This schema's example is its typed data; the request example of POST /rfqs/{rfq_id}/quotes is its body.
seat 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
legId 0x555555555555555555555555555555555555555555555555000000006ab13dd8
pair 0x644668ae48a22c7afafcf35ff66ebf9c8af2c396ae03de0795d66bde06cdf851 (keccak256("USD/BRL"))
side -1
notional 5000000000000
rate 5410000
premiumBps 0
expiry 1798732800
nonce 6148914691236517205
salt 0x6161616161616161616161616161616161616161616161616161616161616161
takerRef 0x4f412fb92304015b744b7a32155b5879b48aa8cbb0076b8234640f8891c53b0b
(taker account 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266,
taker leg id 0x111111111111111111111111111111111111111111111111000000006ab13dd8)
chainId 1
core 0x1111111111111111111111111111111111111111
domain 0xc10b07f28873cb547d1ab61e8cacb2c0084fc537ac932f55d21f403a0194785c
structHash 0xfc12020df46e5a207618f5dd4b960ca5dfb75bc5f279d0b168355b5402cbd089
digest 0x66ed64dcb1c180844db51855479f4be2557a3686c64da3c2474f261b4d59d3fc
sig 0xa060dd5965ab39968e1e6f5772969e8617ab2de88eb069e6bee0b67dc07b19600d52812d18a34fa708bbee1755ba6e4d74953120d4e0af7e6b14911510cba9131c
(signed by the seat: the public anvil test key 1)
{
"domain": {
"chainId": 1,
"name": "CRX",
"verifyingContract": "0x1111111111111111111111111111111111111111",
"version": "rulebook-1.0"
},
"message": {
"expiry": "1798732800",
"legId": "0x555555555555555555555555555555555555555555555555000000006ab13dd8",
"nonce": "6148914691236517205",
"notional": "5000000000000",
"pair": "0x644668ae48a22c7afafcf35ff66ebf9c8af2c396ae03de0795d66bde06cdf851",
"premiumBps": "0",
"rate": "5410000",
"salt": "0x6161616161616161616161616161616161616161616161616161616161616161",
"seat": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
"side": "-1",
"takerRef": "0x4f412fb92304015b744b7a32155b5879b48aa8cbb0076b8234640f8891c53b0b"
},
"primaryType": "Quote",
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"Quote": [
{
"name": "seat",
"type": "address"
},
{
"name": "legId",
"type": "bytes32"
},
{
"name": "pair",
"type": "bytes32"
},
{
"name": "side",
"type": "int8"
},
{
"name": "notional",
"type": "uint256"
},
{
"name": "rate",
"type": "uint64"
},
{
"name": "premiumBps",
"type": "int16"
},
{
"name": "expiry",
"type": "uint40"
},
{
"name": "nonce",
"type": "uint64"
},
{
"name": "salt",
"type": "bytes32"
},
{
"name": "takerRef",
"type": "bytes32"
}
]
}
}
TradeTemplate
{
"typed_data": {
"domain": {
"chainId": 1,
"name": "CRX",
"verifyingContract": "<core>",
"version": "rulebook-1.0"
},
"message": {
"maturity": "1798732800",
"notionalE6": "5000000000000",
"ownLegId": "0x111111111111111111111111111111111111111111111111000000006ab13dd8",
"ownNonce": "1790000000123",
"ownSalt": "0x3131313131313131313131313131313131313131313131313131313131313131",
"pair": "USD/BRL",
"pairC": "0x3bb28decf99b625916b2a3c41517a2035273e731a71df7b0e9d5c115ce899795",
"premiumBps": "0",
"rateE6": "5410000",
"side": "buy",
"summary": "buy 5 000 000 USD vs BRL at 5.41 BRL per USD, matures 2026-12-31T16:00:00Z, upfront none"
},
"primaryType": "Trade",
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"Trade": [
{
"name": "summary",
"type": "string"
},
{
"name": "pair",
"type": "string"
},
{
"name": "side",
"type": "string"
},
{
"name": "notionalE6",
"type": "uint256"
},
{
"name": "rateE6",
"type": "uint64"
},
{
"name": "premiumBps",
"type": "int16"
},
{
"name": "maturity",
"type": "uint40"
},
{
"name": "pairC",
"type": "bytes32"
},
{
"name": "ownLegId",
"type": "bytes32"
},
{
"name": "ownNonce",
"type": "uint64"
},
{
"name": "ownSalt",
"type": "bytes32"
}
]
}
}
}