3 Main Risks of Grid Bots
๐จ Breakout
The price has gone beyond the range. All orders in one direction have been executed, and the bot is in the wrong position.
โ ๏ธ Volatility Spike
A sharp movement in both directions โ slippage destroys profit.
๐ง Liquidity Dry-up
No one is buying or selling at your price. Orders are pending, and there is no profit.
Protection 1 ยท Hard Stop-Loss
If the loss exceeds 5-10% of the capital, turn off the bot and exit all positions.
๐ค Prompt
Add a stop-loss check to grid_bot.py:
Every 5 minutes:
1. Calculate the current PnL (including unrealized in open orders).
2. If PnL < -10% of the initial capital:
- Cancel all open orders.
- Close any open positions (market sell to USDC).
- Telegram: ยซ๐จ STOP LOSS HIT. Bot stopped. PnL -10%ยป.
- systemctl stop grid-bot.
Also โ if the drawdown > 7% โ pause the bot for 1 hour (the market may stabilize).
Protection 2 ยท Range Adjustment
When the price moves for a long time, our grid ceases to be optimal. The solution is dynamic adjustment:
๐ค Prompt
Add dynamic_grid.py โ auto-adjustment.
Once a day:
1. Compute the moving average price for the last 24 hours.
2. If the current price is more than 70% of the range_top:
- The range has moved up by 30%.
- Cancel all unfilled orders.
- Place a new grid around the new center.
3. Similarly for range_bottom.
This is "following the market" โ the bot adapts to slow trends.
Protection 3 ยท Position Size Cap
Never invest more than 30% of the capital in a grid. Keep the rest in USDC or another strategy.
- 30% โ grid bot.
- 40% โ buy-and-hold ETH (if you believe in long-term).
- 20% โ stablecoins (a buffer for emergencies).
- 10% โ other strategies (trend-following, DeFi staking).
Protection 4 ยท Multiple Smaller Grids
Instead of one grid for $1000, create three for $300 with different parameters:
- Tight grid (step 0.5%, range ยฑ3%) โ for quiet days.
- Medium grid (step 1.5%, range ยฑ8%) โ the main working grid.
- Wide grid (step 3%, range ยฑ15%) โ for volatile days.
If one fails (breakout), the other two will survive.
Protection 5 ยท Kill Switch via Telegram
๐ค Prompt
Add Telegram commands to the grid-bot:
/status โ current state, profit, open orders
/pause โ soft pause (do not open new orders)
/resume โ continue
/halt โ emergency stop (cancel everything, exit all positions)
/reset $X โ reset the grid with new capital
This gives me control from my phone. Especially valuable in a crisis.
Position Monitoring
- Each execution โ Telegram (negotiable โ if it's noisy, you can filter by > $10 profit).
- Every 6 hours โ digest "current status: X trades, +/-$Y".
- Once a day at 9:00 โ daily report with an equity curve graph.
โ ๏ธ Do not leave unattended for a long time
Grid-bot โ NOT "set and forget forever". At least once a day, check Telegram. If the market has changed (trend from the sidelines) โ re-evaluate the strategy.
๐ฏ Key Takeaway
5 protections: stop-loss, dynamic adjustment, position cap 30%, multiple grids, kill-switch. Check Telegram once a day. In the final lesson โ deployment on VPS to work 24/7.