Build a Deliverable Forward
Goal
Deliver a real forward to your customer. You will quote them a locked rate, hedge it with a CRX NDF, stay margined through the life of the trade, and deliver the currency at maturity. The customer faces only you; you face the market on CRX and commit none of your own capital.
Testnet only. The hedge leg runs on Sonic Testnet, chain 14601.
No public fork repo yet. Where an artifact is not public, contact CRX. The flow below is the target program.
Partner-facing. Not legal advice — confirm with counsel.
Before you start
- Your firm is approved as a
TAKERon the venue (the hedge leg is a taker trade). - You run a spot conversion business in the currency pair already.
- You hold the relayer base URL and the deployed core address (API reference, ~4 min).
- You understand the taker flow: Trade — Get Started (~5 min).
Step 1 — Customer requests a forward in your app
In your forward widget, the customer enters notional, pair, and maturity. This is your UI and your customer — CRX never sees them.
Step 2 — Customer funds the margin into your wallet
The customer transfers initial margin into your wallet. It becomes yours to use: you return it at maturity once they pay, or apply it to the hedge if they don't. This is what lets you commit none of your own capital.
Step 3 — Request the matching NDF quote from CRX
Open a directed RFQ for that exact contract — pair, notional, the tenor that matches your maturity. This is the standard taker request.
const res = await fetch(`${RELAYER}/rfq`, {
method: "POST",
headers: { "Content-Type": "application/json", "X-CRX-Address": partner },
body: JSON.stringify({
counterparty: maker,
pair, notional: notionalWad, direction: "long",
tenor_days: tenor, quote_window_secs: 600,
}),
}).then((r) => r.json());
You get a firm NDF quote — the locked-rate leg.
Step 4 — Quote the customer: hedge rate + your markup
Add your spread plus the spot conversion you will run at delivery. Show the customer one rate, in your app.
customer_rate = hedge_rate + your_markup
Step 5 — Customer accepts, contingent on delivery
The forward is set: the customer receives the currency at maturity only if they pay you then. They face only you.
Step 6 — Open the matching hedge on CRX
Accept the NDF quote and bind it. The customer's collateral is posted into the CRX contract as your margin — you commit none of your own capital.
// fetch the anchored bundle, sign the Terms, bind
await crx.write.openAndBind([
partner, maker, 0n, zeroAddress, terms, partnerSig, bundle.maker_signature,
]);
await crx.write.allocate([maId, USDC, im]);
Step 7 — Stay margined daily
As the rate moves, CRX margins you, and you margin the customer to match. Variation margin clears continuously into your general balance — no margin call to answer.
Step 8 — Deliver at maturity
The branch, the only place the path forks:
- The customer pays. You buy the currency at that day's spot and deliver it. The NDF pays or collects the rate difference, so your locked rate holds. You keep your markup.
- The customer does not pay. Their collateral covers the hedge close-out at no loss to you. You keep your markup.
Either way your cost is locked against any move in the rate, and the customer's collateral covers you if they fail. You quote a tight rate and carry no FX risk.
You build the deliverable forward your customers want, from the one leg you were missing.
Next: Whitelabel DF — Get Started (~4 min) — the model behind these steps, and the cost case for the NDF leg.