Liquidation protection in MagicTradeBot is a safety mechanism designed to protect your capital when using Funding Farming. Since the strategy involves hedged Spot + Futures positions, the bot continuously monitors the Futures position’s proximity to liquidation.
🔹 How It Works
Monitor Futures Risk
The bot tracks the distance between the current Futures price and the liquidation price
Liquidation occurs when margin requirements are breached, potentially causing a full loss of the leveraged position
Emergency Close Trigger
If the price moves too close to the liquidation threshold, defined by
liquidation_percent, the bot automatically closes both Spot and Futures positionsExample:
liquidation_percent: 5→ positions are closed when within 5% of liquidation price
Capital Preservation
By closing positions before liquidation, the bot prevents forced liquidations
- Ensures you retain your Spot holdings and part of your Futures capital
🔹 Key Benefits
| Feature | Benefit |
|---|---|
| Early liquidation monitoring | Reduces risk of catastrophic loss |
| Automatic closure of both positions | Maintains hedge integrity and preserves capital |
Configurable threshold (liquidation_percent) |
Allows tuning based on risk tolerance and exchange leverage |
🔹 Practical Example
- BTC Futures liquidation price: $50,000
- Current price approaches $52,500
liquidation_percent = 5→ 5% above liquidation- MagicTradeBot closes both Spot and Futures trades automatically
- Result: Capital is preserved, and hedge positions are safely exited
✅ Key Takeaways
- Liquidation protection safeguards your funding farming positions
- Bot monitors Futures liquidation proximity in real-time
- Positions are automatically closed if the threshold is reached
- Essential for capital preservation in leveraged hedged trades