Quick Start
Three calls against the live relayer. Authenticate, read a live number, answer one RFQ. No choices, no theory. Copy each block, run it, see the result before moving on.
Set the base URL once; every call below is relative to it (CRX API, ~4 min):
RELAYER="https://app.crxfx.com/svc/relayer"Confirm it is up:
curl "$RELAYER/health"
# {"status":"ok"}Authenticate
Two POST calls: a challenge, then a login. Set your maker address first. Full shapes and token rules: Authentication (~4 min).
ADDR="0xYourMakerAddress"
# 1a. Challenge - get the exact message to sign
curl -s -X POST "$RELAYER/auth/challenge" \
-H 'content-type: application/json' \
-d "{\"address\":\"$ADDR\"}"
# {"message":"Sign in to CRX relayer.\nAddress: …\nNonce: …\nExpires: …"}const ADDR = "0xYourMakerAddress";
// 1a. Challenge - get the exact message to sign
const res = await fetch(`${RELAYER}/auth/challenge`, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ address: ADDR }),
});
console.log(await res.json());
// {"message":"Sign in to CRX relayer.\nAddress: …\nNonce: …\nExpires: …"}Sign that exact message with your wallet, then exchange the signature for a token:
# 1b. Login - exchange the signature for a JWT
curl -s -X POST "$RELAYER/auth/login" \
-H 'content-type: application/json' \
-d "{\"address\":\"$ADDR\",\"signature\":\"0xYourSignature\"}"
# {"token":"eyJ…","expires_at":1780313385}
TOKEN="eyJ…"Send Authorization: Bearer $TOKEN on every authenticated call below.
Read a live mark
A public read, no token needed. Ask the relayer for the live vol-scaled margin schedule on USD/INR. The numbers come from live Pyth volatility, so the response is real and moves with the market:
# pairId for USD/INR = keccak256("USD/INR")
PAIR="0xb88ea9916342b79eb925490733f4ef685aae8eaf3cefa07ba7fc36396d229201"
curl -s "$RELAYER/margin?pair=$PAIR¬ional=100000"
# {"imTakerBps":2,"imTaker":20,"imMakerBps":1,"imMaker":10,
# "thresholdBps":0,"mtaBps":10,"tolBps":25,"volPct":0.3038}volPct is the live Pyth daily volatility the schedule scaled from. If it printed, the relayer reached the live oracle. You read a live mark.
Answer one RFQ
Now the trade path. Poll your inbox, price the RFQ, sign the Terms, confirm. Auth required.
# 3a. Poll the RFQs directed at your desk
curl -s "$RELAYER/rfq/inbox?maker=$ADDR" \
-H "authorization: Bearer $TOKEN"
# [{ "rfq_id":"0x…", "taker":"0x…", "maker":"0x…", "aca_number":"1",
# "instrument":"0", "pair":"0x…", "tenor_days":30, "notional":"100000",
# "direction":"long", "expiry":1780313385, "margin":{ … } }]
RFQ="0x…"
# 3b. Price it - the relayer returns the canonical Terms to sign
curl -s -X POST "$RELAYER/rfq/$RFQ/quote" \
-H "authorization: Bearer $TOKEN" \
-H 'content-type: application/json' \
-d '{"quote":{"rfq_id":"0x…","taker":"0x…","maker":"0x…","aca_number":"1","instrument":"0","pair":"0x…","locked_rate":"83200000","im_taker_bps":2,"im_maker_bps":1,"threshold_bps":0,"mta_bps":10,"tol_bps":25,"valid_until":1780313385,"quote_nonce":"1"}}'
# {"quote_ref":"0x…","terms":{ … },"valid_until":1780313385} ← sign terms, EIP-712
# 3c. Confirm with your EIP-712 signature over Terms
curl -s -X POST "$RELAYER/rfq/$RFQ/confirm" \
-H "authorization: Bearer $TOKEN" \
-H 'content-type: application/json' \
-d '{"signature":"0xYourTermsSignature"}'
# {"quote_ref":"0x…","valid_until":1780313385}The quote is now firm and anchoring on-chain. The taker pulls the dual-signed bundle and binds it. You answered an RFQ.
What you just did
- Authenticated against the relayer and held a one-hour JWT.
- Read a live, oracle-backed number off a public endpoint.
- Priced, signed, and confirmed one quote.
Where to go next
Pick the track that matches your seat:
- Trade as a taker. Trade: Get Started (~5 min). Open an RFQ, lock a quote, submit the bundle.
- Quote as a maker. Quote: Get Started (~2 min). Wire your desk to the inbox and the binding signature.
- Reference everything. CRX API (~4 min). Every endpoint, every request and response shape.