Sealed RFQ Block Trades
Request sealed block quotes, compare signed maker responses with expiry timers, and settle atomically in one 150ms slot.
Sealed RFQ lets a trader or institutional desk request a firm block quote for a pair and size inside a sealed request envelope without broadcasting intent to public order books. Makers return signed quotes with a strict expiry window, and accepting one quote clears both sides atomically in settle_sealed_rfq.
How a sealed RFQ clears
- Request (`POST /v1/rfq/request`). Taker submits
ringId,pairId,side,size, andttlSeconds(5to120, default30). The relay hashes the request into anenvelopeHash, fans out the sealed request to connected makers, publishes anrfq_quoteSSE event on/v1/events, and returns therequestIdplus signedSealedRfqQuoteresponses. - Compare (`GET /v1/rfq/:requestId/quotes`). Each quote carries
quoteId,maker,makerLabel,price,outputAmount(net of protocol fee),feeAmount,feeBps,quoteCommitment,makerSignature, andexpiresAt. - Accept and build (`POST /v1/rfq/:requestId/accept/build`). Taker selects one
quoteIdbeforeexpiresAt. The API verifies Ring access, checks that both taker and maker hold unspentCommitmentNotebalances covering the block, and returns an unsigned v0settle_sealed_rfqtransaction (cosigned: true). - Sign and settle (`POST /v1/transactions/submit`). Taker signs first, the relay attaches the maker's co-signature and sends the transaction to Solana, and
mera_coreclears both shielded balances, transfersfee_paidtoProtocolConfig.fee_recipient, and writes anRfqSettlementRecordwith a TVK receipt.
Clearing a sealed RFQ in /trade
- Open Terminal, verify the active Ring, and select the Sealed RFQ tab.
- Choose pair, side, block size, and TTL, then press Request Sealed Quotes.
- Review the returned signed quote card showing maker label, firm price, net output, fee (
0.10%default), and live expiry countdown. - Press Accept Quote before the timer reaches zero and sign the transaction in your wallet.
- Copy the resulting TVK receipt from the confirmation panel or recent fills table to verify in Receipts.
Clearing a sealed RFQ with @mera/sdk
mera.requestAndAcceptRfq requests quotes, picks the top returned quote, builds the settle_sealed_rfq transaction, signs it, and submits it:
import { createMeraClient, keypairSigner } from '@mera/sdk'
const mera = createMeraClient({
apiUrl: 'http://127.0.0.1:36102',
signer: keypairSigner(takerKeypair),
})
const { rfq, quote, submission } = await mera.requestAndAcceptRfq({
ringId: 'ring-default',
pairId: 'SOL-USDC',
side: 'sell',
size: '10000000000', // 10 SOL block
ttlSeconds: 30,
})
console.log('RFQ ID:', rfq.requestId, 'Envelope:', rfq.envelopeHash)
console.log('Accepted maker:', quote.makerLabel, 'Price:', quote.price)
console.log('Settled slot:', submission.slot, 'Finality:', submission.finalityMs, 'ms')
console.log('TVK:', submission.tvk)Two-step RFQ inspection before accepting
Desks that enforce a minimum price or maximum spread check before signing can split the request and acceptance calls using mera.api:
import { VersionedTransaction } from '@solana/web3.js'
import { fromBase64, toBase64 } from '@mera/sdk'
const rfq = await mera.api.requestRfq({
wallet: takerKeypair.publicKey.toBase58(),
ringId: 'ring-default',
pairId: 'wBTC-USDC',
side: 'sell',
size: '10000000', // 0.1 wBTC (8 decimals)
ttlSeconds: 20,
})
const best = rfq.quotes.find((q) => q.price >= 95_000)
if (!best) throw new Error('No quote met desk price floor')
const built = await mera.api.buildAcceptRfq(rfq.requestId, {
wallet: takerKeypair.publicKey.toBase58(),
quoteId: best.quoteId,
})
const tx = VersionedTransaction.deserialize(fromBase64(built.transactionBase64))
tx.sign([takerKeypair])
const settled = await mera.api.submitTransaction({
id: built.id,
signedTransactionBase64: toBase64(tx.serialize()),
})
console.log('Settled TVK:', settled.tvk)Subscribing to live RFQ quotes via SSE
Listen to GET /v1/events (or mera.api.eventsUrl(ringId)) for real-time rfq_quote and fill_settled events. See REST & WebSocket API Reference for payload schemas.
Failure cases
QUOTE_EXPIRED(409): The quote'sexpiresAttimestamp passed beforeaccept/buildran. Submit a new RFQ request.INSUFFICIENT_SHIELDED_BALANCE(400): Taker has no single unspent note coveringsize.UPSTREAM_UNAVAILABLE(502): Maker shielded inventory does not cover the requested block size.RING_ACCESS_DENIED/RING_FROZEN(403): Wallet lacks permission in the target Ring.