{"uid":"cap_TrXMOPK1ehp6odrLh5kfw","slug":"perp-gap-api-research-card-759a57ce","name":"Perp Gap API – Research Card","description":"Use when an agent needs everything about one US stock in one call before trading or answering a user. Stock quote incl. extended/overnight trade, perp prices on trade.xyz, Aster, Lighter, OKX, xStocks/Ondo token prices, gaps, funding, last 4 weekend gaps vs Monday open, 72h history, rule-based verdict and plain-text summary. No LLM. Bad or unlisted tickers return 400/404 before any charge. Errors: 400, 402, 404, 502. Data, not advice.","url":"https://perp-gap-api.perpgap.workers.dev/research?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":["ticker"],"properties":{"ticker":{"type":"string","pattern":"^[A-Za-z0-9.]{1,12}$","examples":["NVDA"],"description":"Stock ticker, case-insensitive (free list: GET /catalog)."}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"card":{"type":"string"},"spot":{"type":"object"},"flags":{"type":"array"},"perps":{"type":"object"},"ticker":{"type":"string"},"summary":{"type":"object"},"verdict":{"type":"object"},"disclaimer":{"type":"string"},"generated_at":{"type":"number"},"generated_at_iso":{"type":"string"}},"description":"Error responses are JSON {error: string, hint?: string}. 400 bad params (never charged); 402 payment required; 404 ticker/market not listed (checked before settlement, never charged); 502 upstream error. Full field docs: /openapi.json."}}}}},"responseSchema":{"type":"json","example":{"card":"research","spot":{"ts":1793288394,"price":213.94,"source":"tradexyz-relayer-external","symbol":"xyz:NVDA","change_pct":null,"prev_close":null,"age_seconds":16,"price_session":"regular","extended_trade":null},"flags":[],"perps":{"okx":{"mark":214.34,"index":null,"venue":"OKX","symbol":"NVDA-USDT-SWAP","gap_vs_spot_pct":0.187,"gap_vs_xstock_pct":-0.0839},"aster":{"mark":214.26638148,"index":214.20322023,"venue":"Aster","symbol":"NVDAUSDT","gap_vs_spot_pct":0.1526,"gap_vs_xstock_pct":-0.1182},"lighter":{"mark":214.157,"index":213.979,"venue":"Lighter","symbol":"NVDA","gap_vs_spot_pct":0.1014,"gap_vs_xstock_pct":-0.1692},"trade_xyz":{"mark":214.03,"index":213.96,"venue":"trade.xyz (Hyperliquid xyz)","symbol":"xyz:NVDA","gap_vs_spot_pct":0.0421,"gap_vs_xstock_pct":-0.2284}},"ticker":"NVDA","summary":{"stock":"US session: regular. Reference $213.94 from tradexyz-relayer-external (regular), 16s old.","verdict":"watch (score 0): perp vs reference gap +0.04%: in line, no edge; funding 5.5% APR: neutral","weekend":"No stored weekend history for this ticker yet.","headline":"NVDA: stock $213.94 (regular, n/a vs prev close); trade.xyz perp $214.03 = +0.04% vs stock. Verdict: watch.","tokenized":"xstocks-solana NVDAx $213.72/share (-0.11% vs stock).","cross_venue":"Widest perp spread 0.14% (richest okx, cheapest trade.xyz)."},"verdict":{"score":0,"method":"rule-based scoring; no LLM (same logic as GET /verdict)","reasons":["perp vs reference gap +0.04%: in line, no edge"],"verdict":"watch","confidence":0.3,"missing_signals":[]},"disclaimer":"Data, not financial advice.","generated_at":1793288438,"generated_at_iso":"2026-10-29T15:40:38.942Z"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.03","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.03/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_oUVcMnwiNb7KCTvGOSAqT","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.03","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a full research card for a stock ticker including perp mark prices, price gaps vs spot and xStocks, funding rates, open interest, cross-venue spread, 72-hour gap history, and a rule-based trading verdict across trade.xyz, Aster, and Lighter.","exampleAgentPrompt":"Pull the full perp gap research card for TSLA — I want to see how the mark price on trade.xyz, Aster, and Lighter compares to the real stock price and the Solana xStock, plus the funding rates, any cross-venue spread, the 72-hour gap history, and the rule-based verdict on whether there's an edge.","exampleUseCases":[{"title":"Spot-perp arbitrage opportunity scan","prompt":"Check the perp gap research card for NVDA — I want to know if any of trade.xyz, Aster, or Lighter has a meaningful basis vs the real stock price right now, and what the rule-based verdict says about it."},{"title":"Funding rate comparison across venues","prompt":"What are the annualized funding rates for AAPL perps on trade.xyz, Aster, and Lighter right now? I'm trying to decide where it's cheapest to hold a long position."},{"title":"Cross-venue spread monitoring for a trade","prompt":"Is there a noticeable mark price spread between Aster and Lighter for TSLA perps at the moment? I want to know the richest and cheapest venue and how big the gap is."}],"resultDescription":"A JSON research card containing: spot price with session label and daily change, perp mark and index prices per venue (trade.xyz, Aster, Lighter) with gap vs spot %, gap vs xStock %, cross-venue gap %, annualized and hourly funding rates, basis (mark vs oracle/index), open interest in USD, Solana xStock price and gap vs spot, 72-hour rolling gap history (avg/min/max), cross-venue summary (richest/cheapest/max spread), and a rule-based verdict object with score, confidence, reasons, and a watch/act/ignore classification.","failureModes":["Unknown or unsupported ticker returns null fields or empty perp objects","Market closed outside regular hours causes spot price_session to be 'closed' or 'last_close' with stale price","Venue API outage causes null mark/index for that venue while others populate normally","Missing x402 payment header or insufficient USDC balance returns HTTP 402","Rate limit or Cloudflare Worker timeout returns HTTP 429 or 503"],"whenToPreferThis":"Use this endpoint when you need a unified, structured view of stock-perp price gaps across multiple on-chain venues (trade.xyz, Aster, Lighter) simultaneously, including funding rates, xStock comparison, historical gap data, and an opinionated verdict — rather than querying each venue's API separately or building your own aggregation logic. Ideal for agents performing arbitrage scanning, basis trading research, or cross-venue execution routing decisions on tokenized equity perps.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-30T00:35:30.095Z","isFirstParty":false,"canonicalSlug":"perp-gap-api-research-card-759a57ce"}