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-client

  • A funded wallet on Base mainnet (chain ID 8453)

  • For SELL positions: USDC (or WETH/cbBTC) approved for the OptionFactory


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:

Position
Meaning
Behavior if violated

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

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

Parameter
Type
Description

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 (auto-detects structure)

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


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

Mistake
Fix

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

Last updated