How TheHyperBot Works
A complete guide to the DCA grid strategy, per-order take-profit cycling, cross-margin mechanics, and how to read your P&L on Hyperliquid.
Overview
TheHyperBot places a grid of limit buy orders below the current BTC price on Hyperliquid, a decentralized perpetual futures exchange. When price dips into the grid, orders fill automatically. For each filled buy, the bot places a take-profit sell at +1% above the buy price. When that sell fills, the profit is banked and the buy is re-placed at the same price level.
This creates a continuous cycle: buy on dip → sell on bounce → repeat. In sideways or volatile markets, the bot captures many small profits automatically.
At 5x leverage, a 1% price move = 5% return on the margin used for that order. The bot does this on every individual order, not the whole position. Each order is its own profit center.
How the Grid Works
The bot calculates grid levels based on your configuration:
- Grid range: Defined as a percentage of BTC's all-time high (ATH). Default: 73% to 51% of ATH.
- Grid top: Capped at 0.5% below current spot price (so orders don't fill immediately as market buys).
- Number of orders: Evenly spaced within the range (default: 50 orders).
- Graduated sizing: Orders near the top get less margin ($10), orders near the bottom get more ($15). This means you buy more BTC at deeper discounts.
Every order is placed as a limit order (maker), which means the lowest possible fees on Hyperliquid.
Why graduated sizing?
Flat grids allocate equal margin to every level. This means you buy the same amount at $77K as at $64K. Graduated sizing flips this — you allocate more capital to lower prices where BTC is cheaper and has more recovery potential. This improves your average entry price and pushes the liquidation price further away.
Take-Profit Cycling
Each filled order goes through a cycle with four stages:
If BTC oscillates in a 2% range (e.g., $76,000 ↔ $77,500), the orders near that range will cycle multiple times per day. Each cycle captures +1% (5% on margin). This is where the bot shines — making money from volatility even without a clear trend.
"Loss" Orders Are Just Accounting
This is the most important concept to understand. When you look at your P&L on Hyperliquid after the bot closes a position, you might see some orders showing a negative P&L. This can be alarming, but it is purely an accounting artifact — not a real loss.
Why this happens
Hyperliquid merges all your fills into a single position with a weighted average entry price. When the bot closes individual orders at their TP price, Hyperliquid calculates the P&L against the average entry — not the entry price of that specific order.
Hyperliquid does not track per-order P&L. It only tracks one position per asset with one weighted-average entry price. TheHyperBot tracks each order individually in software and ensures each one is closed at a profit.
Worked Example
Let's walk through a concrete scenario with 3 orders:
| Order | Buy Price | Size | TP Sell Price (+1%) |
|---|---|---|---|
| #1 | $77,000 | 0.001 BTC | $77,770 |
| #2 | $76,000 | 0.001 BTC | $76,760 |
| #3 | $75,000 | 0.001 BTC | $75,750 |
Step 1: All three buys fill as price drops
BTC drops from $78K to $74K. All three orders fill. On Hyperliquid, your position is:
Step 2: Price bounces to $76,000 — Order #3 TP fills
Order #3's TP sell is at $75,750. It fills. The bot sells 0.001 BTC at $75,750.
Hyperliquid shows a $0.25 loss because it compares the sell price ($75,750) against the average entry ($76,000). But the bot bought that specific order at $75,000, so the real profit is $0.75.
Step 3: Price bounces to $77,000 — Order #2 TP fills
Step 4: Price hits $77,770 — Order #1 TP fills
Final Tally
| Hyperliquid Shows | Real Per-Order P&L | |
|---|---|---|
| Order #3 | -$0.25 | +$0.75 |
| Order #2 | +$0.26 | +$0.76 |
| Order #1 | +$0.77 | +$0.77 |
| Total | +$0.78 | +$2.28 |
They do, once you account for the unrealized P&L that existed while the position was open. As orders closed, the remaining position's average entry shifted, and those unrealized gains/losses transferred into the subsequent closes. The total realized + unrealized P&L across all steps always equals the sum of real per-order profits. No money is lost or created — it's just allocated differently in the display.
Why Per-Order TP Always Wins
The bot guarantees that every single TP sell is placed above the specific buy price for that order. This means:
- Every completed cycle (buy + TP sell) results in a real profit.
- The bot never sells an order for less than it paid — regardless of what Hyperliquid's P&L display says.
- In lateral markets, the same price level can cycle dozens of times, each time capturing +1%.
The only scenario where you take a real loss is if the bot's safety mechanisms force-close the position (circuit breaker or regime gate exit). In those cases, the bot market-closes everything to protect against further downside — accepting a controlled loss rather than risking liquidation.
Cross-Margin Explained
TheHyperBot uses cross-margin mode on Hyperliquid. This means your entire account balance acts as collateral for your position — not just the margin allocated to each order.
Cross vs Isolated Margin
| Cross Margin | Isolated Margin | |
|---|---|---|
| Collateral | Entire account balance | Only the margin for that position |
| Liquidation price | Much further from entry | Close to entry |
| Risk | All funds at risk if liquidated | Only allocated margin at risk |
| Best for | Grid bots with many small orders | Single high-conviction trades |
Why cross margin for grid trading?
With 50 orders using only 40% of your portfolio, the remaining 60% sits as a reserve. In cross mode, this reserve acts as additional collateral. Example:
Cross margin makes grid strategies much safer by letting the reserve absorb drawdowns without risking individual order liquidation.
How Liquidation Works
Liquidation occurs when your account equity falls below the maintenance margin requirement. On Hyperliquid, this is approximately 1.25% of your total position notional for BTC (calculated as 1 / (2 * maxLeverage) where maxLeverage = 40).
The 1.25% maintenance margin is not a periodic charge. It is the minimum equity-to-notional ratio. If your account equity drops below this threshold, Hyperliquid's liquidation engine will close your position. Think of it as a minimum balance requirement, not a recurring cost.
Concrete example
You have a $15,000 portfolio and all 50 grid orders fill, creating $30,000 in notional exposure:
- Maintenance margin required: $30,000 * 1.25% = $375
- Your account equity: $15,000 minus unrealized losses
- Liquidation triggers when: Equity drops to $375
- That means BTC must drop to: ~$31,000 (roughly 55% below your average entry)
With the circuit breaker set at 55% below ATH, the bot will close your position well before liquidation could occur.
Safety Mechanisms
Circuit Breaker
If BTC drops below 55% of ATH (default setting), the bot immediately:
- Cancels all open buy and sell orders
- Market-closes the entire position
- Sends an alert (Telegram/email)
- Pauses for 1 hour before re-evaluating
This is a hard safety net. Even if the bot's normal logic fails, the circuit breaker prevents catastrophic loss. At 55% below ATH ($126K), that's $56,700 — still well above the cross-liquidation price.
Regime Gate
The bot only operates when BTC is below 75% of ATH. When BTC is near ATH, the grid strategy isn't ideal because:
- Funding rates are high at ATH (expensive to hold longs)
- Probability of a correction increases near ATH
- The grid range would be too narrow to be useful
When price crosses above the 75% gate, the bot gracefully closes positions and goes flat until conditions improve.
ATH Tracking
The bot maintains a rolling all-time high. When ATH increases by more than 0.1%, the grid is automatically recalculated and re-placed at new levels. This ensures the grid always references the latest market peak.
State Recovery
Bot state (open orders, pending TP sells, P&L) is saved atomically after every tick. If the bot restarts (crash, server reboot, update), it reconciles with on-chain data to detect any fills that happened while offline, then resumes normal operation.
Trading Fees
All orders are placed as limit orders (maker), which get the lowest fee tier on Hyperliquid:
| Order Type | Fee | Per $1,000 notional |
|---|---|---|
| Maker (limit) | 0.010%* | $0.10 |
| Taker (market) | 0.035%* | $0.35 |
*Base fees, subject to change. Fees are floating and may vary by tier. With the BOTARMY referral, you get an additional 4% discount on all fees. See Hyperliquid fee schedule.
Round-trip cost per cycle
Each TP cycle involves one buy (maker) and one sell (maker):
Performance Fee
TheHyperBot charges a 10% performance fee on realized profits only. No monthly subscriptions, no upfront costs.
- Fee is calculated per completed TP cycle:
profit * 10% - If a cycle results in a loss (e.g., circuit breaker close), no fee is charged
- Fees are tracked in real-time on your dashboard
- Settled monthly via USDC transfer
Example
| Scenario | Bot Profit | Fee (10%) | You Keep |
|---|---|---|---|
| 50 cycles, $0.37 each | $18.50 | $1.85 | $16.65 |
| 200 cycles in a month | $74.00 | $7.40 | $66.60 |
| Circuit breaker close | -$120.00 | $0 | -$120.00 |
We only make money when you make money. There's no incentive for us to keep you in losing positions or recommend aggressive settings. Our profit is directly tied to your success.
Referral Discount
All TheHyperBot users join Hyperliquid via our referral code BOTARMY. This is free and gives you a permanent 4% discount on all trading fees.
TheHyperBot (referee) receives 10% of referred users' trading fees from Hyperliquid. Referred users receive a 4% discount on all fees. This referral fee is paid by Hyperliquid, not by you — it does not increase your costs. See Hyperliquid Docs for details.
The referral discount applies to all your trades on Hyperliquid, not just those made by the bot. It's a permanent benefit with no expiration.
Trading perpetual futures involves substantial risk of loss. Leverage amplifies both gains and losses. Past performance does not guarantee future results. Only trade with capital you can afford to lose entirely. TheHyperBot is a tool — it does not eliminate market risk. The safety mechanisms (circuit breaker, regime gate) reduce but do not eliminate the possibility of significant losses. This does not constitute financial advice.