How It Works
Connect to the relay
Open a WebSocket connection to the maker endpoint. You receive a confirmation message with the protocol version and server time.If the relay requires authentication, append your API key:
Receive RFQ broadcasts
When a trader submits a signed RFQ, the relay broadcasts it to all connected makers. You receive the full trade envelope with market data, option parameters, and a deadline.
Core Quoting Loop
| Step | Action |
|---|---|
| Connect | WS /maker/v1/ws — receive connected message |
| Listen | Receive rfq messages with trade parameters |
| Quote | Reply with quote message before deadlineIso |
| Win | Relay auto-signs on-chain order if your quote is selected |
| Settle | Taker calls fill() — atomic on-chain settlement |
Winner Selection
| Taker action | Winning quote |
|---|---|
| Buying options | Lowest valid price wins |
| Selling options | Highest valid price wins |
Quote Validation Rules
Your quote must pass these validation checks:| Rule | Constraint |
|---|---|
rfq_id match | Must match the original RFQ ID |
| Side | Must be opposite to taker’s side (taker buys → you sell) |
| Size | Must be ≥ 50% of the requested tradeSizeMicro |
| Price | Must be in (0, 1) |
| No-arbitrage | Buy price ≤ max payoff (i.e. ≤ 1 − K for calls, ≤ K for puts) |
Check Relay Status
Verify your connection and see how many makers are online:Environment Variables
If you are running your own relay instance, these variables control maker behavior:| Variable | Default | Description |
|---|---|---|
MAKER_RFQ_TIMEOUT_MS | 800 | Quote collection window in ms (50–30,000) |
MAKER_API_KEY | — | If set, required as ?apiKey= on WS connections |
RFQ_ALLOWED_ORIGINS | http://localhost:3000 | Comma-separated CORS origins |
