Multi-Leg Structures
How It Works
order.strikes.length === 1 → VANILLA (single option)
order.strikes.length === 2 → SPREAD (2-leg)
order.strikes.length === 3 → BUTTERFLY (3-leg)
order.strikes.length === 4 → CONDOR or IRON CONDOR (4-leg)Identifying Multi-Leg Orders
import { ethers } from 'ethers';
import { ThetanutsClient } from '@thetanuts-finance/thetanuts-client';
const provider = new ethers.JsonRpcProvider('https://mainnet.base.org');
const client = new ThetanutsClient({ chainId: 8453, provider });
const orders = await client.api.fetchOrders();
for (const order of orders) {
const strikes = order.rawApiData?.strikes ?? [];
const impl = order.rawApiData?.implementation ?? '';
const isCall = order.rawApiData?.isCall;
let structure = 'UNKNOWN';
if (strikes.length === 1) structure = isCall ? 'VANILLA CALL' : 'VANILLA PUT';
if (strikes.length === 2) structure = isCall ? 'CALL SPREAD' : 'PUT SPREAD';
if (strikes.length === 3) structure = isCall ? 'CALL BUTTERFLY' : 'PUT BUTTERFLY';
if (strikes.length === 4) structure = 'CONDOR / IRON CONDOR';
console.log(`${structure} | ${strikes.length} strikes | impl: ${impl}`);
}Filtering by Structure
Structures Summary
Structure
Strikes
Implementation
Collateral Formula
Preview and Fill a Multi-Leg Order
Spread Example
Butterfly Example
Condor Example
Iron Condor Example
Implementation Addresses
Type
Key
Address
OptionBook vs RFQ for Multi-Leg
OptionBook
RFQ
See Also
Last updated

