Ranger Options
When you'd use a Ranger
Anatomy
Quick reference
import { ThetanutsClient } from '@thetanuts-finance/thetanuts-client';
const client = new ThetanutsClient({ chainId: 8453, provider, signer });
// Read a Ranger option's full state
const info = await client.ranger.getInfo(rangerAddress);
// {
// buyer, seller, creator,
// collateralToken, collateralAmount, numContracts, expiryTimestamp,
// chainlinkPriceFeed, strikes,
// zone: { zoneLower, zoneUpper },
// spreadWidth,
// optionSettled,
// }
// Read just the zone bounds
const { zoneLower, zoneUpper } = await client.ranger.getZone(rangerAddress);
// Read the per-leg spread width
const width = await client.ranger.getSpreadWidth(rangerAddress);
// Simulate the payout at a hypothetical settlement price
const payout = await client.ranger.simulatePayout(
rangerAddress,
client.utils.toPriceDecimals(2400), // settlement price (8 decimals)
await client.ranger.getStrikes(rangerAddress),
await client.ranger.getInfo(rangerAddress).then(i => i.numContracts),
);
// On-chain payout at an exact settlement price (no off-chain math)
const exact = await client.ranger.calculatePayout(rangerAddress, settlementPrice);
// Current TWAP from the option's price-feed consumer
const twap = await client.ranger.getTWAP(rangerAddress);Lifecycle
Chain support
Fees
Events
See also
Last updated

