{"uid":"cap_uiG5-M1zXbbj0YETRWG51","slug":"perpgap-historical-price-gap-api-df0e1846","name":"PerpGap Historical Price Gap API","description":"Pay-per-call API for AI agents: stock-perp price gaps across trade.xyz, Aster and Lighter vs the real stock and Solana xStocks, plus funding, basis, OI, research cards, history and rule-based verdicts. x402, USDC on Base or Solana.","url":"https://perp-gap-api.perpgap.workers.dev/history?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":null,"responseSchema":{"type":"json","example":{"to":"2026-10-14T20:00:00.000Z","from":"2026-10-07T00:00:00.000Z","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,"ticker":"TSLA","interval":"1h","disclaimer":"Data, not financial advice."}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_TAjGQfRTl6Ek8dLGFHhXX","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns historical time-series data on price gaps between stock perpetual futures (trade.xyz, Aster, Lighter) and reference stock prices or Solana xStocks, including funding rates, OI, and basis metrics","exampleAgentPrompt":"Pull the hourly price gap history for TSLA between October 7 and October 14, 2026, including funding rates, open interest, and how the perp mark on trade.xyz compared to the real stock price and xStock price.","exampleUseCases":[{"title":"Weekly arbitrage opportunity review","prompt":"Show me the hourly gap history for TSLA perps versus the real stock price and xStock from last Monday through Sunday, so I can see when the biggest arbitrage windows opened up."},{"title":"Funding rate trend analysis","prompt":"Pull the daily funding rate history for NVDA perps over the past 30 days across trade.xyz, Aster, and Lighter — I want to see the annualized rates and how they've trended."},{"title":"Exchange spread comparison over time","prompt":"Give me a week of hourly data on the price spread between Aster and trade.xyz for AAPL perps, including the max mark spread and basis vs oracle for each snapshot."}],"resultDescription":"Returns a JSON array of time-series rows for the requested ticker and date range. Each row includes timestamps, perp mark prices from trade.xyz/Aster/Lighter, reference stock price, xStock price, hourly and annualized funding rates, open interest in USD, and percentage gap metrics between each exchange pair and versus the reference stock. Also returns count, ticker, interval, and a disclaimer.","failureModes":["Invalid or unsupported ticker symbol returns an error or empty rows","Date range too wide may result in truncated or paginated data","Payment failure (x402) if USDC balance is insufficient on Base or Solana","Missing required fields (ticker, from, to) returns a validation error","Interval value not supported returns an error","Data unavailable for non-market hours may return sparse rows"],"whenToPreferThis":"Use this endpoint when you need time-series historical data on stock perpetual price gaps across decentralized exchanges (trade.xyz, Aster, Lighter) versus real stock prices or Solana xStocks. Prefer this over real-time snapshot endpoints when trend analysis, backtesting, or funding rate history over a date range is the goal. Ideal for arbitrage research, basis trading analysis, and on-chain synthetic stock monitoring across multiple DeFi venues.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T06:33:12.625Z","isFirstParty":false,"canonicalSlug":"perpgap-historical-price-gap-api-df0e1846"}