Hyperliquid Trading Bot Guide: APIs, Automation and Risks
A Hyperliquid trading bot can watch markets and manage orders around the clock. The difficult part is not sending the first order; it is controlling keys, stale data, partial fills, retries, fees and failures after the bot is live.

Direct answer
Can you use a trading bot on Hyperliquid?
Yes. A Hyperliquid trading bot can read market and account data through REST or WebSocket, then place and cancel signed orders through the exchange API. Hyperliquid provides a public API and an official Python SDK, but the user still owns the strategy, hosting, key security, monitoring and losses. Start with read-only data, move to testnet, and use a dedicated API wallet rather than placing the master wallet key inside the bot.
Updated 2 Nov 2026
On this page
- What a Hyperliquid trading bot actually does
- Pick the job before the technology
- The API is not the strategy
- One order can have more than one ending
- An API wallet is safer, but not harmless
- Fee math can erase a small edge
- Rate limits shape the design
- A bot should fail closed
- Build it or connect a third-party bot?
- A staged rollout is less exciting and far safer
- When automation is the wrong tool
- The standard to meet before funding it
The attractive story about a trading bot is that it never sleeps. The less exciting truth is that it also never becomes cautious unless someone programmed caution into it. A bot can repeat a sound rule with discipline, or repeat a bad order hundreds of times before a person notices.
On Hyperliquid, sending an order is only one part of the job. A useful system must know whether its data is fresh, whether the account already has exposure, whether an earlier order partly filled and whether a retry would create a duplicate. This guide is about that operating system around the strategy. The Hyperliquid API guide covers endpoint syntax and code examples in more depth.
What a Hyperliquid trading bot actually does
A bot is software that observes a set of inputs, applies rules and takes an action. It does not need artificial intelligence. A ten-line alert script and a market maker are both forms of automation, but they carry very different account and engineering risks.
| Type | What it automates | Main risk |
|---|---|---|
| Monitor or alert | Prices, funding, positions or margin warnings | Bad data creates a false signal, but no order is sent |
| Assisted execution | Calculates size or prepares an order for human approval | The operator may approve stale assumptions |
| Rule-based bot | Enters and exits when defined conditions are met | Rules can behave badly outside the tested market regime |
| Execution algorithm | Splits or schedules a known order | Partial fills and chasing can change the intended position |
| Market maker | Maintains bids and asks while managing inventory | Fast adverse selection, inventory drift and cancel failures |
Start with the smallest level that solves the real problem. Someone who trades twice a week may need an alert and a prepared order, not a 24-hour execution service holding a live signing key. More automation is useful only when its speed and consistency are worth the extra failure paths.
Pick the job before the technology
Many bot projects begin with a programming language or indicator. A better starting point is a sentence that describes the job and its boundary: “Reduce a BTC position by $20,000 over one hour without paying more than a defined price,” or “Alert me when funding and open interest cross these limits, but never place a trade.” That sentence tells you what data, permissions and recovery logic the system needs.
| Objective | Reasonable first design | What to avoid |
|---|---|---|
| Receive a price or margin warning | Read-only monitor | Giving the service a trading key |
| Trade a fixed amount over time | Execution algorithm with a hard total-size cap | A strategy that can keep adding indefinitely |
| Run a simple entry and exit rule | One market, one subaccount and small limits | Launching across every market at once |
| Quote both sides of a book | Inventory limits, cancel backstop and live reconciliation | Assuming every cancel succeeded |
| Copy another account | A capped sizing rule with independent exits | Treating the source wallet as guaranteed skill |
The API is not the strategy
Hyperliquid exposes the pieces needed for automation: public market and account queries, real-time WebSocket feeds, and signed exchange actions. A production bot still needs several layers around those endpoints. Leaving out one layer often works in a calm test and fails during the first disconnect or fast market.
| Layer | Question it must answer | Example control |
|---|---|---|
| Market state | Is the price and book current? | Stop decisions when the feed is older than a set threshold |
| Signal | Why should the account trade? | A deterministic rule with recorded inputs |
| Risk | How much exposure is allowed? | Position, leverage, drawdown and daily-loss caps |
| Execution | How should the order reach the book? | Limit price, time-in-force and maximum slippage rules |
| Reconciliation | What actually filled or remains open? | Compare local state with order and fill updates |
| Operations | Can a human understand and stop it? | Alerts, audit logs, health checks and key revocation |
One order can have more than one ending
A submitted request is not the same as a completed trade. An order may rest, fill immediately, fill in pieces, be rejected, be cancelled or disappear because the market was delisted or the account was liquidated. Hyperliquid publishes order updates, user fills and order-status queries so an automated process can reconcile those outcomes.
The event loop a bot should complete
Read current account and market state
Establish the position, available collateral, open orders, current metadata and a fresh market view before deciding anything.
Create an order intent
Record the market, side, target size, maximum price or slippage, reason and the risk limits used for the decision.
Assign a client order ID
A unique cloid helps the process ask what happened to the intended order after a timeout or restart.
Submit once and parse every result
Treat resting, filled and error responses differently. Batched requests may return one error for the whole batch or an item-level result for each order.
Reconcile fills and remaining exposure
Update the position from confirmed fills, not from the requested size. Decide whether a partial remainder should rest, be replaced or be cancelled.
Verify the account again
Use account and order state to confirm the result. If local and server state disagree, stop new risk until the difference is resolved.
Blind retry logic is dangerous here. A network timeout means the client did not receive a clear answer; it does not prove that Hyperliquid rejected the first request. Query by client order ID or reconcile order and fill state before sending another order that could double the position.
An API wallet is safer, but not harmless
Hyperliquid calls its delegated signers API wallets or agent wallets. A master account approves one, and the agent can sign supported actions for the master account or its subaccounts without placing the master private key inside the trading process. The agent address is only the signer; account queries should still use the actual master or subaccount address.
This separation limits exposure of the master key, but a compromised agent can still place harmful trades within its authority. Store the secret outside the repository, browser bundle and logs. Use a different API wallet for each parallel process or subaccount because nonces are tracked by signer. Hyperliquid also warns against reusing a deregistered agent address after its nonce state is pruned; create a fresh one instead.
- Keep the bot on a dedicated subaccount with only the collateral it needs.
- Use separate development, testnet and mainnet secrets.
- Block secrets from source control, analytics, error reports and screenshots.
- Make revoking the API wallet possible without depending on the bot server.
- Do not treat a third-party request for a seed phrase or master private key as normal bot setup.
Fee math can erase a small edge
A strategy can be directionally right and still lose after turnover. Hyperliquid's published entry-tier perpetual rates were 0.045% for taker fills and 0.015% for maker fills when checked on 2 November 2026. Account volume, HYPE staking, referrals, maker share and HIP-3 settings can change the effective rate, but the base schedule is a useful stress test.
| Execution pattern | Calculation | Trading fees |
|---|---|---|
| Taker entry and exit | $5,000 × 40 fills × 0.045% | $90 |
| Maker entry and exit | $5,000 × 40 fills × 0.015% | $30 |
| Maker entry, taker exit | $5,000 × 20 × 0.015% + $5,000 × 20 × 0.045% | $60 |
The same figures imply a fee-only hurdle of 0.09% per taker round trip, 0.03% per maker round trip or 0.06% for a maker entry and taker exit. Slippage, spread, funding and adverse selection sit on top. A post-only order can reduce the fee rate but may never fill; it does not turn maker execution into free certainty.
Before trusting a backtest, deduct realistic fees on every fill and model worse execution during volatile periods. The fees guide and fee calculator explain the account-level schedule, but a bot also needs its own realized-cost report.
Rate limits shape the design
Hyperliquid's documented REST allowance is 1,200 weighted units per minute per IP, not 1,200 identical calls. WebSocket use has separate limits, including connection, subscription, message and inflight-post caps. Trading actions also face an address-based allowance tied partly to cumulative volume, with an initial request buffer.
A sensible bot streams changing data, caches slow metadata and batches compatible actions instead of polling every value before every decision. It measures request weights and address capacity, then backs off after a limit response. During congestion, repeatedly sending cancels whose outcomes are already known wastes capacity and can make risk control less reliable.
A bot should fail closed
Failing closed means the process stops adding risk when it cannot prove that its inputs and account state are trustworthy. It may continue a narrowly defined risk-reduction action, but it should not invent certainty from missing data.
| Failure | Unsafe response | Safer response |
|---|---|---|
| WebSocket disconnects | Trade from the last cached book | Pause decisions, reconnect and rebuild state |
| Order request times out | Send the same trade again | Query the cloid and reconcile fills first |
| Order partly fills | Assume the full target was reached | Recalculate remaining size from confirmed fills |
| Process restarts | Begin with an empty local state | Load positions and open orders before enabling execution |
| Nonce collision | Retry from several workers | Use one atomic nonce source or separate API wallets |
| Daily loss limit is reached | Keep trading to recover | Cancel entries and lock new risk until human review |
| Human loses dashboard access | Leave orders unmanaged | Use an independent revocation and cancel path |
Hyperliquid's exchange API includes schedule cancel, often called a dead man's switch. It can schedule a future cancel-all, and omitting the time removes the schedule. The documented deadline must be at least five seconds ahead, and the trigger can fire no more than ten times per day before the counter resets at 00:00 UTC. Treat it as a backstop, not a substitute for normal order tracking and shutdown logic.
Build it or connect a third-party bot?
| Approach | Advantage | Trade-off |
|---|---|---|
| Build your own | Full control over rules, keys and logs | You own every bug, server and incident |
| Third-party platform | Faster setup and a ready interface | You depend on its security, uptime and order logic |
| Semi-automated tools | Human approval remains in the loop | Slower and still vulnerable to stale inputs |
A polished dashboard is not evidence that a third-party bot is safe or profitable. Before connecting one, identify the legal operator, the exact key it requests, where that key is stored, whether it uses a separate subaccount, what additional fees or builder codes apply, and how to revoke access. Ask what happens during a disconnect, a partial fill and a service shutdown. If those answers are vague, the convenience is not worth the account access.
A staged rollout is less exciting and far safer
Move from an idea to controlled automation
Run the logic without a signer
Record signals, intended orders and expected positions from public data. Check whether the rule behaves sensibly through quiet and volatile periods.
Exercise the full lifecycle on testnet
Test placements, rejects, partial fills, cancels, restarts, lost connections and the emergency stop—not only the happy path.
Use shadow mode on live data
Let the process make decisions without sending orders. Compare its assumed fills with executable prices and measure latency and missed events.
Start one small mainnet process
Use a dedicated API wallet and subaccount, one or two liquid markets, low size and limits that are smaller than your manual trading limits.
Expand only from observed evidence
Increase markets, size or autonomy after reviewing real fills, costs, downtime and interventions. Change one important variable at a time.
The testnet guide explains the faucet and testing environment. Testnet cannot reproduce mainnet liquidity or guarantee profitability, but it is still the right place to discover whether the bot can cancel its own orders and recover from its own failures.
When automation is the wrong tool
Do not automate a strategy that cannot be written as clear rules, sized from a defined loss limit or evaluated after costs. A bot is also a poor shortcut for someone who does not yet understand leverage, funding, liquidation and order types. It removes the pause between decisions; it does not remove the consequences.
Manual trading may be more rational when signals are rare, position sizes are small and judgment depends on information that cannot be represented reliably in code. An alert can still reduce screen time without granting continuous authority to trade.
The standard to meet before funding it
A credible bot can explain why it wants a trade, how much it may lose, what order it sent, what actually filled and what it will do if the next message never arrives. It can stop without the strategy's permission, and a person can stop it without the bot's cooperation.
That standard is deliberately higher than “the test order worked.” Hyperliquid makes automated execution accessible, but accessibility is not reliability. Build the failure controls first, measure real costs and give the system less capital and authority than it asks for.
Frequently asked questions
Can I run a trading bot on Hyperliquid?
Yes. Hyperliquid provides public market and account endpoints, WebSocket feeds and signed exchange actions. A bot can monitor markets, place orders and manage positions, subject to the platform's rate limits and the user's account risk controls.
Does Hyperliquid have an official trading bot?
Hyperliquid publishes the API and an official Python SDK used to build automation. A strategy, hosted bot service or ready-made interface should be evaluated separately; official API access does not make every third-party bot official, secure or profitable.
Does a Hyperliquid bot need my private key?
Signed trading actions require a signing key. A safer setup uses a dedicated approved API wallet rather than the master wallet key. Never provide a seed phrase or master private key to an unknown bot, and keep the bot on a limited subaccount where practical.
Can a Hyperliquid trading bot guarantee profit?
No. Automation can apply rules consistently, but it cannot remove market risk, fees, slippage, funding, liquidation, software defects or infrastructure failures. Claims of guaranteed or risk-free bot returns are not credible.
What language is best for a Hyperliquid trading bot?
Python is the clearest official starting point because Hyperliquid maintains a Python SDK with examples. Other languages can use the documented API or community libraries, but signing, precision, state handling and maintenance still need careful review.
Sources
- Hyperliquid documentation - API overview↗ external
- Hyperliquid documentation - Nonces and API wallets↗ external
- Hyperliquid documentation - Exchange endpoint and schedule cancel↗ external
- Hyperliquid documentation - WebSocket API↗ external
- Hyperliquid documentation - WebSocket subscriptions↗ external
- Hyperliquid documentation - Rate limits and user limits↗ external
- Hyperliquid documentation - Error responses↗ external
- Hyperliquid documentation - Signing↗ external
- Hyperliquid documentation - Fees↗ external
- Official Hyperliquid Python SDK↗ external