The safeBuffer setting reserves a portion of your exchange API quota to ensure that MagicTradeBot does not accidentally exceed the allowed request limits.
It acts as a safety margin for handling unexpected spikes in API usage.
⚙️ How It Works
- Example configuration:
maxRequestsPerSecond: 10
safeBuffer: 0.2 # use only 80% of allowed requests
- Calculation:
Effective request rate = maxRequestsPerSecond × (1 - safeBuffer)
= 10 × (1 - 0.2)
= 8 requests/sec
- This means the bot will only use 8 of the 10 allowed requests per second, leaving a buffer for sudden bursts.
⚖️ Why It Matters
Absorbs traffic spikes
- Sudden bursts of signal processing or data fetches won’t exceed exchange limits.
Prevents accidental rate-limit violations
- Avoids temporary bans or throttling by the exchange.
Improves long-term account safety
- Reduces risk of penalties from repeated API overuse
- Ensures stable operation for continuous trading
🚀 Summary
safeBuffer is a proactive safety measure that:
- Reserves part of your API quota
- Absorbs unexpected traffic spikes
- Prevents rate-limit violations
- Protects the account for long-term stable trading
It ensures the bot operates efficiently and safely without risking exchange restrictions.