Running an AI trading bot on Hyperliquid

Educational only. Not investment advice. Crypto trading carries significant risk of loss.

Why Hyperliquid attracts bots

Short answer: Hyperliquid was designed with programmatic trading as a primary use case, not tolerated as a side effect of exposing an API. It runs as an on-chain perpetuals exchange with a full order book, and that order book is reachable directly through the API rather than sitting behind a retail-first interface that automation has to work around. That design decision alone explains most of why a Hyperliquid trading bot feels like a natural fit there, in a way it doesn't on venues where bots are merely tolerated.

Plenty of centralized exchanges treat algorithmic access as something to manage rather than embrace — acceptable-use clauses that hedge on bot activity, API tiers gated behind trading-volume thresholds, a general assumption that the web dashboard is the intended front door and everything else is a workaround. Hyperliquid inverts that assumption: a large share of its order flow already arrives programmatically, so a script placing and cancelling orders isn't an edge case the infrastructure grudgingly absorbs. Hyperliquid automation runs with the grain of the venue's own design, not against it — which makes the mechanics straightforward. It says nothing about whether any particular strategy running on it is a good idea.

Hyperliquid in one section

Hyperliquid is a decentralized perpetuals exchange: it runs its own purpose-built blockchain, and the order book itself settles on that chain rather than inside a company's private matching engine you're asked to trust. Custody of collateral sits with your own wallet the entire time, which is a different trust model from handing funds to an exchange operator's balance sheet.

"Perps" — perpetual futures — are derivative contracts that track an underlying asset's price with no expiry date, using periodic funding payments between long and short holders to keep the contract price anchored near spot. They let a strategy take a leveraged, directional position without ever holding the underlying token.

Leverage is exactly why perps demand more care than spot trading: it scales up both a winning move and a losing move, and past a certain point a losing position gets force-closed by the exchange before the account balance can go negative. None of that is specific to Hyperliquid — it's true of perpetual futures on any venue — but it belongs near the top of this article, because leverage is where most of the real risk in perps trading actually sits.

The non-custodial connection model

Connecting a bot to Hyperliquid doesn't require handing over the private key that controls your main wallet. The standard pattern is what Hyperliquid calls an agent wallet — a separate signing key you approve specifically for placing and cancelling orders on your behalf. That key can trade; it cannot withdraw collateral, transfer assets elsewhere, or take any action beyond the order-book operations you've explicitly authorized.

It's the same non-custodial boundary as a trade-scoped API key on a centralized exchange, just expressed as a wallet-level permission instead of an account-level scope. Your collateral never moves out of your own account; the agent key is a narrow, revocable delegation, not a transfer of custody. If a setup instead asks you to hand your funds over — deposit into a shared pool, or a wallet somebody else holds the keys to — you've left the agent-key model behind entirely and given up the very thing it exists to protect. Treat that request as a warning sign, not a variant worth trusting.

Being able to revoke that key matters just as much as the initial grant — a permission you can cut off instantly is worth far more than a grant nobody ever revisits, because a misbehaving strategy or a leaked credential needs a fast way to stop trading. Treat instant revocation as a baseline requirement for any Hyperliquid connection, not an afterthought.

What an LLM loop looks like on Hyperliquid

Swap the reasoning engine — Claude, Gemini, DeepSeek, MiniMax — and the mechanical loop behind a Hyperliquid bot barely changes; only the data feeding into it shifts with the venue. On Hyperliquid that typically means recent candles for the pair you're watching, the current funding rate and where it's trending, and open interest as a rough read on how crowded a position has become on either side of the book. Whatever else your own strategy weighs gets folded in alongside that.

That combined context becomes a prompt built from criteria you wrote yourself, not a template somebody else filled in for you, and what comes back is a decision with its reasoning attached — trade or stand aside, which direction, how large, and where the take-profit and stop-loss levels sit — not a block of prose the execution layer has to interpret.

That decision doesn't go straight from the model to Hyperliquid. It passes through a gate first: position size, leverage, and how many positions are already open all get compared against numbers you configured ahead of time, and that comparison runs the same way whether the model sounded certain or hedged its answer. A proposed trade that doesn't fit gets trimmed or turned away; only a trade that fits becomes a live order. The model can reason as well as it wants — the gate is what actually decides what gets to trade.

Things that bite on perps

Funding drains slow trades. Funding payments change hands between longs and shorts on a recurring schedule, and a strategy that tends to hold positions open for a while feels that recurring cost — or, less reliably, that recurring income — in a way a quick in-and-out trade never does. A setup that looks solid on price action alone can turn marginal once funding gets netted in, so it's worth modeling explicitly rather than treating as background noise.

Liquidation math doesn't negotiate. The higher the leverage on a position, the closer its liquidation level sits to the entry price — a move that would just be an uncomfortable drawdown at low leverage becomes a total loss of the margin behind it at high leverage. That's arithmetic, not a probability question, and it's worth internalizing before picking a leverage setting.

Thin books punish long-tail pairs. The major pairs on Hyperliquid trade against a deep order book; pairs further down the listing carry thinner liquidity, wider effective spreads, and a real chance that an order moves the price against you more than a backtest ever assumed. A strategy tuned on a liquid pair doesn't automatically carry over to an illiquid pair.

That's why a hard leverage cap does more work than almost any other limit you can set. It directly controls how much room a normal, expected price swing has before it turns into a liquidation instead of a manageable loss — set it before going live, not after a position gets uncomfortably close to being force-closed.

Hyperliquid on KAI

KAI supports Hyperliquid as a perps venue alongside centralized exchanges, and the agent-key boundary works exactly the same way here: KAI holds a trade-scoped key — withdrawals switched off — while your collateral never leaves your own account, and the strategy running against that connection is written by you — the setups you look for, the risk you're willing to run — rather than shipped as a default preset dressed up as a proven setup.

Paper mode runs first no matter which venue you eventually connect, Hyperliquid included — you get to see how the model's decisions play out against live prices before any of them touch an actual position. Manual approval stays the default once you do go live, and the full audit trail — the reasoning behind every entry, exit, and skip — sits at /stats. It's a record of decisions already made, not a preview of how a Hyperliquid bot performs from here.

FAQ

Does Hyperliquid allow trading bots?

Yes — it is API-first by design and most of its volume is programmatic. Standard rate limits apply; nothing about running your own strategy violates the rules.

Is a Hyperliquid bot non-custodial?

It can and should be: the agent-key model signs orders without withdrawal rights, so funds never leave your control. Avoid any setup that asks you to deposit into someone else's wallet.

Can I lose more than my margin on Hyperliquid perps?

Positions are liquidated before your account goes negative, but liquidation means losing the margin behind the position. Leverage decides how fast you get there — cap it.

Not investment advice. Crypto trading carries significant risk of loss. Past signal performance does not guarantee future results.

Run a Hyperliquid strategy on your terms — agent key trade-only, leverage capped by you.

Request early access