How to automate Hyperliquid trading without code

By the Whenly team · · 8 min read

Short answer

There are three ways to automate trading on Hyperliquid. Trigger orders (stop loss, take profit, trailing stop, TWAP) rest on the exchange and handle one exit or entry on one market. A bot you write against Hyperliquid's API can do anything, but needs code, a server and monitoring. No-code rules sit in between: "when something happens, if conditions hold, then act", run around the clock by a service such as Whenly through an API wallet that can trade but can't withdraw.

Hyperliquid runs around the clock, and so do its liquidations, funding payments and the whales whose trades move it. Most traders sleep. Automation closes that gap: something on the exchange or on a server acts for you when a condition you chose comes true. This guide compares the three ways to do that on Hyperliquid and walks through setting up a rule without writing code.

What can you automate on Hyperliquid?

Almost everything a trader does by hand, in three groups:

  • Exits: stop losses, take profits, closing everything after a bad day, cutting a position before it is liquidated. See stop loss and take profit on Hyperliquid.
  • Entries: buying a dip, opening when funding flips, copying a wallet you follow (see copy trading on Hyperliquid).
  • Upkeep: adding margin to an isolated position, cancelling stale orders, trimming stock perps before the US market opens, getting an alert on Telegram.

Option 1: Hyperliquid's own trigger orders

Hyperliquid has several order types that wait on the exchange and act on their own: stop market and stop limit, take profit market and limit, trailing stops that follow the best price by a set distance, scale orders that spread limit orders over a range, and TWAP orders that split a large order into suborders every 30 seconds (see Hyperliquid's order types). They are free to use beyond normal trading fees, and because they rest on the exchange they work with your computer off.

Their limit is scope. Each one watches the mark price of one market and does one thing to one position. A trigger order can't react to your account's total loss for the day, to another wallet's trade, to funding, to the time of day, or to how close a position is to liquidation, and it can't add margin.

Option 2: a Hyperliquid trading bot on the API

Hyperliquid's API is open, and an API wallet (an "agent") approved by your main wallet can place and cancel orders for it without being able to withdraw. That makes a self-written bot reasonably safe to give access to, and the API lets it do anything the app can.

The cost is everything around the code: a server that never sleeps, a place to keep the agent's key, retries when a request times out and the order may or may not exist, rate limits, partial fills, and monitoring that tells you when the bot itself has stopped. For one specific strategy that is worth it. For "close everything if I'm down 5% today" it is a lot of engineering.

Option 3: no-code rules

A rule is the middle ground: you describe the automation in a sentence built from blocks, and a service runs it for you. On Whenly every rule has the same shape.

Every rule reads as one sentence: a trigger (When), optional conditions (If) and the actions to take (Then).

When can be a price level or a move, a position's PnL, the account's daily PnL, the distance to liquidation, funding, a market session such as the NYSE open, a time of day, or a wallet you watch opening or closing a position. If narrows it: whether you hold the coin, which assets are allowed, how many positions the rule may keep open. Then opens, reduces or closes positions, places or cancels orders, sets stop loss and take profit, adds or removes margin, or notifies you in the app and on Telegram. The full list is in the Automated rules docs.

Trigger orders, bots and rules compared

Trigger ordersYour own botNo-code rules
SetupA few clicks per orderCode, a server, monitoringPick a template or build from blocks
Reacts toMark price of one marketAnything the API exposesPrice, PnL, daily PnL, liquidation distance, funding, time, sessions, other wallets
Runs with your computer offYes, on the exchangeOnly if you host itYes, on the service's servers
Can withdraw your fundsNoNo, if it uses an API walletNo, it uses an API wallet
Extra costNoneHosting and your timeThe service's fee, if any

Five rules most traders start with

Whenly's templates cover the situations that cost traders the most when nobody is watching. Each is an ordinary rule you can edit before saving.

TemplateWhenThen
Liquidation Guarda position gets within 15% of liquidationadd up to $200 of margin, then cut it by 30% if it's still too close
Daily Loss Limitmy account is down 5% on the daycancel my orders and close every position
Whale Exita wallet I watch cuts a position I also hold by 30% or moreclose mine
Follow Tradera trader I follow opens or adds $1M or moreopen the same side with 2% of my account, a 5% stop loss and a 10% take profit
Weekend Gap Guarda US stock moved more than 4% while Wall Street was closedhalve that position 30 minutes before the open
Whenly Rules page with the template gallery: Blank rule, Liquidation Guard, Daily Loss Limit, Whale Exit, Follow Trader and Weekend Gap Guard
The Rules page: start from a blank rule or one of the templates.

The protective ones (Liquidation Guard, Daily Loss Limit, Weekend Gap Guard) only reduce risk you already have. Follow Trader opens trades, so it gets the most caution; our copy trading guide explains how to choose a wallet for it. Liquidation Guard's numbers make more sense once you know how Hyperliquid computes a liquidation price.

How to set up your first rule

  1. Open the terminal, connect your wallet and deposit USDC (see Deposits & withdrawals).
  2. Go to Rules and pick a template, or Blank rule to build your own.
  3. Adjust the numbers: sizes, percentages, the wallet to watch. The sentence above the blocks updates as you edit.
  4. Choose Simulate or Live. New rules start in Live; switch to Simulate before saving to see what the rule would do without placing orders. Check now shows what it would do with the data at that moment.
  5. The first time, click Enable Rules: your wallet signs an approval for a separate Rules agent, an API wallet that can trade but can't withdraw.
  6. In Rules Settings, set limits for the size of one position, the total open across rules and actions per hour.

How safe is automated trading?

Safe for your funds' custody, not safe from bad trades. The Rules agent can place and cancel orders and manage margin, but Hyperliquid doesn't let an API wallet withdraw or transfer, and Whenly stores its key encrypted so only the Rules engine can use it. You can switch one rule off, Pause all, or revoke the agent, which deletes its key.

A rule acts unattended on data that can be late. It can fire at a price you didn't expect, more than once, or not at all. Start in Simulate, keep sizes small and keep watching your account. Section 3A of the Terms and the Risk Disclosure cover this in full.

What it costs

Hyperliquid's maker and taker fees apply to every fill. Orders placed by Whenly rules also carry a builder fee of 0.05% of the filled notional (manual orders: 0.025%), the maximum you approve once. Every fee is listed on the Fees page.

Funding is the other running cost of any automated position held for hours or days; see Hyperliquid funding rates explained.

Frequently asked questions

Can I automate trading on Hyperliquid without coding?

Yes. Hyperliquid's own trigger orders (stop loss, take profit, trailing stop and TWAP) need no code, and rule services such as Whenly let you build automations from blocks, like "when my account is down 5% on the day, cancel my orders and close every position", which run on a server even when your browser is closed.

Is it safe to give a bot or a rule service access to my Hyperliquid account?

Automations trade through a Hyperliquid API wallet (an agent) that your main wallet approves. An API wallet can place and cancel orders but can't withdraw or transfer funds, so the worst case is bad trades, not stolen funds. You can remove an API wallet at any time on Hyperliquid's API page.

Do automated rules work when my computer is off?

Rules that run on a server do. Whenly's Rules engine checks every rule around the clock on its own servers. Hyperliquid's trigger orders also keep working, because they rest on the exchange. A script on your own laptop stops when the laptop sleeps.

What does automation cost on Hyperliquid?

Hyperliquid charges its normal maker and taker fees on every fill. Interfaces may add a builder fee on top: Whenly's is listed on its Fees page, and rule orders may carry a higher one than manual orders, up to the maximum you approve once.

This article explains how things work; it is not investment advice. Perpetual futures carry a high risk of loss. Read the Risk Disclosure.