agent-desk REST v1 MCP 2025-03-26
PROGRAMMATIC EXECUTION · LONG-TAIL PERPS & 7D OPTIONS

Hyperliquid-Grade API & Streamable HTTP MCP

Quote, execute, stream, and attribute long-tail perpetuals and 7-day European options over a single /v1/* REST surface, POST /mcp JSON-RPC server, and real-time SSE feeds.

House Equity —
Available Room —
Max Leverage 3x
Builder Cap 50 bps
Carry Sign Negative = house pays trader · Positive = trader pays house
Settlement 30-min TWAP spot · TP/SL evaluated on TWAP30 only (zero 1s wick stop-outs)
Idempotency Durable SQLite Idempotency-Key replay with X-Idempotency-Replay: true
Rate Limits Per-key sliding window · X-RateLimit-Remaining & 429 Retry-After

Live Interactive Playground

Execute live requests against this node's REST /v1/* and Streamable HTTP POST /mcp endpoints right from the browser.

Request Ctrl/⌘ + Enter to run
JSON Body
Exchange metadata, global caps, carry sign convention, and settlement model.
Response READY
// Click "Send" or pick an endpoint preset to inspect live JSON output.
1-Click MCP Client Configuration

Streamable HTTP transport at /mcp (13 tools)

Run in your terminal or save to .mcp.json
Zero-Dependency SDK Quickstart

Auto-generates UUID Idempotency-Key, supports Builder Codes & SSE streams

sdk/python/desk_v1_client.py · Python 3.10+ stdlib only

Real-Time SSE Streams

Diff-friendly JSON frames (snapshot, diff, heartbeat) over standard text/event-stream.

IDLE 0 frames
Uses browser EventSource with diff-friendly payloads
Select a stream above and click Connect SSE to inspect live snapshot, diff, and heartbeat events.

REST v1, Builder Codes & MCP Reference

All endpoints return {"ok": false, "error": {"code", "message", "details"}} on errors.

REST Endpoints (/v1/*) Scopes: read · quote · trade · stream · admin
Method Endpoint Scope Description
GET/v1/metapublicExchange caps, equity, carry sign & TWAP30 settlement model
GET/v1/omenspublicLive ranked shortable markets (sort, chain, limit)
GET/v1/markets/searchpublicSearch markets by ticker, name, or contract address
GET/v1/markets/{chain}/{address}publicSpot, TWAP30, carry rates, vault caps & option availability
GET/v1/markets/{chain}/{address}/barspublicOHLCV price bars & TWAP30 (1h, 4h, 24h)
GET/v1/leaderboardpublicLive trader P&L, volume, win rate, and rankings
POST/v1/quotes/perpquoteLock 60s perp quote with optional builder attribution
POST/v1/quotes/optionquoteLock 60s 7-day European call/put option quote
POST/v1/orderstradeFill quoted order (Idempotency-Key + builder attribution)
POST/v1/positions/{id}/tpsltradeSet or clear TWAP30-evaluated take-profit / stop-loss
POST/v1/positions/{id}/closetradeClose open perp at covered 30-min TWAP spot
GET/v1/positionsreadOpen & settled perps/options with mark, P&L & carry
GET/v1/accountreadAccount balances, margin locked, realized/unrealized P&L
POST/v1/keysadminMint scoped API key with builder_id & builder_fee_bps (≤ 50)
GET/v1/builders/{builder_id}/statspublicBuilder volume, quote/order/fill counts & accrued USD fees
GET/v1/stream/positionsstreamSSE stream of live position & account diffs + heartbeats
GET/v1/stream/omenspublicSSE stream of live ranked short board diffs + heartbeats
GET/v1/stream/bookstreamSSE stream of full house & position book diffs + heartbeats
Builder Codes & MCP Tools (13) POST /mcp · JSON-RPC 2.0

Hyperliquid-Style Builder Attribution

Mint a scoped API key via POST /v1/keys with a builder_id and builder_fee_bps (0–50 bps, max 0.50%). Every quote, order, and fill executed with that key automatically records attribution and computes builder_fee_usd = notional_usd × builder_fee_bps / 10,000, queryable anytime at GET /v1/builders/{builder_id}/stats.

search_markets get_market get_market_bars get_meta list_short_omens get_leaderboard quote_perp quote_option place_order set_tpsl close_position get_positions get_account