# Hyperliquid trading bot: code, no code and backtests

Source: https://app.hypr.markets/blog/hyperliquid-trading-bot-no-code

[Trading](/blog/category/trading)·8 min read

# How to build a Hyperliquid trading bot, with or without code

Ways to run a Hyperliquid trading bot: the Python SDK, API wallets, open-source tools and no-code builders, plus how to backtest a crypto strategy honestly.

[Dylan Shilts](/authors/dylan-shilts), Founder of Hypr Markets

Published Nov 24, 2026

A Hyperliquid trading bot is a program that places and manages orders on Hyperliquid by itself, following rules you set. You can write one with Hyperliquid's official Python SDK, run an open-source bot framework that already connects to the exchange, or use a no-code crypto trading bot builder where rules are blocks instead of code.

This guide is for traders deciding which route to take. It covers how bots connect to Hyperliquid safely, how to backtest a crypto strategy without fooling yourself, why paper trading comes before real money, and the risks that stay with you whichever route you choose. A bot follows rules faster than a person can. It does not make the rules any better, and nothing here promises that a bot will make money.

Key takeaways

- Run every bot through an API wallet, never your main key. API wallets can trade but cannot withdraw.
- A backtest without fees, funding and slippage is a fiction. On Hyperliquid, costs can take most of a small per-trade edge.
- The more settings you try, the more likely your best backtest is overfit. Use a walk-forward check and look for stable ranges, not one perfect value.
- Paper trade on live data before risking money, then start small with a loss limit you set in advance.
- Hyperliquid's API serves only the most recent 5,000 candles per market, so long backtests need data you record or buy elsewhere.

## Ways to run a Hyperliquid trading bot#

### Write your own with the official SDK#

Hyperliquid maintains an official [Python SDK](https://github.com/hyperliquid-dex/hyperliquid-python-sdk) and lists community SDKs for Rust and TypeScript, plus a CCXT integration, on its [HyperCore tools page](https://hyperliquid.gitbook.io/hyperliquid-docs/builder-tools/hypercore-tools). The SDK handles request signing, which Hyperliquid's [signing docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/signing) recommend over building signatures by hand. Writing your own gives full control, and full responsibility for every bug.

### Use an API wallet, never your main key#

A bot should sign with an API wallet (also called an agent wallet), a separate key your main account approves to trade on its behalf. The SDK's setup uses your main wallet's address as the account and the API wallet's private key as the signer. Node provider Chainstack's [API reference](https://docs.chainstack.com/reference/hyperliquid-exchange-approve-agent) states that agents "can place and cancel orders but cannot withdraw funds".

Hyperliquid's page on [nonces and API wallets](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/nonces-and-api-wallets) adds practical rules: use one API wallet per trading process, because nonces are tracked per signer, and do not reuse an API wallet's address after it is deregistered, because previously signed actions could be replayed. Per the [exchange endpoint docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint), an account can have one unnamed and up to three named API wallets, and an approval can expire at most 180 days ahead.

### Use an open-source bot framework#

- **Hummingbot** lists a [Hyperliquid perpetual connector](https://hummingbot.org/exchanges/hyperliquid/), with testnet support, for use with its perpetual strategies and scripts.
- **Freqtrade** documents Hyperliquid in its [exchange notes](https://www.freqtrade.io/en/stable/exchanges/), including futures with isolated and cross margin. It recommends an API wallet rather than your main key, and warns that Hyperliquid offers only 5,000 historic candles, which limits backtests.

Frameworks save you writing the plumbing, but you still configure, host and watch them.

### Use a no-code bot builder#

A no-code builder lets you assemble rules ("enter when RSI crosses below 30, exit at 2% profit or a 1% stop") from blocks and run them without a server of your own. The trade-off is flexibility: you can only express what the blocks support.

| Route | Skills needed | Who runs it | Main risk |
| --- | --- | --- | --- |
| Your own code on the SDK | Programming, servers | You | Bugs, key handling |
| Open-source framework | Configuration, servers | You | Misconfiguration, unattended failures |
| No-code builder | Trading rules only | The builder's platform | Limits of the blocks, platform dependence |

## How to backtest a crypto strategy#

A backtest replays a strategy over past prices to see how it would have done. It is useful for one thing: rejecting bad ideas cheaply. It cannot prove a good one.

### Include every cost#

- **Fees.** Hyperliquid charges a fee on every fill, opening and closing, and a front end can add a builder fee. See [Hyperliquid fees explained](/blog/hyperliquid-fees-explained).
- **Funding.** Perp positions pay or receive funding every hour, and Hyperliquid's [funding docs](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/funding) cap it at 0.5% an hour. A strategy that holds for days needs it in the model. See [funding rates explained](/blog/funding-rates-explained).
- **Slippage.** Assume you fill worse than the candle's close, and worse still in thin markets or for large orders.

A hypothetical example of what costs do to a small edge:

| Per round trip (example) | Value |
| --- | --- |
| Average gross gain per trade | 0.30% |
| Hyperliquid taker fee, open and close (0.045% each) | 0.09% |
| Builder fee, open and close (0.05% each) | 0.10% |
| Slippage, open and close (0.05% each) | 0.10% |
| Net gain per trade | 0.01% |

A strategy that looked good before costs barely breaks even after them.

### Use enough data, and know where it comes from#

Hyperliquid's [info endpoint](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint) makes only the most recent 5,000 candles available for a market. At 1-hour candles that is under seven months. Hyperliquid's [historical data](https://hyperliquid.gitbook.io/hyperliquid-docs/historical-data) archive holds order book snapshots and asset contexts but no candles, and comes with no guarantee of timely updates. For longer tests, record data yourself or use a data provider, and test across calm and violent markets.

### Guard against overfitting#

Every setting you try is another chance to fit noise. Bailey, Borwein, López de Prado and Zhu showed in the [Notices of the AMS](https://www.ams.org/notices/201405/rnoti-p458.pdf) that the more configurations are tried, the higher the probability that the best backtest is overfit, and that a backtest which does not report how many configurations were tried cannot be judged. Three habits help:

1. **Sweep, then look for plateaus.** Run a parameter sweep and prefer a range of settings that all work over one sharp peak.
2. **Walk forward.** Fit settings on one window of history, test them on the next window the strategy has not seen, and roll forward. If results collapse out of sample, the strategy was fitted to the past.
3. **Count your trials.** Write down how many versions you tested, and be more skeptical the higher the number.

### Read more than the return#

Look at maximum drawdown, the number of trades, time in the market and a risk-adjusted measure such as the Sharpe ratio. A strategy with 12 trades in a year has not shown you much.

## Paper trade before going live#

A backtest cannot show latency, partial fills, rejected orders, rate limits or a server that restarts at the wrong moment. Paper trading runs the strategy on live prices without real orders, so you see how it behaves now rather than in the past. Hyperliquid also runs a testnet with a [faucet](https://hyperliquid.gitbook.io/hyperliquid-docs/onboarding/testnet-faucet) for testing real order flow without real money.

When you go live, start with a small allocation, decide in advance the loss at which you stop the bot, and compare live fills with the paper results for a few weeks.

## Risks of running a trading bot#

- **Losses.** A bot can lose money quickly and repeatedly, especially in a market unlike the one it was tested on.
- **Leverage and liquidation.** A leveraged position can lose all the margin behind it. The guide to [isolated vs cross margin](/blog/isolated-vs-cross-margin) explains how margin mode changes what is at risk.
- **Bugs and outages.** A wrong sign, a stuck loop or a dropped connection can place orders you never intended or leave a position without its stop.
- **Key security.** A leaked API wallet key cannot withdraw, but it can trade your account into the ground.
- **Promises.** Treat any bot sold with promised returns as a red flag.

## Strategy Studio: a no-code Hyperliquid trading bot builder#

Operators on Hypr Markets can give their clients Strategy Studio, a no-code bot builder inside their branded terminal. It is on Scale, the "Contact us" tier on the [pricing page](/pricing). Clients keep their own wallets, and Hyperliquid matches and settles every trade.

Clients drag blocks into five lanes: Enter, Exit, Protect, Size and Limits. Each block reads as a sentence with values the client can edit, like "RSI of 14 candles crosses below 30", and a preview reruns after every change.

- **66 blocks**, with perps signals built in: funding, open interest, premium and distance to liquidation.
- **14 starter templates**, each saying plainly when it works and when it struggles.
- **Backtests** with Sharpe, drawdown, fees and funding, plus a parameter sweep and a walk-forward check for overfitting.
- **Paper first.** Strategies run on paper and go live only when the operator allows it. The operator sets the minimum paper days before a strategy can go live.
- **A monitor** that answers "why did it trade?" for every decision.

The guardrails sit with the operator:

| Guardrail | What it does |
| --- | --- |
| Deploy checks | Stop a deploy that has no way out of a trade |
| Operator caps per trader | Limits on strategies, allocation, leverage and slippage |
| Per-strategy limits | Daily loss pause, drawdown stop and maximum orders an hour |
| Emergency stop | One stop for every strategy on the terminal |
| Trading key | Strategies trade through a key that cannot withdraw |

Also on Scale, **pairs and baskets** trade the z-score of the spread between two markets, with dollar-neutral or beta-neutral sizing, or baskets of 2 to 12 markets, with every leg sent in one exchange action and unwound if a leg does not fill. An **AI strategy builder**, which turns a plain-words idea into blocks on the board, is rolling out.

The [features page](/features) lists every module by plan.

## Frequently asked questions#

### Can I build a Hyperliquid trading bot without coding?#

Yes. No-code builders let you assemble entry, exit and risk rules from blocks. On Hypr Markets, Strategy Studio (Scale) offers 66 blocks in five lanes and 14 templates, with backtests and paper trading before any strategy goes live. Without a builder, open-source frameworks such as Freqtrade and Hummingbot need configuration but little or no code.

### Can a Hyperliquid trading bot withdraw my funds?#

Not if it runs through an API wallet. API wallets (agent wallets) can place and cancel orders but cannot withdraw funds. They can still lose money by trading, so set position limits and a loss limit for every bot.

### How do I backtest a crypto strategy?#

Replay the strategy over past prices with every cost included: trading fees on each fill, funding for perps and realistic slippage. Use a parameter sweep to find stable settings, check them with a walk-forward test on data the strategy has not seen, and paper trade before using real money.

### How much historical data does Hyperliquid provide for backtests?#

Hyperliquid's API makes the most recent 5,000 candles available per market. Its public archive holds order book snapshots and asset contexts but no candles. Longer histories need data you record yourself or get from a data provider.

### Do trading bots make money?#

Some do, many do not, and none can be relied on to. A bot executes rules consistently, but if the rules have no edge after costs, it loses consistently too. Test honestly, start small and never trade money you cannot afford to lose.

Share

Your terminal

## Launch a branded trading terminal on Hyperliquid

Your name, your domain, your markets and your trading fee. Clients trade from their own wallets. Try the editor before you sign in.

## Keep reading

- [Trading](/blog/category/trading)[3Commas alternatives for on-chain perps traders](/blog/3commas-alternatives)Honest 3Commas alternatives for traders moving to on-chain perps: Coinrule, WunderTrading, goodcryptoX, API bots, and where Strategy Studio fits.Nov 25, 2026·9 min read
- [Trading](/blog/category/trading)[Does Hyperliquid allow paper trading? Testnet and your options](/blog/hyperliquid-paper-trading)Hyperliquid has no paper trading mode on mainnet, but it runs a testnet with mock USDC. Here is how it works, its limits, and how to practice on paper.Nov 25, 2026·7 min read
- [Trading](/blog/category/trading)[How to connect TradingView to Hyperliquid, and what alerts can do](/blog/connect-tradingview-to-hyperliquid)What TradingView alerts can and cannot do with Hyperliquid today, the common webhook setups and their risks, and how to run the same rule in Strategy Studio.Nov 25, 2026·10 min read
