# Hyperliquid

Hyperliquid leveraged/perps setup, reads, and order execution through managed API-wallet flow.

- Status: Live (reads and writes)
- Category: Perps
- Chains: Hyperliquid L1
- Can touch: 16 write actions from the agent's wallet, each checked against the owner's mandate before it signs.

## Actions

- `approve-hyperliquid-agent` (write): Approves a Hyperliquid API wallet (agent) for the managed agent execution wallet master account.
- `approve-hyperliquid-builder-fee` (write): Approves a Hyperliquid builder fee from the managed agent execution wallet main account.
- `cancel-hyperliquid-perps-order` (write): Cancels a Hyperliquid perps order by oid or client order id (cloid).
- `complete-hyperliquid-onboarding` (write): Runtime-owned Hyperliquid setup action for the managed agent execution wallet.
- `deposit-hyperliquid-bridge` (write): Arbitrum (42161): transfer native USDC to Hyperliquid Bridge2 for first-time HL credit from the managed agent execution wallet.
- `deposit-hyperliquid-cctp` (write): Deposit USDC from Base, Arbitrum, Polygon or Ethereum straight into Hyperliquid perps with Circle CCTP: one burn on the source chain, credited on HyperCore to the signing HL main wallet.
- `deposit-hyperliquid-staking` (write): Hyperliquid cDeposit: spot→staking (wei = float * 1e8).
- `place-hyperliquid-perps-order` (write): Places a perps order on Hyperliquid (long/short) via Exchange API; limit or IOC-style market using mid ±1% guardrails. One call can also set the leverage (leverage, isCross) and attach a take-profit and stop-loss to the entry (takeProfitPx, stopLossPx; grouping normalTpsl).
- `place-hyperliquid-tp-sl` (write): Places a Hyperliquid perps take-profit or stop-loss trigger (Exchange t.trigger).
- `register-hyperliquid-referrer` (write): Registers the configured Hyperliquid referral code for the signing wallet.
- `set-hyperliquid-referrer` (write): Sets the configured Hyperliquid referral code for the signing user.
- `transfer-hyperliquid-spot-to-perps` (write): Move Hyperliquid Spot USDC into Perps margin via usdClassTransfer (toPerp) on the managed agent execution wallet.
- `update-hyperliquid-isolated-margin` (write): Add margin to, or remove it from, one open isolated Hyperliquid position (Exchange updateIsolatedMargin). Changes no size; adding moves the liquidation price away. A cross position is refused (its margin is the account balance).
- `update-hyperliquid-leverage` (write): Sets per-coin leverage on Hyperliquid via Exchange updateLeverage (cross by default).
- `withdraw-hyperliquid-cctp-to-base` (write): Withdraw Hyperliquid perps margin to native USDC on Base with Circle CCTP (sendToEvmWithData, auto-forwarded). Fee read from CoreDepositWallet (0.2 USDC at launch). confirmFullExit cancels and closes reduce-only first.
- `withdraw-hyperliquid-to-arbitrum` (write): Withdraw Hyperliquid perps margin to Arbitrum via withdraw3.
- `get-hyperliquid-all-mids` (read): Fetches Hyperliquid mid prices for all coins.
- `get-hyperliquid-builder-fee-status` (read): Checks whether the user main wallet approved enough Hyperliquid builder fee for Thirdfy builder monetization.
- `get-hyperliquid-candles` (read): Fetches Hyperliquid candle snapshots for a coin, interval, and time range.
- `get-hyperliquid-cctp-withdraw-status` (read): Read-only: whether a withdraw_hyperliquid_cctp_to_base withdrawal landed as USDC on Base.
- `get-hyperliquid-funding-status` (read): Reads Hyperliquid funding status for the managed agent execution wallet.
- `get-hyperliquid-l2-book` (read): Fetches Hyperliquid L2 order book depth for a perps coin.
- `get-hyperliquid-onboarding-plan` (read): Plans Hyperliquid onboarding for the managed agent execution wallet.
- `get-hyperliquid-open-orders` (read): Fetches a user's Hyperliquid open orders directly.
- `get-hyperliquid-perps-meta` (read): Fetches Hyperliquid perps universe metadata: list of tradeable assets (coins), indices, and specs.
- `get-hyperliquid-referral-status` (read): Fetches Hyperliquid referral status, referred-by data, and builder rewards for a user.
- `get-hyperliquid-setup-status` (read): Checks Hyperliquid setup readiness for a managed agent execution wallet (or explicit BYOW main).
- `get-hyperliquid-user-state` (read): Fetches a user's Hyperliquid perps state: open positions and margin summary (account value, withdrawable).
- `prepare-hyperliquid-onboarding` (read): Dry-runs the guided Hyperliquid setup sequence for a managed agent execution wallet.
- `quote-hyperliquid-cctp-deposit` (read): Quote a Circle CCTP burn from a source chain into Hyperliquid HyperCore perps.
- `search-hyperliquid-markets` (read): Searches Hyperliquid perps markets by joining universe metadata with live mid prices.
