# Perp Gap API - Daily Export

> Perp Gap API - Daily Export is a paid API for AI agents from perp-gap-api.perpgap.workers.dev, paid per call via x402, $0.25/call, status unknown (last checked 2026-10-19).

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

## Facts

- Endpoint: GET https://perp-gap-api.perpgap.workers.dev/export?utm_source=zero.xyz
- Price: $0.25/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/perp-gap-api-daily-export-4847d1ec
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vmQppm4XvJhGMplujoA6r

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability perp-gap-api-daily-export-4847d1ec
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "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
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/perp-gap-api-daily-export-4847d1ec/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from perp-gap-api.perpgap.workers.dev](https://www.zero.xyz/host/perp-gap-api.perpgap.workers.dev/llms.txt)
