HYPERLIQUID HIP-4 TRADING

Hyperliquid HIP-4 trading for AI agents.

HIP-4 markets are outcome markets on Hyperliquid. Slay lists them next to Polymarket, under one key. Your agent reads the market, checks the quote, waits for your yes, then trades.

Read https://www.slay.money/skill.md and set me up on Slay. Plan a strategy and wait for my approval before the first trade.

New to HIP-4? Read what HIP-4 is first.

ENDPOINTS

The calls an agent makes.

Trading and account calls take Authorization: Bearer spk_…. Market reads and quotes work without a key. The same calls are in the API reference and in the MCP server.

GET/api/data/markets?q=btc

Find markets by words. No key.

GET/api/data/book?coin=#398270

Bids and asks for one Hyperliquid side. No key.

GET/api/trade/quote

What an order gets on each venue, after fees. Key optional: with a key, the fee is at the account's rate.

POST/api/trade/buy

Buy an outcome from the API wallet. Market in words ("btc 5m"), outcome, usd. Optional venue, maxPrice, paper.

POST/api/trade/sell

Sell shares you hold in the API wallet. Shares, or all of them when left out.

POST/api/trade/order

Main account. Limit or market, venue auto, hyperliquid or polymarket, coin #<number>, clientOrderId.

POST/api/trade/cancel

Cancel an open order. On Hyperliquid, send the coin too.

GET/api/trade/orders

Open orders on both venues, and the last 50 this key placed or cancelled.

GET/api/trade/account

Wallets, cash, positions and API trading settings for the key's account.

FIRST TRADE

Read, quote, then buy.

1. Find the market

curl "https://www.slay.money/api/data/markets?q=btc"

2. Quote a buy of $10 on the Hyperliquid side

curl "https://www.slay.money/api/trade/quote?market=<market id>&side=buy&usd=10" \
  -H "Authorization: Bearer <your key>"

3. Buy from the API wallet, after the plan is approved

curl -X POST "https://www.slay.money/api/trade/buy" \
  -H "Authorization: Bearer <your key>" -H "Content-Type: application/json" \
  -d '{"market":"btc 5m","outcome":"up","usd":10,"maxPrice":0.6}'

Add "paper": true to trade with $1,000 of practice money on the live books.

FACTS

Fees, price checks and custody.

Each fact has a source in /ai/facts.md. Fee and limit values are the defaults. Each key page shows the account's own.

Market and side
Each Hyperliquid outcome has a side with a number, such as #398270. Use the number for the book and for direct orders. A market in words also works on the buy endpoint.
Price
Prices run from 0 to 1. A price is the market's probability.
Fees on Hyperliquid
Buying outcome shares has no fee. Selling pays Slay's fee and Hyperliquid's fee. Slay's fee is 0.15% per trade, or 0.135% when a friend invited the account.
Routing
For a market on both venues, Slay reads both books. A buy goes where more shares come per dollar. A sell goes where more dollars come per share. Only full fills count.
Price check
On main-account orders: no buy more than 5 cents above the book's middle, no sell more than 5 cents below. The book must be two-sided, with a spread of 10 cents or less.
Limits
Per order: $100 by default, up to $10,000. Per UTC day: $500 by default, up to $50,000. The account owner sets these on the key page.
No withdrawals
No endpoint moves money out of the account. Withdrawals happen in the Slay app.
LIMITS

What the server enforces.

  • A key can place or cancel orders only within its per-order and daily limits. Over-limit requests return 403.
  • 60 order requests a minute per key.
  • A repeated clientOrderId or externalId returns the first answer. It never places a second order.
  • Read-only keys can read the account and cannot place or cancel orders.
  • Revoking the key stops it within a minute. Turning API trading off stops every key.

Access to Hyperliquid follows Hyperliquid's own rules. Slay has no separate Hyperliquid region list. Check Hyperliquid's rules for your region. Polymarket has its own restricted regions, listed in the facts file.