# dYdX Perps DEX API
> Live data from dYdX — a leading decentralised perpetual-futures exchange running on its own Cosmos appchain with a fully on-chain order book — served from its public indexer API as clean JSON, no cache. Get every perpetual market with its oracle price, 24h price change, 24h volume and trade count, open interest, next hourly funding rate (and the annualised rate) and margin requirements (sorted by volume); pull one market's full state by ticker; read the live order book for a market (best bid and ask, spread, mid price and the top depth levels); or list the recent fills for a market. Read live from dYdX, nothing cached. This is dYdX's own on-chain perps order-book, funding-rate and open-interest layer — distinct from centralised-exchange tickers, aggregate derivatives feeds and other DEX feeds: a separate decentralised perpetuals venue with its own order book.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/dydx-api/..."
```

## Pricing
- **Free** (Free) — 1,000 calls/Mo, 3 req/s
- **Starter** ($11/Mo) — 34,000 calls/Mo, 12 req/s
- **Pro** ($30/Mo) — 178,000 calls/Mo, 28 req/s
- **Business** ($72/Mo) — 900,000 calls/Mo, 55 req/s

## Endpoints

### Markets

#### `GET /v1/markets` — Every perp market with oracle price, funding, open interest, volume, margins

**Parameters:**
- `limit` (query, optional, string) — Max markets (1-500) Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dydx-api/v1/markets?limit=100"
```

**Response:**
```json
{
    "data": {
        "count": 100,
        "source": "dYdX",
        "markets": [
            {
                "status": "ACTIVE",
                "ticker": "BTC-USD",
                "trades_24h": 26484,
                "market_type": "CROSS",
                "oracle_price": 61360.97617,
                "open_interest": 470.5312,
                "volume_24h_usd": 94598102.89,
                "funding_apr_pct": 56.198,
                "price_change_24h": -321.83505,
                "open_interest_usd": 28872253.75,
                "price_change_24h_pct": -0.5218,
                "initial_margin_fraction": 0.02,
                "next_funding_rate_hourly": 6.4153e-5,
                "maintenance_margin_fraction": 0.012
            },
            {
                "status": "ACTIVE",
                "ticker": "ETH-USD",
                "trades_24h": 5481,
                "market_type": "CROSS",
                "oracle_price": 1617.288739,
                "open_interest": 5906.975,
                "volume_24h_usd": 12173705.56,
                "funding_apr_pct": -12.0903,
                "price_change_24h": -23.268771,
                "open_interest_usd": 9553284.15,
                "price_change_24h_pct": -1.4183,
                "initial_margin_fraction": 0.02,
                "next_funding_rate_hourly": -1.38017e-5,
                "maintenance_margin_fraction": 0.012
            },
            {
                "status": "ACTIVE",
                "ticker": "SOL-USD",
    
…(truncated, see openapi.json for full schema)
```

### Market

#### `GET /v1/market` — One market's full state by ticker

**Parameters:**
- `ticker` (query, required, string) — Perp market ticker Example: `BTC-USD`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dydx-api/v1/market?ticker=BTC-USD"
```

**Response:**
```json
{
    "data": {
        "source": "dYdX",
        "status": "ACTIVE",
        "ticker": "BTC-USD",
        "trades_24h": 26484,
        "market_type": "CROSS",
        "oracle_price": 61360.97617,
        "open_interest": 470.5312,
        "volume_24h_usd": 94598102.89,
        "funding_apr_pct": 56.198,
        "price_change_24h": -321.83505,
        "open_interest_usd": 28872253.75,
        "price_change_24h_pct": -0.5218,
        "initial_margin_fraction": 0.02,
        "next_funding_rate_hourly": 6.4153e-5,
        "maintenance_margin_fraction": 0.012
    },
    "meta": {
        "timestamp": "2026-06-10T22:57:57.009Z",
        "request_id": "ad25a911-ef85-4296-8017-8632b1c56bcb"
    },
    "status": "ok",
    "message": "Market retrieved successfully",
    "success": true
}
```

### Orderbook

#### `GET /v1/orderbook` — Live order book — best bid/ask, spread, top depth

**Parameters:**
- `ticker` (query, required, string) — Perp market ticker Example: `BTC-USD`
- `depth` (query, optional, string) — Levels per side (1-100) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dydx-api/v1/orderbook?ticker=BTC-USD&depth=10"
```

**Response:**
```json
{
    "data": {
        "asks": [
            {
                "size": 0.0727,
                "price": 61421
            },
            {
                "size": 0.0409,
                "price": 61422
            },
            {
                "size": 0.137,
                "price": 61423
            },
            {
                "size": 0.0318,
                "price": 61428
            },
            {
                "size": 0.0318,
                "price": 61430
            },
            {
                "size": 0.0318,
                "price": 61434
            },
            {
                "size": 0.0318,
                "price": 61437
            },
            {
                "size": 0.1538,
                "price": 61439
            },
            {
                "size": 0.3255,
                "price": 61440
            },
            {
                "size": 0.017,
                "price": 61441
            }
        ],
        "bids": [
            {
                "size": 0.3256,
                "price": 61416
            },
            {
                "size": 0.1221,
                "price": 61412
            },
            {
                "size": 0.0459,
                "price": 61410
            },
            {
                "size": 0.0318,
                "price": 61408
            },
            {
                "size": 0.0237,
                "price": 61407
            },
            {
                "size": 0.0318,
              
…(truncated, see openapi.json for full schema)
```

### Trades

#### `GET /v1/trades` — Recent fills for a market

**Parameters:**
- `ticker` (query, required, string) — Perp market ticker Example: `BTC-USD`
- `limit` (query, optional, string) — Max trades (1-100) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dydx-api/v1/trades?ticker=BTC-USD&limit=20"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "source": "dYdX",
        "ticker": "BTC-USD",
        "trades": [
            {
                "side": "BUY",
                "size": 0.3,
                "time": "2026-06-10T22:57:52.892Z",
                "type": "LIMIT",
                "price": 61427
            },
            {
                "side": "BUY",
                "size": 0.0809,
                "time": "2026-06-10T22:57:48.407Z",
                "type": "LIMIT",
                "price": 61421
            },
            {
                "side": "BUY",
                "size": 0.0622,
                "time": "2026-06-10T22:57:47.906Z",
                "type": "LIMIT",
                "price": 61421
            },
            {
                "side": "BUY",
                "size": 0.0947,
                "time": "2026-06-10T22:57:47.906Z",
                "type": "LIMIT",
                "price": 61421
            },
            {
                "side": "BUY",
                "size": 0.0622,
                "time": "2026-06-10T22:57:47.393Z",
                "type": "LIMIT",
                "price": 61421
            },
            {
                "side": "BUY",
                "size": 0.0585,
                "time": "2026-06-10T22:57:37.179Z",
                "type": "LIMIT",
                "price": 61403
            },
            {
                "side": "BUY",
                "size": 0.1148,
                "time": "2026-06-10T22:57:37.179Z",
              
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dydx-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "source": "dYdX v4 indexer API (indexer.dydx.trade, live)",
        "service": "dydx-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/market": "One market's full state by ticker (ticker=BTC-USD).",
            "GET /v1/trades": "Recent fills for a market (ticker=BTC-USD, limit=20).",
            "GET /v1/markets": "Every perp market with oracle price, funding, open interest, volume, margins (limit=100).",
            "GET /v1/orderbook": "Live order book — best bid/ask, spread, top depth (ticker=BTC-USD, depth=10)."
        },
        "description": "Live data from dYdX, a leading decentralised perpetual-futures exchange running on its own Cosmos appchain with a fully on-chain order book, via its public indexer API. The markets endpoint returns every perpetual market with oracle price, 24h change, 24h volume and trade count, open interest, next hourly funding rate (and annualised) and margin requirements, sorted by volume; the market endpoint returns one market by ticker; the orderbook endpoint returns the live order book (best bid/ask, spread and top depth); the trades endpoint returns recent fills. Live, no key, nothing stored. Distinct from centralised-exchange tickers, aggregate derivatives feeds and other DEX feeds — this is dYdX's own on-chain perps order-book, funding-rate and open-interest layer.",
        "upstream_status": "ok",
        "perp_market_count": 296
    },
    "meta": {
        "t
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/dydx-api
OpenAPI spec: https://www.oanor.com/api/dydx-api/openapi.json
