Skills 0xarchive
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/0xfantommenace/0xarchive" ~/.claude/skills/clawdbot-skills-0xarchive && rm -rf "$T"
skills/0xfantommenace/0xarchive/SKILL.md0xArchive API Skill
Query historical and real-time crypto market data from 0xArchive using
curl. Three exchanges are supported: Hyperliquid (perps DEX), Lighter.xyz (order-book DEX), and HIP-3 (Hyperliquid builder perps). Data types: orderbooks, trades, candles, funding rates, open interest, liquidations, and data quality metrics.
Authentication
All endpoints require the
x-api-key header. The key is read from $OXARCHIVE_API_KEY.
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" "https://api.0xarchive.io/v1/..."
Exchanges & Coin Naming
| Exchange | Path prefix | Coin format | Examples |
|---|---|---|---|
| Hyperliquid | | UPPERCASE | , , |
| HIP-3 | | Case-sensitive, | , , , , , |
| Lighter | | UPPERCASE | , |
Hyperliquid and Lighter auto-uppercase the symbol server-side. HIP-3 coin names are passed through as-is.
Timestamps
All timestamps are Unix milliseconds. Use these shell helpers:
NOW=$(( $(date +%s) * 1000 )) HOUR_AGO=$(( NOW - 3600000 )) DAY_AGO=$(( NOW - 86400000 )) WEEK_AGO=$(( NOW - 604800000 ))
Response Format
Every response follows this shape:
{ "success": true, "data": [ ... ], "meta": { "count": 100, "request_id": "uuid", "next_cursor": "1706000000000" // present when more pages exist } }
Endpoint Reference
Hyperliquid (/v1/hyperliquid
)
/v1/hyperliquid| Endpoint | Params | Notes |
|---|---|---|
| -- | List all instruments |
| -- | Single instrument details |
| , | Latest or at timestamp |
| , , , , | Historical snapshots |
| , , , | Trade history |
| , , , , | OHLCV candles |
| -- | Current funding rate |
| , , , , | Funding rate history |
| -- | Current open interest |
| , , , , | OI history |
| , , , | Liquidation events |
| , , , , | Aggregated liquidation volume (USD) |
| , , , , | Liquidations for a user |
| -- | Data freshness per data type |
| -- | Combined market summary (price, funding, OI, volume, liquidations) |
| , , , , | Mark/oracle/mid price history |
| , , , , , , | Order history with user attribution (Build+) |
| , , , | Order flow aggregation (Build+) |
| , , , , , | TP/SL order history (Pro+) |
| , | L4 orderbook reconstruction (Pro+) |
| , , , | L4 orderbook diffs (Pro+) |
| , , , | L4 orderbook checkpoints (Pro+) |
| , | L2 full-depth orderbook derived from L4 (Build+) |
| , , , , | L2 full-depth checkpoints (Build+) |
| , , , | L2 tick-level diffs (Pro+) |
HIP-3 (/v1/hyperliquid/hip3
)
/v1/hyperliquid/hip3Coin names are case-sensitive (e.g.,
km:US500). Free tier includes km:US500 for orderbook and orderbook history; Build+ unlocks all HIP-3 symbols.
| Endpoint | Params | Notes |
|---|---|---|
| -- | List HIP-3 instruments |
| -- | Single instrument |
| , | Free: km:US500 only. Build+: all HIP-3 symbols. |
| , , , , | Free: km:US500 only. Build+: all HIP-3 symbols. |
| , , , | Trade history |
| | Recent trades (no time range needed) |
| , , , , | OHLCV candles |
| -- | Current funding rate |
| , , , , | Funding history |
| -- | Current OI |
| , , , , | OI history |
| , , , | Liquidation events |
| , , , , | Aggregated liquidation volume (USD) |
| -- | Data freshness per data type |
| -- | Combined market summary (price, funding, OI) |
| , , , , | Mark/oracle/mid price history |
| , , , , , , | Order history with user attribution (Build+) |
| , , , | Order flow aggregation (Build+) |
| , , , , , | TP/SL order history (Pro+) |
| , | L4 orderbook reconstruction (Pro+) |
| , , , | L4 orderbook diffs (Pro+) |
| , , , | L4 orderbook checkpoints (Pro+) |
| , | L2 full-depth orderbook derived from L4 (Build+) |
| , , , , | L2 full-depth checkpoints (Build+) |
| , , , | L2 tick-level diffs (Pro+) |
Lighter (/v1/lighter
)
/v1/lighterSame data types as Hyperliquid except: no liquidations. Adds
granularity on orderbook history and /recent trades.
| Endpoint | Params | Notes |
|---|---|---|
| -- | List Lighter instruments |
| -- | Single instrument |
| , | Latest or at timestamp |
| , , , , , | Default granularity: |
| , , , | Trade history |
| | Recent trades (no time range needed) |
| , , , , | OHLCV candles |
| -- | Current funding rate |
| , , , , | Funding history |
| -- | Current OI |
| , , , , | OI history |
| -- | Data freshness per data type |
| -- | Combined market summary (price, funding, OI) |
| , , , , | Mark/oracle price history |
| , , | L3 order-level orderbook (Pro+) |
| , , , , , | Historical L3 snapshots (Pro+) |
Data Quality (/v1/data-quality
)
/v1/data-quality| Endpoint | Params | Notes |
|---|---|---|
| -- | System health status |
| -- | Coverage summary, all exchanges |
| -- | Coverage for one exchange |
| , | Symbol-level coverage + gaps |
| , , , , | List incidents |
| -- | Single incident |
| -- | Ingestion latency metrics |
| , | SLA compliance report |
WebSocket Channels
Additional real-time channels available via WebSocket (
wss://api.0xarchive.io/ws?apiKey=KEY):
| Channel | Notes |
|---|---|
| L4 orderbook diffs with user attribution (Pro+, real-time only) |
| Order lifecycle events with user attribution (Pro+, real-time only) |
| Lighter L3 order-level orderbook snapshots (Pro+, historical only) |
| HIP-3 liquidation events with long/short direction (Build+, historical only) |
| HIP-3 L4 orderbook diffs (Pro+, real-time only) |
| HIP-3 order lifecycle events (Pro+, real-time only) |
Web3 Authentication (/v1
)
/v1Get API keys programmatically using an Ethereum wallet (SIWE). No API key required for these endpoints.
| Endpoint | Params | Notes |
|---|---|---|
| (wallet address) | Returns SIWE message to sign |
| , | Returns free-tier API key |
| , | List all keys for wallet |
| , , | Revoke a key |
| ( or ), header | x402 USDC subscription (see flow below) |
Free-tier flow: Call
/auth/web3/challenge with wallet address → sign the returned message with personal_sign (EIP-191) → submit to /web3/signup with the message and signature → receive API key.
Paid-tier flow (x402):
withPOST /web3/subscribe
→ server returns 402 with{ "tier": "build" }
(micro-USDC),payment.amount
(treasury address),payment.pay_to
.payment.network- Sign an EIP-712
(EIP-3009) on USDC Base:TransferWithAuthorization- Domain:
{ name: "USD Coin", version: "2", chainId: 8453, verifyingContract: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" } - Type:
TransferWithAuthorization(address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce) - Message:
{ from: <wallet>, to: <pay_to>, value: <amount>, validAfter: 0, validBefore: <now+3600>, nonce: <32 random bytes hex> }
- Domain:
- Build x402 v2 payment payload:
{ "x402Version": 2, "payload": { "signature": "0x<EIP-712 signature hex>", "authorization": { "from": "0x<wallet>", "to": "0x<pay_to from step 1>", "value": "<amount as string>", "validAfter": "0", "validBefore": "<unix timestamp as string>", "nonce": "0x<64 hex chars>" } } } - Base64-encode the JSON and retry:
withPOST /web3/subscribe
and header{ "tier": "build" }
→ receive API key + subscription.payment-signature: <base64 payload>
Important: All
authorization values (value, validAfter, validBefore) must be strings, not numbers. See scripts/web3_subscribe.py for a complete working Python implementation.
Common Parameters
| Param | Type | Description |
|---|---|---|
| int | Start timestamp (Unix ms). Defaults to 24h ago. |
| int | End timestamp (Unix ms). Defaults to now. |
| int | Max records. Default 100, max 1000 (max 10000 for candles). |
| string | Pagination cursor from . |
| string | Candle interval: , , , , , , , . Default: . For OI/funding: , , , , , . Omit for raw data. |
| int | Orderbook depth (number of price levels per side). |
| string | Lighter orderbook resolution: (default), , , , . |
| int | Lighter L3 orderbook: filter by account index (e.g., for LLP vault). |
Smart Defaults
When the user does not specify a time range, default to the last 24 hours:
NOW=$(( $(date +%s) * 1000 )) DAY_AGO=$(( NOW - 86400000 ))
For candles with no explicit range, default to a range that makes sense for the interval (e.g., last 7 days for 4h candles, last 30 days for 1d candles).
Trade Response Fields
Each trade/fill record includes:
| Field | Type | Description |
|---|---|---|
/ | string | Trading pair symbol |
| string | (buy) or / (sell) |
| string | Execution price |
| string | Trade size |
| string | ISO 8601 timestamp |
| integer | Unique trade ID |
| integer | Associated order ID |
| boolean | = taker, = maker |
| string | Base trading fee |
| string | Fee denomination (e.g., USDC) |
| string | Realized PnL if closing position |
| string | , , , etc. |
| string | Position size before trade |
| string | User's wallet address |
| string | Builder address that routed this order. Only present when the order was placed through a builder. |
| string | Builder fee charged on this fill, paid to the builder (quote currency, typically USDC). Only present when is set. |
| string | HIP-3 deployer fee share (quote currency). Negative for the maker side (rebate), positive for the taker side. HIP-3 only. |
| number | Priority fee burned in HYPE (not USDC) for write priority on the Hyperliquid validator queue. Independent of and — paid to the network, not to a builder or deployer. Only present when the order paid for priority. |
| string | Client order ID |
| integer | TWAP execution ID |
builder_address, builder_fee, deployer_fee, priority_gas, cloid, and twap_id are optional — only present when non-zero/non-empty. deployer_fee is specific to HIP-3. priority_gas appears on any order that paid for write priority (most common on HIP-3 IOC orders).
Pagination
When
meta.next_cursor is present in the response, more data is available. Append &cursor=VALUE to fetch the next page:
# First page curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/trades/BTC?start=$START&end=$END&limit=1000" # Next page (use next_cursor from previous response) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/trades/BTC?start=$START&end=$END&limit=1000&cursor=1706000000000_12345"
Tier Limits
| Tier | Price | Coins | Orderbook Depth | Lighter Granularity | Historical Depth | Rate Limit |
|---|---|---|---|---|---|---|
| Free | $0 | BTC only (HIP-3: km:US500 only) | 20 levels | -- | 30 days | 15 RPS |
| Build | $49/mo | All | 200 levels | checkpoint, 30s, 10s | 1 year | 50 RPS |
| Pro | $199/mo | All | Full depth | + 1s | Full history | 150 RPS |
| Enterprise | Custom | All | Full depth | + tick | Full history | Custom |
Error Handling
| HTTP Status | Meaning | Action |
|---|---|---|
| 400 | Bad request / validation error | Check params (missing start/end, invalid interval) |
| 401 | Missing or invalid API key | Set |
| 403 | Tier restriction | Upgrade plan (e.g., non-BTC coin on Free tier) |
| 404 | Symbol not found | Check coin name spelling and exchange |
| 429 | Rate limited | Back off and retry |
Error responses return
{ "code": 400, "error": "description" }.
Example Queries
# List Hyperliquid instruments curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/instruments" | jq '.data | length' # Current BTC orderbook (top 10 levels) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/orderbook/BTC?depth=10" | jq '.data' # ETH trades from the last hour NOW=$(( $(date +%s) * 1000 )); HOUR_AGO=$(( NOW - 3600000 )) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/trades/ETH?start=$HOUR_AGO&end=$NOW&limit=100" | jq '.data' # SOL 4h candles for the last week NOW=$(( $(date +%s) * 1000 )); WEEK_AGO=$(( NOW - 604800000 )) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/candles/SOL?start=$WEEK_AGO&end=$NOW&interval=4h" | jq '.data' # Current BTC funding rate curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/funding/BTC/current" | jq '.data' # BTC open interest aggregated to 1h intervals (last week) NOW=$(( $(date +%s) * 1000 )); WEEK_AGO=$(( NOW - 604800000 )) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/openinterest/BTC?start=$WEEK_AGO&end=$NOW&interval=1h" | jq '.data' # ETH funding rates aggregated to 4h intervals (last 30 days) NOW=$(( $(date +%s) * 1000 )); MONTH_AGO=$(( NOW - 2592000000 )) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/funding/ETH?start=$MONTH_AGO&end=$NOW&interval=4h" | jq '.data' # HIP-3 km:US500 current orderbook (Free tier safe) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/hip3/orderbook/km:US500" | jq '.data' # HIP-3 km:US500 orderbook history (Free tier safe) NOW=$(( $(date +%s) * 1000 )); HOUR_AGO=$(( NOW - 3600000 )) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/hip3/orderbook/km:US500/history?start=$HOUR_AGO&end=$NOW&limit=10" | jq '.data' # HIP-3 km:US500 candles (last 24h, 1h interval) NOW=$(( $(date +%s) * 1000 )); DAY_AGO=$(( NOW - 86400000 )) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/hip3/candles/km:US500?start=$DAY_AGO&end=$NOW&interval=1h" | jq '.data' # Lighter BTC orderbook history (30s granularity, last hour) NOW=$(( $(date +%s) * 1000 )); HOUR_AGO=$(( NOW - 3600000 )) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/lighter/orderbook/BTC/history?start=$HOUR_AGO&end=$NOW&granularity=30s&limit=100" | jq '.data' # System health status curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/data-quality/status" | jq '.' # SLA report for current month curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/data-quality/sla" | jq '.' # BTC market summary (price, funding, OI, volume, liquidations in one call) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/summary/BTC" | jq '.data' # BTC data freshness (lag per data type) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/freshness/BTC" | jq '.data' # BTC price history (mark/oracle/mid) aggregated to 1h NOW=$(( $(date +%s) * 1000 )); DAY_AGO=$(( NOW - 86400000 )) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/prices/BTC?start=$DAY_AGO&end=$NOW&interval=1h" | jq '.data' # BTC liquidation volume aggregated to 4h buckets NOW=$(( $(date +%s) * 1000 )); WEEK_AGO=$(( NOW - 604800000 )) curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/hyperliquid/liquidations/BTC/volume?start=$WEEK_AGO&end=$NOW&interval=4h" | jq '.data' # Data coverage for Hyperliquid BTC curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \ "https://api.0xarchive.io/v1/data-quality/coverage/hyperliquid/BTC" | jq '.'