# x402stock On-Chain Perpetuals Data

> x402stock On-Chain Perpetuals Data is a paid API for AI agents from agents.x402stock.xyz, paid per call via x402 or MPP, $0.02/call, status healthy (last checked 2026-10-22, last successful call 2026-10-15).

Returns live on-chain perpetuals (perps) market data for crypto assets, priced at $0.02 USDC per call via x402 pay-per-request

## Facts

- Endpoint: GET https://agents.x402stock.xyz/api/v1/perps?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402, MPP
- Status: healthy
- Last checked: 2026-10-22
- Last successful call: 2026-10-15
- Success rate: 100% of calls made through Zero
- Activations on Zero: 1
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-on-chain-perpetuals-data-0b734d4c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_55_V2Uax6P3VsFCcEImNP

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 x402stock-on-chain-perpetuals-data-0b734d4c
```

Example prompt: Pull the latest on-chain perpetuals market data for me — I want to see funding rates, open interest, and mark prices across crypto perp contracts right now.

## When to prefer this

Choose this endpoint when you need real-time on-chain perpetuals data (funding rates, open interest, mark/index prices) for crypto assets without setting up API keys or accounts. Ideal for AI agents that need pay-per-use access to DeFi derivatives data via USDC micropayments. Prefer this over centralized exchange APIs when on-chain transparency and no-account access are priorities.

## Known failure modes

- Payment not received or insufficient USDC balance — returns 402 Payment Required
- Invalid or unsupported properties filter — may return empty results or 400 Bad Request
- Upstream on-chain data temporarily unavailable — may return 503 or stale data
- Rate limit exceeded — returns 429 Too Many Requests
- Network timeout fetching on-chain data — returns 504 Gateway Timeout

## How this service works

Live state of every perpetual-futures market in one call: per coin the mark and oracle price, hourly funding rate with annualized APR, premium, open interest, max leverage, previous-day price, and 24h USD and base volume. Native crypto-derivatives data — funding and open interest are perp-only, absent from any spot feed. Free on-chain DEX data (venue: Hyperliquid), no key. From x402stock

## Output

Returns on-chain perpetuals market data including fields such as mark price, index price, funding rate, open interest, and contract metadata for crypto perpetual instruments, delivered as structured JSON.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "properties": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "source",
  "as_of",
  "venue",
  "market",
  "count",
  "perps"
 ],
 "properties": {
  "as_of": {
   "type": "string"
  },
  "count": {
   "type": "number"
  },
  "perps": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "coin",
     "max_leverage",
     "mark_price",
     "oracle_price",
     "mid_price",
     "prev_day_price",
     "funding_rate_hourly",
     "funding_apr_percent",
     "premium",
     "open_interest",
     "day_volume_usd",
     "day_volume_base"
    ],
    "properties": {
     "coin": {
      "type": "string"
     },
     "premium": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ]
     },
     "mid_price": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ]
     },
     "mark_price": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ]
     },
     "max_leverage": {
      "type": "number"
     },
     "oracle_price": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ]
     },
     "open_interest": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ]
     },
     "day_volume_usd": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ]
     },
     "prev_day_price": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ]
     },
     "day_volume_base": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ]
     },
     "funding_apr_percent": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ]
     },
     "funding_rate_hourly": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "additionalProperties": false
   }
  },
  "venue": {
   "type": "string"
  },
  "market": {
   "type": "string",
   "const": "perp"
  },
  "source": {
   "type": "string",
   "const": "x402stock"
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402stock-on-chain-perpetuals-data-0b734d4c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.x402stock.xyz](https://www.zero.xyz/host/agents.x402stock.xyz/llms.txt)
