Positions and History
Production advice: index on-chain events yourself. Use these endpoints for dev/test.
Base URL
https://odette.fi/apiAfter a Trade — Trigger Sync
POST/GET https://optionbook-indexer.thetanuts.finance/api/v1/updateCall immediately after a trade.
If
{ status: "skipped" }, retry after ~10s.Wait ~15s after a successful update before fetching positions.
Fetch User Positions (OPEN)
GET https://optionbook-indexer.thetanuts.finance/api/v1/user/{userAddress}/positionsResponse (abridged)
[
{
"address": "0x...",
"status": "open",
"buyer": "0x...",
"seller": "0x...",
"referrer": "0x...", // filter by YOUR_REFERRER
"createdBy": "0x...", // OptionBook contract (do not filter on this)
"entryTimestamp": 1734336000,
"entryTxHash": "0x...",
"entryPremium": "1000000",
"entryFeePaid": "30000",
"collateralToken": "0x8335...913",
"collateralSymbol": "USDC",
"collateralDecimals": 6,
"underlyingAsset": "BTC",
"priceFeed": "0x64c9...48F",
"strikes": ["10000000000", "11000000000"],
"expiryTimestamp": 1734364800,
"numContracts": "20000000",
"collateralAmount": "100000000",
"optionType": 257,
"settlement": null,
"explicitClose": null
}
]Filter by your referrer
const MY_REFERRER = '0x...';
const mine = positions.filter(p => p.referrer.toLowerCase() === MY_REFERRER.toLowerCase());Fetch User History (SETTLED)
GET https://optionbook-indexer.thetanuts.finance/api/v1/user/{userAddress}/historySame shape as positions, with:
status: "settled"settlementpopulated (settlementPrice8 dp,payoutBuyer6 dp, etc.)
Other Endpoints
GET https://optionbook-indexer.thetanuts.finance/api/v1/open-positions // all open positions
GET https://optionbook-indexer.thetanuts.finance/api/v1/stats // protocol statsLast updated