# Lighter Perpetuals DEX API
> Live market data for Lighter, the zkSync-based order-book perpetuals and spot DEX, with no key. List every market (perps and spot) with its id and status; pull exchange-wide stats with last price, 24h volume and daily change for every market; read the live order book; and stream recent public trades. Symbols are accepted by name (BTC, ETH, AAPL) or numeric market id and resolved automatically. Lighter notably lists tokenised-equity perps (AAPL, TSLA …) alongside crypto — ideal for cross-asset derivatives dashboards and market monitors.

## 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/lighter-api/..."
```

## Pricing
- **Free** (Free) — 1,780 calls/Mo, 3 req/s
- **Basic** ($15/Mo) — 50,500 calls/Mo, 8 req/s
- **Pro** ($44/Mo) — 201,000 calls/Mo, 21 req/s
- **Business** ($94/Mo) — 822,000 calls/Mo, 50 req/s

## Endpoints

### Markets

#### `GET /v1/markets` — List every market with id, type and fees

**Parameters:**
- `type` (query, optional, string) — Filter: perp or spot Example: `perp`

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

**Response:**
```json
{
    "data": {
        "count": 198,
        "venue": "lighter",
        "markets": [
            {
                "status": "active",
                "symbol": "STRC",
                "maker_fee": 0,
                "market_id": 156,
                "taker_fee": 0,
                "market_type": "perp"
            },
            {
                "status": "active",
                "symbol": "USDCHF",
                "maker_fee": 0,
                "market_id": 99,
                "taker_fee": 0,
                "market_type": "perp"
            },
            {
                "status": "active",
                "symbol": "FIL",
                "maker_fee": 0,
                "market_id": 103,
                "taker_fee": 0,
                "market_type": "perp"
            },
            {
                "status": "active",
                "symbol": "AVAX",
                "maker_fee": 0,
                "market_id": 9,
                "taker_fee": 0,
                "market_type": "perp"
            },
            {
                "status": "active",
                "symbol": "APEX",
                "maker_fee": 0,
                "market_id": 86,
                "taker_fee": 0,
                "market_type": "perp"
            },
            {
                "status": "active",
                "symbol": "DRAM",
                "maker_fee": 0,
                "market_id": 195,
                "taker_fee": 0,
                "market_type": "perp"
            },
      
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/orderbook` — Live order book for a market

**Parameters:**
- `market` (query, required, string) — Symbol or market_id Example: `BTC`
- `limit` (query, optional, string) — Levels (1-100) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lighter-api/v1/orderbook?market=BTC&limit=10"
```

**Response:**
```json
{
    "data": {
        "asks": [
            {
                "size": 0.0002,
                "price": 65930.6
            },
            {
                "size": 0.29434,
                "price": 65935.5
            },
            {
                "size": 0.19636,
                "price": 65935.6
            },
            {
                "size": 0.00758,
                "price": 65936
            },
            {
                "size": 0.00379,
                "price": 65936.4
            },
            {
                "size": 0.03491,
                "price": 65936.5
            },
            {
                "size": 0.04743,
                "price": 65936.5
            },
            {
                "size": 0.05,
                "price": 65936.6
            },
            {
                "size": 0.05,
                "price": 65936.8
            },
            {
                "size": 0.29434,
                "price": 65937
            }
        ],
        "bids": [
            {
                "size": 0.18617,
                "price": 65929.4
            },
            {
                "size": 0.32447,
                "price": 65929.3
            },
            {
                "size": 0.31211,
                "price": 65928.6
            },
            {
                "size": 0.10413,
                "price": 65928.5
            },
            {
                "size": 0.00758,
                "price": 65928.2
            },
            {
          
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/stats` — Exchange-wide stats (last price, 24h volume, daily change)

**Parameters:**
- `symbol` (query, optional, string) — Market symbol Example: `BTC`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lighter-api/v1/stats?symbol=BTC"
```

**Response:**
```json
{
    "data": {
        "symbol": "BTC",
        "daily_low": null,
        "daily_high": null,
        "last_price": 65937.4,
        "mark_price": null,
        "index_price": null,
        "daily_change": 2.540652777453748,
        "daily_trades": 511826,
        "funding_rate": null,
        "open_interest": null,
        "daily_base_volume": 8268.20507,
        "daily_quote_volume": 537857454.447997
    },
    "meta": {
        "timestamp": "2026-06-15T11:15:56.993Z",
        "request_id": "40026c3c-802e-4dc2-9328-a42379c7b54e"
    },
    "status": "ok",
    "message": "Stats retrieved successfully",
    "success": true
}
```

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

**Parameters:**
- `market` (query, required, string) — Symbol or market_id Example: `ETH`
- `limit` (query, optional, string) — Number of trades (1-100) Example: `25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lighter-api/v1/trades?market=ETH&limit=25"
```

**Response:**
```json
{
    "data": {
        "count": 25,
        "symbol": "ETH",
        "trades": [
            {
                "size": 0.0015,
                "type": "trade",
                "price": 1741.32,
                "trade_id": "22784248965",
                "timestamp": 1781522156988
            },
            {
                "size": 0.0015,
                "type": "trade",
                "price": 1741.32,
                "trade_id": "22784248803",
                "timestamp": 1781522156886
            },
            {
                "size": 0.04,
                "type": "trade",
                "price": 1741.32,
                "trade_id": "22784248361",
                "timestamp": 1781522156657
            },
            {
                "size": 0.7858,
                "type": "trade",
                "price": 1740.79,
                "trade_id": "22784244340",
                "timestamp": 1781522155283
            },
            {
                "size": 0.4,
                "type": "trade",
                "price": 1740.72,
                "trade_id": "22784244339",
                "timestamp": 1781522155283
            },
            {
                "size": 0.4836,
                "type": "trade",
                "price": 1740.75,
                "trade_id": "22784242501",
                "timestamp": 1781522154017
            },
            {
                "size": 0.4,
                "type": "trade",
                "price": 1740.75,
                "trade_id": "
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Venue metadata & endpoint guide

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

**Response:**
```json
{
    "data": {
        "note": "Markets accepted by symbol (BTC, ETH, AAPL) or numeric market_id; perp resolved first on symbol clash. Lighter lists tokenised-equity perps alongside crypto.",
        "chain": "zkSync (Ethereum L2)",
        "venue": "Lighter",
        "source": "Lighter public REST (mainnet.zklighter.elliot.ai/api/v1), keyless",
        "examples": {
            "stats": "/v1/stats?symbol=BTC",
            "trades": "/v1/trades?market=ETH&limit=10",
            "markets": "/v1/markets?type=perp",
            "orderbook": "/v1/orderbook?market=BTC&limit=10"
        },
        "endpoints": {
            "/v1/stats": "exchange-wide stats: last price, 24h volume, daily change per market (symbol optional)",
            "/v1/trades": "recent public trades (market, limit)",
            "/v1/markets": "list every market with id, type and fees (filter type=perp|spot)",
            "/v1/orderbook": "live order book (market, limit)"
        },
        "instrument": "order-book perpetuals & spot",
        "cache_ttl_ms": 5000
    },
    "meta": {
        "timestamp": "2026-06-15T11:15:57.410Z",
        "request_id": "83d44e74-4334-4ef7-9392-06e00a415369"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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