CLOB (OpshunsClob)
Each options market is an OpshunsClob clone: an ERC-6909 book for a fixed token0 / token1 / premium triple. The mothership OrdersFacet is the user-facing entry for posting, claiming, exercising, and withdrawing. RFQ fills also settle into the same clone via bilateral fillMatched.
For RFQ fill modes (leg-by-leg, FixedPackage, Dutch, Authority), see On-chain fill modes.
What the book is
| Concept | Role |
|---|---|
| Pair / CLOB address | Factory-deployed clone for one underlying pair + premium token |
| PairKey | Option terms packed into a bijective ERC-6909 id (type, exercise window, expiry, strike, premium bps, min notional) |
| Buy / sell inventory | Fungible buyId / sellId for the same terms |
| Resting queues | FIFO bids (premium) and asks (underlying); remainder may enqueue as order NFTs |
Ids are a fixed bit layout (not a hash): same terms → same ids; decode recovers terms bit-for-bit. Details live in core OpshunsClob/README.md.
Posting orders (mothership)
Typical flow:
Wallet → OrdersFacet.orderBuy / orderSell (+ optional Permit2)
→ clone orderBuy(Referral) / orderSell(Referral)
→ cross resting opposite side if possible
→ enqueue remainder (order NFT meta 0xFF…)
- Buy posts premium against the book.
- Sell posts underlying.
- Min-notional floors apply on CLOB posts (
BelowMinNotionalif too small). RFQfillMatchedskips that gate. - Trailing
referreris chosen by the caller (not baked into an RFQ maker quote).
The trading app’s Post to book path for a single call/put talks to this stack. REST helpers: Orders & exclusive fills.
Matching vs RFQ
Two different ways liquidity clears into the same 6909 inventory:
Resting book
Makers (or any wallet) leave standing bids/asks. Crosses happen when a counterparty posts or when an RFQ maker’s ClobOffer takes the book.
Bilateral fillMatched
RFQ / package settlement after the mothership has already pulled ERC-20 premium + underlying:
Settle RFQ
fillMatchedafter mothership has pulled premium + underlying into this core… No ERC-20 pulls — mint + pool accounting only.
- Does not advance live queue cursors (bilateral mint; no claim queue).
- Leg-by-leg RFQ uses quoted
premiumRateBpsin the PairKey. - FixedPackage / Dutch settle an absolute package premium first, then
fillMatchedat 0 bps.
RFQ + book hybrid (leg-by-leg only)
A maker offer may include ClobOffer{ premiumRateBps, clobAmount } slices:
- Mothership takes that size from the book as the maker (
orderBuyFrom/orderSellFrom). - Each slice must fill exactly or the entire intent reverts.
- Remainder → bilateral
fillMatchedat the quote’spremiumRateBps.
If clobOffers is empty, the whole size is fillMatched.
FixedPackage and Dutch do not consume resting CLOB offers — only zero-bps fillMatched after package premium.
Lifecycle after mint
Once you hold buy/sell 6909 inventory you can:
- Claim / manage queued order NFTs
- Exercise (American anytime before expiry when
startExerciseTimestamp == 0; European-style when start equals expiry) - Withdraw residual collateral per product rules
Exact selectors are on OrdersFacet / IOpshunsClob. Prefer mothership entrypoints so approvals and fees stay consistent.
Fees and RFQ mode
While a fill runs, the mothership may set treasury “in RFQ” so RFQ fee powers apply. See core OpshunsFees/FEES.md. Referral fees on maker-paid legs follow the taker/filler-chosen referrer.
Integrator tips
- Resolve the pair address from the factory / networks registry (
opshuns6909_contractin quote intents). - Predict ids with mothership
resolvePairKey/ clone helpers so off-chain books match on-chain packing (min-notional sentinels are materialized before packing). - Approve the mothership for ERC-20 pulls (or use Permit2 witnesses), not only the clone.
- Standard ERC-20 only — no fee-on-transfer or rebasing tokens.
Related
- On-chain fill modes — FillMatched, Dutch, Authority
- Fill options RFQ quotes — API RFQ lifecycle
- Orders & exclusive fills — REST order recording / exclusive fill bonds
- Option spreads — multi-leg strategy shapes