Hyperliquid
Hyperliquid is Cabal's venue for perpetual futures trading and on-chain spot swaps on the Hyperliquid L1. The integration covers market research, order management, position risk, and execution quality analysis.
What it provides
- Perp trading -- Place, modify, and cancel perpetual futures orders. The agent expresses trade intents (open, increase, reduce, close) and Cabal finalizes the exact venue parameters.
- Spot swaps -- IOC (immediate-or-cancel) spot orders on Hyperliquid's spot book, with the same guardrail and approval flows as Solana swaps.
- Market research -- Spread, depth, freshness, trend, funding rates, and open interest for any Hyperliquid perp market.
- Market screening -- Ranked scans across the full Hyperliquid perp universe, sortable by opportunity, momentum, liquidity, volatility, or spread.
- Execution planning -- Pre-trade fill ratio, average executable price, fee estimate, and guardrail fit projections.
- Account and position risk -- Equity, margin usage, liquidation distance, position concentration, and reduce-only recommendations.
- Order state tracking -- Working order age, stale order detection, recent fill history, and duplicate-submit risk analysis.
- Leverage management -- Set leverage and margin mode (cross or isolated) per market.
Setup
Hyperliquid requires a wallet connection and a builder fee approval before your agent can trade. The setup flow is:
- Connect a Hyperliquid wallet -- Link an EVM-compatible wallet in Settings. This wallet signs Hyperliquid actions.
- Approve builder fees -- Cabal charges a builder fee on Hyperliquid orders. Your connected wallet must sign a one-time approval for the builder address and fee rate. The agent can prepare this approval using
hl_prepare_builder_fee_approval, which renders a setup card in web chat for you to sign with your browser wallet. - Check setup status -- Use
hl_setup_statusto see where you are in the setup process. It reports the exact next step and any blocking errors.
If setup is incomplete, the agent will tell you what is missing and point you to the setup card or Settings page.
Perp orders
The primary tool for perp trading is hl_place_perp_order. Instead of raw order parameters, you express a trade intent:
| Field | What it means |
|---|---|
| coin | Market symbol (e.g., "BTC", "ETH", "PURR") |
| side | buy or sell |
| intentKind | open, increase, reduce, or close -- what the trade does to your exposure |
| sizeTarget | Amount in coin units or USD notional |
| sizeCap | Optional maximum size limit |
| priceConstraint | Optional hard price limits: max buy price, min sell price, or max adverse basis points from mid |
| urgency | immediate (crosses now) or normal (may rest as a limit order) |
| allowResting | Whether the backend may choose a resting limit order when urgency allows |
| reduceOnly | If true, only reduces an existing position |
Cabal finalizes the exact order type, price, and time-in-force based on your intent and current market conditions.
In Suggest Only mode, hl_place_perp_order queues the intent for your approval. In Guarded or Full Access mode, it executes directly (subject to guardrails).
Order management
hl_get_open_orders-- List open orders, optionally filtered by coin.hl_modify_order-- Change the size or price of an existing order.hl_cancel_order-- Cancel a single order by ID.hl_cancel_all_orders-- Cancel all open orders, optionally filtered by coin.
Market research tools
These tools give the agent structured market data before making trade decisions:
hl_research_market-- Deep dive on one market: spread, visible book depth, freshness, 1h/4h trend, funding rate, open interest, and momentum bias.hl_screen_markets-- Ranked scan of the entire Hyperliquid universe. Returns compact rows with execution readiness, momentum, spread, depth, and venue context.hl_compare_markets-- Side-by-side comparison of up to 10 specific markets using the same normalized row format as screening.hl_plan_perp_execution-- Preview a proposed trade before placing it. Returns fill ratio, average executable price, fee estimate, adverse-vs-best and adverse-vs-mid basis points, and position effect.
Risk and state tools
hl_get_account_state-- Equity, margin used, available balance, open positions with P&L, and open orders.hl_get_account_risk-- Per-position risk context: liquidation distance, share of equity, open-order overlap, and a reduce-only recommendation.hl_get_order_state-- Order lifecycle context for one coin: working order age, stale flags, recent fills, tracked order history, and duplicate-submit risk.
Leverage
Use hl_set_leverage to set leverage and margin mode for a specific market. You specify the coin, target leverage (e.g., 5 for 5x), and whether to use cross or isolated margin.
In Suggest Only mode, leverage changes are queued for approval.
Builder fees
Cabal applies a builder fee on Hyperliquid orders. The fee rate is configured at the platform level and expressed in tenths of a basis point. If you were referred to Cabal and have an active referral attribution, the effective builder fee is reduced by 10%.
The builder fee approval is a one-time browser-wallet signature. If the approval is missing or the fee rate has changed, the agent will surface a setup card or direct you to Settings.
Guardrails
Your Hyperliquid-specific guardrail settings include:
- Max position size (USD) -- Rejects trades where the value exceeds this limit.
- Max price impact -- Rejects trades where price impact exceeds the configured percentage (shared with the common guardrail settings).
- Max open orders -- Limits the number of concurrent open orders.
- Coin allowlist -- When set, the agent can only trade the listed coins.
Guardrail checks run before execution. Trades that fail are recorded as rejected with the specific check that failed.
Execution quality
After a Hyperliquid order fills, you can inspect execution quality using trade_get_execution_quality with the hyperliquid_order subject kind. This returns:
- Quote age and submit latency
- Landing status and shortfall
- Perp benchmark metrics: theoretical average executable price, fill ratio, decision gap, staleness gap, and residual execution gap
- Fee breakdown and excess analysis
See also
- -- set execution limits
- -- configure agent bindings and venues