{"version": "1.0", "benchmark": "Classic BitMEX bot-facing ergonomics (fixed-point integer sats, BIP340 auth, sequenced L2/private WS, dead-man switch, idempotent clOrdID)", "auth": {"scheme": "BIP340-Schnorr", "headers": {"X-API-KEY": "64-hex BIP340 x-only pubkey (account or registered sub-key)", "X-API-EXPIRES": "Unix timestamp in seconds; rejected if < now - 5s or > now + 300s", "X-API-NONCE": "Monotonic or unique string per key within expiry window (replay-rejected)", "X-API-SIGNATURE": "128-hex BIP340 Schnorr signature over: METHOD\\nPATH_WITH_QUERY\\nEXPIRES\\nNONCE\\nSHA256_HEX(BODY)"}, "scopes": ["READ", "TRADE", "WITHDRAW", "ADMIN"]}, "rate_limits": {"public_rest": {"requests_per_sec": 50, "burst": 100}, "private_rest": {"requests_per_sec": 30, "burst": 60}, "orders_per_sec": {"sustained": 25, "burst": 100}, "ws_subscriptions_per_conn": 50}, "error_codes": ["ERR_AUTH_MISSING", "ERR_AUTH_INVALID", "ERR_AUTH_EXPIRED", "ERR_NONCE_REPLAY", "ERR_SCOPE_DENIED", "ERR_RATE_LIMITED", "ERR_STALE_FENCE", "ERR_UNKNOWN_INSTRUMENT", "ERR_INSTRUMENT_HALTED", "ERR_INSTRUMENT_POST_ONLY", "ERR_INSTRUMENT_SETTLE_ONLY", "ERR_INVALID_SIDE", "ERR_INVALID_ORDER_TYPE", "ERR_INVALID_TIF", "ERR_INVALID_FLAGS", "ERR_INVALID_PRICE", "ERR_INVALID_QTY", "ERR_MIN_NOTIONAL", "ERR_POST_ONLY_WOULD_CROSS", "ERR_FOK_UNFILLABLE", "ERR_REDUCE_ONLY_SPOT", "ERR_REDUCE_ONLY_REJECT", "ERR_INSUFFICIENT_BALANCE", "ERR_MAX_POSITION_EXCEEDED", "ERR_CLORDID_CONFLICT", "ERR_ORDER_NOT_FOUND", "ERR_ORDER_NOT_OPEN", "ERR_INVALID_AMEND", "ERR_INDEX_OUTAGE", "ERR_SETTLEMENT_NOT_FOUND", "ERR_SETTLEMENT_INVALID_STATE", "ERR_LOCK_VERIFY_FAILED", "ERR_REFUND_LOCKED", "ERR_DUPLICATE_DEPOSIT"], "rest_endpoints": {"GET /api/v1/instruments": "Instrument specs, fixed-point ticks/lots, fees, states.", "GET /api/v1/orderbook?symbol=SYM&depth=25": "Sequenced L2 snapshot (seq, bids, asks).", "GET /api/v1/trades?symbol=SYM&cursor=0&limit=100": "Recent trades with cursor.", "GET /api/v1/index?symbol=SYM": "Distinct last, spot index, liquidation mark, funding rate & source health.", "GET /api/v1/events?cursor=0&limit=200&symbol=SYM": "Sequenced event log for reconnect & gap recovery.", "GET /api/v1/oracle": "Live Pyth Pro Ed25519 + multi-venue USD/BTC spot index and 3-feed architecture status.", "POST /api/v1/oracle/verify": "Verify raw hex Pyth Pro (pyth-pro-ed25519-v1) binary proof offline against consensus rules.", "GET /api/v1/exchange/custody": "Explicit custody, collateral buckets, HTLC finality & exit policy.", "GET /api/v1/exchange/schemas": "This API, schema, auth, rate-limit, and error-code contract.", "GET /api/v1/account": "[AUTH:READ] Balances (6 buckets), open orders, positions, settlements, fills.", "GET /api/v1/orders": "[AUTH:READ] Account open orders (optional symbol filter).", "GET /api/v1/positions": "[AUTH:READ] Account perp positions, margin, entry, mark, uPnL.", "GET /api/v1/fills": "[AUTH:READ] Account recent fills.", "GET /api/v1/settlements": "[AUTH:READ] Account cross-chain spot HTLC & batch settlements.", "POST /api/v1/orders": "[AUTH:TRADE] Place order (idempotent by client_order_id).", "POST /api/v1/orders/amend": "[AUTH:TRADE] Amend qty/price (qty decrease preserves queue priority).", "POST /api/v1/orders/cancel": "[AUTH:TRADE] Cancel single order_id/client_order_id or batch order_ids.", "POST /api/v1/orders/cancel_all": "[AUTH:TRADE] Cancel all open orders for account (optional symbol filter).", "POST /api/v1/orders/deadman": "[AUTH:TRADE] Arm/renew/disarm server-side dead-man switch (timeout_ms).", "POST /api/v1/settlement/update": "[AUTH:TRADE] Advance/verify/reorg/refund/dispute spot settlement."}, "ws_endpoints": {"GET /ws/v1/public": "RFC 6455 WS: subscribe {op:'subscribe', channels:['l2:SYM','trades:SYM','index:SYM','status']}. Emits sequenced snapshots + deltas.", "GET /ws/v1/private": "RFC 6455 WS: authenticate {op:'auth', api_key, expires, nonce, signature, since_seq}. Emits acks, rejects, fills, cancels, balances, positions, settlement states."}, "order_request_schema": {"symbol": "string (e.g. 'QWEN-BTC' or 'QWEN-BTC-PERP')", "side": "'BUY' | 'SELL'", "order_type": "'LIMIT' | 'MARKETABLE_LIMIT'", "tif": "'GTC' | 'IOC' | 'FOK'", "price_sats": "int > 0, multiple of tick_size", "qty_sats": "int > 0, multiple of lot_size", "client_order_id": "string (required for idempotency, 1..64 chars)", "post_only": "bool (default false; incompatible with IOC/FOK)", "reduce_only": "bool (default false; PERP only)", "stp": "'CANCEL_NEWEST' | 'CANCEL_OLDEST' | 'CANCEL_BOTH' | 'NONE' (default 'CANCEL_NEWEST')"}}