{"uid":"cap_vmQppm4XvJhGMplujoA6r","slug":"perp-gap-api-daily-export-4847d1ec","name":"Perp Gap API - Daily Export","description":"Bulk export of one UTC day of live 30-minute snapshots for all tracked stock perps (top 40 auto-discovered tickers by open interest × up to 48 snapshots): trade.xyz vs stock vs xStock gaps, basis, funding, OI, plus Aster and Lighter marks, funding and cross-venue gaps. JSON or CSV.","url":"https://perp-gap-api.perpgap.workers.dev/export?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":[],"properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-10-14"],"description":"Optional UTC day, YYYY-MM-DD. Default: yesterday (UTC)."},"format":{"enum":["json","csv"],"type":"string","default":"json","examples":["csv"],"description":"Optional output format: json (default) or csv (text/csv, one row per ticker per snapshot)."}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["date","rows"],"properties":{"date":{"type":"string"},"rows":{"type":"array","items":{"type":"object","required":["ts","ticker","source"],"properties":{"ts":{"type":"integer"},"time":{"type":"string"},"source":{"enum":["snapshot","backfill"],"type":"string"},"ticker":{"type":"string"},"perp_mark":{"type":["number","null"]},"ref_price":{"type":["number","null"]},"aster_mark":{"type":["number","null"]},"perp_oracle":{"type":["number","null"]},"ref_session":{"type":["string","null"]},"lighter_mark":{"type":["number","null"]},"xstock_price":{"type":["number","null"]},"funding_hourly":{"type":["number","null"]},"open_interest_usd":{"type":["number","null"]},"gap_perp_vs_ref_pct":{"type":["number","null"]},"max_mark_spread_pct":{"type":["number","null"]},"aster_funding_hourly":{"type":["number","null"]},"gap_aster_vs_xyz_pct":{"type":["number","null"]},"funding_annualized_pct":{"type":["number","null"]},"gap_lighter_vs_xyz_pct":{"type":["number","null"]},"gap_perp_vs_xstock_pct":{"type":["number","null"]},"lighter_funding_hourly":{"type":["number","null"]},"basis_mark_vs_oracle_pct":{"type":["number","null"]}}}},"count":{"type":"integer"},"columns":{"type":"array","items":{"type":"string"}},"snapshots":{"type":"integer"}},"description":"Error responses are JSON {error: string}: 400 date must be YYYY-MM-DD (UTC); 402 payment required."}}}}},"responseSchema":{"type":"json","example":{"date":"2026-10-14","rows":[{"ts":1792008000,"time":"2026-10-14T20:00:00.000Z","source":"snapshot","ticker":"TSLA","perp_mark":365.69,"ref_price":365.57,"aster_mark":366.01,"perp_oracle":365.58,"ref_session":"regular","lighter_mark":365.77,"xstock_price":365.69,"funding_hourly":0.00000625,"open_interest_usd":42087597,"gap_perp_vs_ref_pct":0.0328,"max_mark_spread_pct":0.0875,"aster_funding_hourly":0,"gap_aster_vs_xyz_pct":0.0875,"funding_annualized_pct":5.475,"gap_lighter_vs_xyz_pct":0.0219,"gap_perp_vs_xstock_pct":0,"lighter_funding_hourly":0.000004,"basis_mark_vs_oracle_pct":0.0301}],"count":1,"snapshots":1}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.25","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.25/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UgK-kBToZlsCYl1dI0XZi","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.25","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a full-day snapshot of stock-perp price gaps, funding rates, open interest, and basis across trade.xyz, Aster, and Lighter vs real stock prices and Solana xStocks","exampleAgentPrompt":"Pull yesterday's full export of stock-perp price gaps across trade.xyz, Aster, and Lighter — including funding rates, open interest, and the gap versus real stock prices and Solana xStocks — in JSON format.","exampleUseCases":[{"title":"Arbitrage scanning between perps and spot","prompt":"Get me today's perp gap data for all tickers showing the price difference between trade.xyz perp marks and the real stock price, so I can spot arbitrage opportunities."},{"title":"Funding rate analysis for equity perps","prompt":"Pull yesterday's funding rate data in CSV format for all stock perps across trade.xyz, Aster, and Lighter so I can compare annualized funding costs across venues."},{"title":"Historical basis research for quant model","prompt":"Fetch the full snapshot export for 2026-10-14 in JSON — I need the basis between perp mark and oracle price, open interest in USD, and max mark spread across all tickers for my pricing model."}],"resultDescription":"A JSON object (or CSV text) containing a date field, a count of rows and snapshots, and an array of per-ticker rows. Each row includes a Unix timestamp, ticker symbol, perp mark price, reference stock price, xStock price, perp oracle price, Aster mark, Lighter mark, hourly and annualized funding rates for each venue, gap percentages between venues, basis between mark and oracle, open interest in USD, max mark spread, and trading session label.","failureModes":["Invalid date format (not YYYY-MM-DD) returns a 400 error","Date in the future or beyond available history returns empty rows or 404","Payment not provided or insufficient (x402 payment required, $0.25 USDC on Base or Solana)","Rate limiting or worker timeout for very large date ranges","Invalid format parameter returns 400; only 'json' and 'csv' are accepted"],"whenToPreferThis":"Use this endpoint when you need a complete daily bulk export of stock-perp gap metrics across multiple decentralized venues (trade.xyz, Aster, Lighter) in one call. It is ideal for batch analysis, research, quant model ingestion, or historical backtesting where you want all tickers for a full UTC day. Prefer this over per-ticker or real-time endpoints when you need cross-venue comparison at scale or want to download data in CSV format for offline analysis.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T00:43:14.176Z","isFirstParty":false,"canonicalSlug":"perp-gap-api-daily-export-4847d1ec"}