Position & Spread Pricing

Fetch position-level pricing (with collateral cost) for single options and multi-leg spreads, and integrate rfqCalculations, mmPricing, and optionFactory into a complete RFQ workflow.

getPositionPricing

Returns pricing for a specific option position including collateral cost. Use this when you know the direction (long/short), contract count, and collateral token.

import { ThetanutsClient } from '@thetanuts-finance/thetanuts-client';

const client = new ThetanutsClient({ chainId: 8453 });

const position = await client.mmPricing.getPositionPricing({
  ticker: 'ETH-16FEB26-1800-P',
  isLong: true,         // true = BUY, false = SELL
  numContracts: 10,
  collateralToken: 'USDC',
});

console.log(position.basePremium);     // Fee-adjusted price before carrying cost
console.log(position.collateralCost);  // Carrying cost added for short positions
console.log(position.totalPrice);      // Final all-in price including collateral cost

For short positions, collateralCost is calculated as:

collateralCost = collateralValue × APR × timeToExpiry

where APR is 1% for BTC, 4% for ETH, 7% for USD collateral.


getSpreadPricing

Returns net spread pricing for a two-leg structure. Multi-leg structures use a spread-level collateral cost based on the spread width (max loss), not the sum of per-leg costs.


getButterflyPricing

Returns net pricing for a three-leg butterfly. Strikes are passed in the order [lower, middle, upper] (8-decimal price units). Width-based collateral cost mirrors the spread case.


getCondorPricing

Returns net pricing for a four-leg condor ([strike1, strike2, strike3, strike4], ascending). Same collateral-cost model as butterfly — based on the wider wing.

For iron condors and richer 4-strike combinations, validate parameters with validateCondor / validateIronCondor from the rfqCalculations helpers before submitting.


How rfqCalculations, mmPricing, and optionFactory Fit Together

The three modules divide responsibilities cleanly:

Module
Purpose

rfqCalculations

Position sizing: numContracts, collateral, reservePrice

mmPricing

Price discovery: fee-adjusted bid/ask, collateral carrying cost

optionFactory

RFQ submission and settlement lifecycle

Workflow

SELL Order Example

When selling, use feeAdjustedBid and supply collateral.

BUY Order Example

When buying, use feeAdjustedAsk and specify a premium budget.

BUY vs SELL Summary

SELL Order
BUY Order

Input amount

Collateral to post

Premium budget

MM price to use

feeAdjustedBid

feeAdjustedAsk

numContracts formula

tradeAmount / maxLoss

tradeAmount / premiumPerContract

reservePrice meaning

Minimum premium to receive

Maximum premium to pay

Collateral required

Yes — from calculateCollateralRequired

No (buyer)


See Also

Last updated