Quick Start
This guide walks through three calls against the live relayer: authenticate, read a live number, and answer one RFQ. There are no choices and no theory — copy each block, run it, and 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"}If {"status":"ok"} returns, the relayer is reachable.
Authenticate
In this step, the caller makes two POST calls: a challenge, then a login. Set the maker address first. The full request shapes and token rules are in 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 the maker 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…"The login returns a one-hour JWT. Send Authorization: Bearer $TOKEN on every authenticated call below.
Read a live mark
In this step, the caller reads a live mark — a public endpoint, which needs no token. Ask the relayer for the live vol-scaled margin schedule on USD/MXN; the numbers come from live Pyth volatility, making the response real and responsive to the market. Request the schedule using the following command:
# pairId for USD/MXN = keccak256("USD/MXN")
PAIR="0x69f1670ccd0386df6e79b445190cb08f07e9d85ef8bb6ef820417312ea39752f"
curl -s "$RELAYER/margin?pair=$PAIR¬ional=100000"
# {"imTakerBps":471,"imTaker":4710,"imMakerBps":250,"imMaker":2500,
# "thresholdBps":0,"mtaBps":10,"tolBps":47,"volPct":0.5957}volPct is the live Pyth daily volatility the schedule scaled from. If it prints, the relayer reached the live oracle and the first live mark is read.
Answer one RFQ
In this step, the caller runs the trade path: poll the inbox, price the RFQ, sign the Terms, and confirm. Authentication is 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":"18500000","im_taker_bps":471,"im_maker_bps":250,"threshold_bps":0,"mta_bps":10,"tol_bps":47,"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 — the first RFQ is answered.
What just happened
In this quickstart:
- 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 the 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 the desk to the inbox and the binding signature.
- Reference everything. CRX API (~4 min). Every endpoint, every request and response shape.