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.

Key Insight

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:

Current price ──────── $78,000 Grid top (0.5% below) ── $77,220 Order #1: 0.00041 BTC ($6.39 margin) $76,955 Order #2: 0.00042 BTC ($6.45 margin) $76,691 Order #3: 0.00042 BTC ($6.52 margin) ... (47 more orders, evenly spaced) $64,524 Order #49: 0.00074 BTC ($9.52 margin) Grid bottom ────────── $64,260 Order #50: 0.00075 BTC ($9.64 margin) Total margin used: $399 (40% of $998 portfolio) Reserve (untouched): $599 (60% — acts as liquidation buffer)

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:

1. BUY RESTING Limit buy sits on the order book, waiting for price to drop | v (price drops to order level) 2. BUY FILLED Order fills — bot immediately queues a TP sell | v (bot places limit sell at buy_price * 1.01) 3. TP SELL RESTING Take-profit sell sits on book at +1% above buy price | v (price recovers 1%) 4. TP SELL FILLED Profit banked! Bot re-places buy at original price level | v (cycle restarts from step 1) 1. BUY RESTING Same level, same size — ready to catch the next dip
Lateral Market Advantage

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.

Important

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:

OrderBuy PriceSizeTP Sell Price (+1%)
#1$77,0000.001 BTC$77,770
#2$76,0000.001 BTC$76,760
#3$75,0000.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:

Position: 0.003 BTC long Avg Entry: ($77,000 + $76,000 + $75,000) / 3 = $76,000

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.

What Hyperliquid shows: Closed 0.001 BTC at $75,750 | Entry (avg): $76,000 P&L = 0.001 * ($75,750 - $76,000) = -$0.25 ← "loss" What actually happened: Bought 0.001 at $75,000 → Sold at $75,750 Real P&L = 0.001 * ($75,750 - $75,000) = +$0.75 ← real profit

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

Remaining position: 0.002 BTC | Avg entry now: $76,500 (avg shifted up because the $75K order was removed) Hyperliquid shows: Closed 0.001 BTC at $76,760 | Entry (avg): $76,500 P&L = 0.001 * ($76,760 - $76,500) = +$0.26 Real P&L: Bought at $76,000 → Sold at $76,760 Real P&L = 0.001 * ($76,760 - $76,000) = +$0.76

Step 4: Price hits $77,770 — Order #1 TP fills

Remaining position: 0.001 BTC | Avg entry: $77,000 Hyperliquid shows: Closed 0.001 BTC at $77,770 | Entry (avg): $77,000 P&L = 0.001 * ($77,770 - $77,000) = +$0.77 Real P&L: Bought at $77,000 → Sold at $77,770 Real P&L = 0.001 * ($77,770 - $77,000) = +$0.77

Final Tally

Hyperliquid ShowsReal 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
Wait — the totals don't match?

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:

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 MarginIsolated Margin
CollateralEntire account balanceOnly the margin for that position
Liquidation priceMuch further from entryClose to entry
RiskAll funds at risk if liquidatedOnly allocated margin at risk
Best forGrid bots with many small ordersSingle 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:

Portfolio: $15,000 Allocation: 40% = $6,000 (margin for grid orders) Reserve: 60% = $9,000 (untouched buffer) If all 50 orders fill: Total notional: $6,000 * 5x = $30,000 Weighted avg entry: ~$70,000 Total collateral: $15,000 (full portfolio in cross mode) Cross liquidation price: ~$31,000 (BTC needs to drop 55%+ from entry) Isolated liq price: ~$56,000 (BTC only needs to drop 20%)

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).

Maintenance Margin is Not a Fee

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:

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:

  1. Cancels all open buy and sell orders
  2. Market-closes the entire position
  3. Sends an alert (Telegram/email)
  4. 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:

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 TypeFeePer $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):

Example order: 0.0005 BTC Buy fill at $76,000: Notional: 0.0005 * $76,000 = $38.00 Fee: $38.00 * 0.010% = $0.0038 TP sell at $76,760: Notional: 0.0005 * $76,760 = $38.38 Fee: $38.38 * 0.010% = $0.0038 Gross profit: $38.38 - $38.00 = $0.38 Total fees: $0.0038 + $0.0038 = $0.0076 Net profit: $0.38 - $0.01 = $0.37 (fees are ~2% of profit)

Performance Fee

TheHyperBot charges a 10% performance fee on realized profits only. No monthly subscriptions, no upfront costs.

Example

ScenarioBot ProfitFee (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
Aligned Incentives

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.

Referral Disclosure

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.

Risk Disclosure

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.