> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chance.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Hyperliquid

> Venue-aware verification for Hyperliquid — pass the exact exchange-endpoint payload, get a verdict bound to those bytes.

Chance understands Hyperliquid natively. Submit the **exact `/exchange` action payload** your agent is about to send and the harness will deterministically classify it, judge it against your mandate with Hyperliquid's own documentation in the loop, and return a signed verdict whose `requestHash` binds to those exact bytes.

## What gets recognized

Every exchange-endpoint action type is classified into a family:

| Family       | Action types                                                                                             |
| ------------ | -------------------------------------------------------------------------------------------------------- |
| `order`      | `order`, `modify`, `batchModify`, `cancel`, `cancelByCloid`, `scheduleCancel`, `twapOrder`, `twapCancel` |
| `margin`     | `updateLeverage`, `updateIsolatedMargin`                                                                 |
| `withdrawal` | `withdraw3`                                                                                              |
| `transfer`   | `usdSend`, `spotSend`, `usdClassTransfer`                                                                |
| `staking`    | `tokenDelegate`, `cDeposit`, `cWithdraw`                                                                 |
| `vault`      | `vaultTransfer`, `createVault`                                                                           |
| `subaccount` | `subAccountTransfer`, `subAccountSpotTransfer`, `createSubAccount`                                       |
| `permission` | `approveAgent`, `approveBuilderFee`                                                                      |

For orders, the classifier resolves asset indices against a snapshot of the perp universe, decodes side/tif/reduce-only, and computes notional — so the judge reasons over `SELL/SHORT MATIC-PERP, size 5000 @ 2.1 ≈ $10,500 notional`, not over `{"a":3,"b":false,…}`.

## Use it from your bot

Wrap the call you were already going to make:

```ts theme={null}
const order = {
  type: "order",
  orders: [{ a: 3, b: false, p: "2.1", s: "5000", r: false, t: { limit: { tif: "Gtc" } } }],
  grouping: "na",
};

const res = await fetch("https://harness.chance.cc/api/v1/intent", {
  method: "POST",
  headers: { "x-api-key": process.env.CHANCE_API_KEY!, "Content-Type": "application/json" },
  body: JSON.stringify({
    intent: "Trend-follow BTC/ETH only. Longs only. Max 3x leverage. Max $500 notional per position.",
    venue: "hyperliquid",
    action: order, // the exact payload — the verdict binds to these bytes
  }),
});

const { verdict, reasoning, mode, actionFamily } = await res.json();
if (verdict !== "ALLOW") throw new Error(`Blocked: ${reasoning}`);
// only now submit `order` to Hyperliquid
```

`venue` is optional — Hyperliquid payload shapes are auto-detected — but passing it is good hygiene. Freeform `action` strings still work and are judged semantically (`mode: "semantic"`).

## Use it from Claude or ChatGPT

Add the hosted connector (`https://harness.chance.cc/api/mcp`, see [Connectors](/connectors)) and give your agent one standing instruction:

> Before executing any Hyperliquid action, call `verify_intent` with my rules as the intent and the exact API payload as the action, with `venue: "hyperliquid"`. Only proceed on ALLOW; on BLOCK or ESCALATE, stop and tell me why.

Agents with Hyperliquid execution tools then get gated automatically; agents without them still give you provable pre-trade checks in chat.

## How the harness knows Hyperliquid

The judge works from a **versioned snapshot of Hyperliquid's own docs** (exchange endpoint, orders, margining, fees and funding, staking, vaults, transfers and withdrawals — ingested from HL's published markdown), plus a curated brief of common footguns (asset-index confusion, `b` side semantics, string-typed prices, lockup windows, the privilege weight of `approveAgent`). Docs are never fetched at verdict time: the snapshot is reviewed like code, its version is hashed into every transcript, and each page the judge consults is recorded as a chained `agent.doc` event — the receipt proves exactly which knowledge informed the verdict. See [Architecture](/concepts/architecture) for the full picture.

## What the receipt adds for Hyperliquid

On top of the standard proof bundle (transcript root, judge signature, onchain anchor), venue-aware verdicts carry `venue: "hyperliquid"`, the `actionFamily`, the venue `actionType`, `mode: "structured"`, and the knowledge-snapshot version — all inside the hash-chained transcript.

<Note>
  **Roadmap:** escrowed execution via Hyperliquid API wallets — same contract, but an ALLOW triggers submission by a Chance-held agent wallet and a BLOCK physically never reaches a signer. The payload-first contract above is forward-compatible with it.
</Note>
