---
name: kokoah-hyperliquid-intel
description: Read Hyperliquid perps market intelligence from Kokoah (liquidation maps, order flow, whale moves, TWAPs, top-trader lean, news and order-flow cards, wallet records, AI market reads) through Kokoah's MCP server or REST API; with the user's account scopes, read their account's risk, add protection that only reduces or closes, and draft orders they confirm. Use when a task asks how a Hyperliquid market is positioned, where liquidations cluster, what large traders are doing, what a wallet's record is, or how safe the user's own positions are.
---

# Kokoah: Hyperliquid market intelligence

Kokoah (https://kokoah.com) reads Hyperliquid's positions and trades and turns them into measurements. Nothing here can
move funds or place an order by itself: the account scopes below only read the user's account, add protection that
can only reduce or close a position, or draft an order the user confirms in the app.

## Connect

- MCP server: `https://api.kokoah.com/mcp` (streamable HTTP, no sessions). Header: `Authorization: Bearer kk_…` (or
  `X-API-Key: kk_…`). Listed in the official MCP registry as `com.kokoah/mcp`.
- REST: `https://api.kokoah.com/v1/agent/…` with the same header. OpenAPI: `https://api.kokoah.com/docs/openapi.json`
  (tags `agent-intel` and `agent-news`).
- MCP clients that sign in (OAuth), such as the Claude and ChatGPT apps' custom connectors, need no key: add the
  server's address and the user approves the app on Kokoah, choosing what it may do.
- A key comes from the user: Kokoah, Settings → News API → Create key. Never ask for a wallet's private key; Kokoah
  never needs one here. The account scopes (`account:read`, `guardians:protect`, `orders:propose`) are given only when
  the user ticks them while making the key and signs once more with their wallet; they act on the account that made
  the key (and its sub-accounts) only.
- Docs: https://kokoah.com/docs/developers and https://kokoah.com/docs/news-api

## Tools

| Tool | Answers | Use it for |
| --- | --- | --- |
| `scan_markets` | Every perp in one row: group lean now and a day ago, liquidations within 2/5/10% of the price, TWAPs, whale trades | Finding which markets stand out |
| `liquidation_map` | USD of liquidations and entries per price step, group lean, largest positions | Where forced selling or buying would start |
| `order_flow` | Taker buys and sells, longs and shorts opened and closed, liquidations, over the last `minutes`; per candle with `interval` | What just happened in a market |
| `whale_moves` | Position changes of $100,000 or more, newest first | What large accounts are doing |
| `top_trader_lean` | How the most active traders (by 30-day volume) are positioned, with open interest | Crowd positioning in a main-dex perp |
| `flow_events` | Kokoah's news and order-flow cards in Kokoah's own words, with source links | Context: news, listings, liquidation waves |
| `trader_record` | A wallet's PnL, ROI and rank per window, its largest 30-day drawdown, active days, recent fill counts | Checking a wallet before following it |
| `market_read` | Kokoah's short AI read: bull case, bear case, what to watch, lean | A summary to start from |
| `read_track_record` | How past AI reads' leans did 4 h, 24 h and 7 days later, against the baseline | How much weight a read deserves |
| `account_risk` (`account:read`) | The user's positions: size, entry, mark, PnL, leverage, liquidation price and distance, stop-loss cover; account value, margin and maintenance use | How close the user's positions are to liquidation, and which have no stop |
| `add_protection` (`guardians:protect`) | Adds a rule that can only reduce or close: `breakeven`, `trailingStop`, `liquidationGuard` (alert and reduce), `bracket`, `twap` (close or reduce), `dailyLossLock` | Protecting a position the user asked you to protect |
| `list_protection`, `remove_protection` | The rules this key added, and removing one | Checking or undoing what you added |
| `propose_order` (`orders:propose`) | A draft order (market or limit, optional stop-loss and take-profit) that waits in the app for the user to confirm or dismiss; it expires in 10 minutes | Offering a trade the user asked for; never place one yourself |

## How to read the answers

- Times are unix milliseconds (UTC). Amounts are USD unless a field names the coin. Negative position sizes are
  shorts. `Pct` fields are percents (1.25 means 1.25%).
- Coins are exact Hyperliquid names: `BTC`, `ETH`, `kPEPE`; HIP-3 markets as `dex:COIN` (for example `xyz:TSLA`).
- Groups: `all` (every account read), `smart` (the leaderboard's best traders), `whales` (the largest accounts).
- A liquidation cluster is where positions would be closed by force if the price got there. It is not a forecast
  that the price will get there.
- Always tell the user these are measurements, not advice. Never present a read as a trading signal or a promise.
  Say when data is missing (null fields, `coverage`) instead of guessing.

## Limits

- 120 requests a minute per key, across every endpoint and the MCP server. One MCP request counts once.
- New market reads have a small share of their own each minute (503 `agent_reads_busy` past it); answers Kokoah has
  just read are shared and free. 30 new wallet lookups a minute and 20 new AI reads a day per account.
- On 429 or 503, wait as long as `Retry-After` (or the tool error's "retry after") says. Don't poll in a loop: ask
  again only when the user needs a fresh answer. For live news, use the News API's stream.

## Alerts (scope `alerts:write`)

- `POST /v1/agent/alerts` with `{ "rule": {...}, "label"?, "notify"?, "cooldownSec"?, "webhookUrl"? }` makes a market
  alert (types `priceCross`, `percentMove`, `priceStep`, `fundingRate`, `groupFlip`, `crowding`, `liquidationCluster`,
  `liquidationRun`, `largeTwap`; rule fields as in the OpenAPI document). `GET` lists the key's rules, `DELETE
  /v1/agent/alerts/{id}` removes one. 20 per key; a rule fires at most once a minute.
- Firings: `GET /v1/agent/alerts/events?after=<last id>`, the SSE stream `GET /v1/agent/alerts/stream`, or the rule's
  webhook (https, port 443), signed `Kokoah-Signature: t=<unix>,v1=<hex HMAC-SHA256 of "t.body">` with the
  `webhookSecret` returned once at creation. Retries can repeat a `Kokoah-Event-Id`: handle each id once.
- Prefer an alert to asking for the same data again and again.

## Account scopes

- `account_risk` (`GET /v1/agent/account/risk`, `?account=` a sub-account) answers measurements, never what to do. Say
  them plainly ("BTC long is 8% from liquidation, no stop-loss") and let the user decide.
- `add_protection` takes the rule object as Kokoah's guardian API does (`type`, `coin` and the type's settings; see the
  OpenAPI document, `POST /v1/agent/guardians`). Its orders are signed reduce-only: it can never open or add to a
  position. 20 active rules per key. The user sees them in the app; revoking the key pauses them.
- `propose_order` (`POST /v1/agent/orders/drafts`) places nothing: the user reviews the draft in the order ticket and
  signs it in their own browser, under their own limits, or dismisses it. 5 drafts wait at once per key, 30 an hour.
  `GET /v1/agent/orders/drafts` tells you what became of each: `pending`, `opened` (the user took it into the ticket;
  it doesn't say whether they placed it), `dismissed`, `expired`, `withdrawn`. Don't propose again and again: one draft per request of the user.

## Errors

`401` no key or a wrong one; `403 insufficient_scope` the key can't read this (older keys read the news only: make a
new key); `429` a limit; `503` paused or busy. In MCP, a refused call is a tool error that starts with the same code.
