Module 3 ยท Production
Lesson 5 โ€” Risk Management
โฑ 20 minutes๐Ÿ”’ Paid

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.

Protection 4 ยท Multiple Smaller Grids

Instead of one grid for $1000, create three for $300 with different parameters:

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

โš ๏ธ 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.

โ† Lesson 4Lesson 6: Deployment on VPS โ†’