Create an RFQ
Submit a Request for Quotation to the OptionFactory and have market makers compete to fill your custom option. This page covers cash-settled RFQs (the default). For physically settled options, see Physical Options.
RFQ uses the same cash-settled implementation contracts as OptionBook (PUT, INVERSE_CALL, spreads, etc.). The difference is that you choose the strike and expiry instead of filling an existing order.
Prerequisites
Install the SDK:
npm install @thetanuts-finance/thetanuts-clientA funded wallet on Base mainnet (chain ID 8453)
For SELL positions: USDC (or WETH/cbBTC) approved for the OptionFactory
For BUY positions: enough of the collateral token to cover the escrowed
reservePrice— or, in the CLI, fund it from another asset in the same transaction with--pay-with
Critical Rule: collateralAmount is ALWAYS 0
When creating any RFQ, the collateralAmount parameter must always be 0. Collateral is not locked at RFQ creation — it is pulled from the seller at settlement time.
// CORRECT — buildRFQParams enforces this automatically
const params = client.optionFactory.buildRFQParams({ ... });
// params.collateralAmount === BigInt(0) always
// WRONG — never set manually
collateralAmount: BigInt(1000000) // causes issues at settlement!Approach 1: buildRFQRequest (One-Liner)
buildRFQRequest combines buildRFQParams and the tracking/key fields into a single object ready for encodeRequestForQuotation.
BUY Position (isLong: true)
SELL Position (isLong: false) — Approval Required
When selling (going short), you are the collateral provider. You must approve the OptionFactory to pull collateral at settlement before creating the RFQ.
Approach 2: buildRFQParams (Two-Step)
buildRFQParams builds just the on-chain QuotationParameters object. Use this when you want fine-grained control over the tracking fields or reserve price encoding.
Reserve Price
The reservePrice parameter protects you from unfavorable fills:
BUY (isLong: true)
Maximum price per contract you will pay
RFQ fails; deposit returned
SELL (isLong: false)
Minimum price per contract you will accept
RFQ fails
omitted or 0
No price protection
Accept any offer
Example: BUY with reserve price 0.015 USDC, 10 contracts → total escrow = 0.015 × 10 = 0.15 USDC locked until settlement.
In buildRFQRequest, pass reservePrice as a human-readable number (e.g. 0.015). When using buildRFQParams + encodeRequestForQuotation directly, pass it as a bigint in collateral token decimals.
RFQ Parameters Reference
requester
address
Your wallet address
underlying
'ETH' | 'BTC'
Underlying asset
optionType
'CALL' | 'PUT'
Option type
strike
number
Strike price (human-readable)
strikes
number[]
Strike array for multi-leg. The generic SDK builder selects structure from option type plus strike count; MCP callers use explicit product.
expiry
number
Unix timestamp; must be after offer deadline
numContracts
number | bigint | string
Contract count; use bigint when closing positions
isLong
boolean
true = BUY, false = SELL
offerDeadlineMinutes
number
Minutes MMs have to respond
collateralToken
'USDC' | 'WETH' | 'cbBTC'
Collateral denomination
reservePrice
number
Optional max (BUY) or min (SELL) price per contract
requesterPublicKey
hex string
Your ECDH compressed public key
For MCP callers, prepare_request_rfq validates the explicit product against the strike count before calldata is built: PUT/CALL require 1 strike, *_SPREAD require 2, *_FLY require 3, and *_CONDOR/IRON_CONDOR require 4. BUY RFQs require a positive per-contract reservePrice; use prepare_suggest_reserve_price instead of guessing.
Convenience Helpers: Multi-Leg Builders
The factory module exposes named helpers that make parameter intent explicit:
These return the same shape as buildRFQRequest and can be passed directly to encodeRequestForQuotation or requestForQuotation.
Using requestForQuotation (Convenience)
Instead of encoding and sending manually, the module also provides a transaction-sending wrapper:
Common Pitfalls
collateralAmount != 0
Always use buildRFQParams; never set manually
SELL RFQ without token approval
Call ensureAllowance before submitting
expiry before offer deadline
Ensure expiry > now + offerDeadlineMinutes * 60
Floating-point numContracts when closing a position
Pass the on-chain bigint value directly
reservePrice in wrong decimals
Use buildRFQRequest with human-readable number
See Also
RFQ Lifecycle — What happens after you submit: MM offers, reveal phase, settlement
Multi-Leg Structures — Spreads, butterflies, condors with collateral math
Key Management — How ECDH keys are stored and used for offer decryption
Last updated

