Docs Download
Home / Docs / Kline / Market Data / Refresh Rates / What does maxRequestsPerSecond control?

What does maxRequestsPerSecond control?

The maxRequestsPerSecond setting defines the maximum number of API requests the bot is allowed to send to an exchange per second.

It is a rate-limiting safeguard to prevent exceeding the exchange’s allowed API usage.


⚙️ How It Works

  • Each exchange enforces a maximum request rate (e.g., 10 requests/sec).
  • maxRequestsPerSecond ensures the bot stays within these limits, avoiding:

    • Temporary bans
    • Permanent API restrictions
    • Throttled responses

Example:

maxRequestsPerSecond: 10  # bot will not exceed 10 requests per second
  • If combined API calls exceed this rate, the bot queues requests to maintain compliance.

⚖️ Why It Matters

  1. Exchange Safety

    • Prevents hitting rate limits that could block trading or data fetching.
  2. System Stability

    • Avoids bursts of API requests that can overload your server.
  3. Consistent Data

    • Maintains a steady flow of market data, improving signal reliability.

🚀 Summary

maxRequestsPerSecond controls the maximum API request rate:

  • Keeps the bot within exchange limits
  • Prevents API throttling and bans
  • Ensures stable, reliable market data fetching and trade execution
Ready to trade? Download MagicTradeBot free and test in paper mode before going live.