[ guide ]
Hyperliquid Trading Bot: Non-Custodial Agent Execution
Last updated: November 2026 · 6 min read
A Hyperliquid bot needs two things: a wallet that can trade and a boundary that stops it from doing anything else. approveAgent provides the first; the Agent API policy provides the second.
Why Hyperliquid for an agent
Hyperliquid is a Layer 1 for perpetual futures with an on-chain order book and deep liquidity. For an agent, the important primitive is the agent wallet: the account owner can approve a separate wallet with trading rights only, via EIP-712 approveAgent.
That means the trading bot does not need the owner's key. It can place and cancel orders, and it cannot withdraw. The funded trading budget is the maximum the agent can lose through trading.
The trading-only wallet
approveAgent separates trading from withdrawal at the wallet boundary. A prompt injection, a bug or a loop can still trade badly, but it cannot move the budget out. The owner can revoke the wallet at any time.
Protocol Bank adds a second boundary in front of the wallet: the key policy. The agent's API key carries the allowed operations, per-call cap, daily cap and coin allowlist; a violation is refused before the order reaches Hyperliquid.
Build flow
Create the key and keep the read-only policy until the integration is ready. Test in the sandbox with real market data. When the strategy behaves, the owner approves the agent wallet with trading-only rights; the same endpoints go live.
- GET /api/v1/agent/state for account, positions, activity and policy.
- POST /api/v1/agent/orders with coin, side, sizeUsd and a reason.
- The platform risk envelope applies position sizing, stop-loss/take-profit and daily breakers.
- An uncertain submission is reported as 409 and reconciled by client-order-id; it is never blindly retried.
Failure modes to plan for
A venue outage affects trading, not the owner's withdrawal ability. A model error is bounded by the key cap and the risk envelope. An uncertain order is an ops problem: surface it to the owner, do not retry it. A strategy that loses is still a strategy problem; the control layer does not make it profitable.
[ build with it ]
One API key per agent, server-enforced caps, a trading-only wallet and audit receipts. The cockpit is a demo; the Agent API is the product.
For agents: /llms.txt · /.well-known/agent.json · /api/agent.openapi.json
FAQ
Does a Hyperliquid agent wallet need the owner's private key?
No. The owner approves a separate agent wallet with trading-only permissions (approveAgent). The bot uses that wallet; withdrawals still require the owner.
Can a Hyperliquid bot withdraw funds?
Not a trading-only agent wallet. It can place and cancel orders; it cannot withdraw. The owner can revoke it at any time.
How do I build a Hyperliquid bot with Protocol Bank?
Create an API key and policy, test in the sandbox, approve the trading-only Hyperliquid wallet, then call the same Agent API endpoints live. The SDK, MCP server and OpenAPI contract are available for integration.
Educational content, not financial advice. Read the Risk Disclosure before enabling live mode.

