Introduction
Automated market making bots rely on fast, reliable, and accurate connections to crypto exchanges through their APIs. However, even the most robust exchanges occasionally return error responses due to network issues, invalid parameters, permission problems, or service outages. Understanding how these API errors affect market making bots is essential for token projects, trading teams, and exchanges aiming to maintain healthy liquidity and fair markets.
This article explores common types of exchange API error responses, their impact on automated spot market making bots, and how Atlas LP is engineered to detect, handle, and recover from these scenarios.
Common Exchange API Error Responses
Crypto exchange APIs can return a variety of error responses. Some of the most relevant to market making bots include:
| Error Type | Typical Cause |
|---|
| Authentication failure | Invalid API key/secret, revoked permissions |
| Permission denied | Missing trading or read permissions |
| Parameter validation error | Order size, price, or symbol not matching exchange rules |
| Rate limit exceeded | Too many API requests in a short period |
| Network timeout | Exchange or network temporarily unavailable |
| Order rejection | Order violates exchange filters or is outside allowed range |
| Service unavailable | Exchange maintenance or downtime |
Each of these errors can disrupt a bot’s ability to read market data, place or cancel orders, or sync balances and fills.
How API Errors Affect Market Making Bots
1. Authentication and Permission Errors
If a bot’s API credentials are invalid, expired, or lack required permissions, the bot cannot interact with the exchange. For market making, this means:
- No ability to place, modify, or cancel orders
- Inability to read balances or open orders
- Risk of leaving stale or mispriced orders on the book
Atlas LP performs detailed API verification before starting a bot. If the exchange rejects the credentials, the bot stops with an error status, preventing unintended actions.
2. Parameter and Symbol Rule Errors
Exchanges enforce strict rules on order price, size, and notional value. If a bot sends an order that violates these rules, the exchange will reject it. This can happen if:
- The order size is below the minimum quantity or notional
- The price does not conform to the tick size
- The symbol is not supported or delisted
Atlas LP validates all bot settings, including symbol rules, before allowing a bot to start. During operation, each tick checks the latest symbol filters to construct valid orders. Orders that would be rejected are never sent, reducing error frequency.
3. Rate Limiting and Network Errors
Exchanges limit the number of API requests per account or IP to prevent abuse. If a bot exceeds these limits, it receives rate limit errors. Network timeouts can also occur due to connectivity issues or exchange overload.
Consequences include:
- Delayed order placement or cancellation
- Missed market data updates
- Potential for stale orders to remain on the book
Atlas LP allows users to configure tick intervals (from 0.5 seconds, default 3 seconds), balancing responsiveness with rate limit compliance. If market data is stale or crossed, the bot skips the tick, avoiding actions based on unreliable data.
4. Order Rejection and Service Outages
Order rejections can occur if the market moves quickly or if the order book structure changes. Service outages or maintenance windows can result in all API requests failing temporarily.
A robust bot must:
- Detect when orders are not accepted or canceled
- Avoid repeated failed attempts that could trigger further rate limits
- Pause or halt trading if the exchange is unavailable
Atlas LP monitors open orders, recent fills, and bot events in real time. If the exchange is unreachable or credentials are rejected, the bot stops and reports the error in the console.
Engineering Reliable Error Handling in Atlas LP
Atlas LP is designed with several layers of error detection and handling:
- API Verification: Before a bot starts, Atlas LP checks ticker, order book, symbol rules, balances, open orders, and trades. It can optionally place and immediately cancel a test limit order to verify permissions and filters.
- Setting Validation: All bot settings are validated against exchange rules before launch, preventing parameter errors.
- Tick-Based Data Checks: On every tick, the bot reads the latest ticker and order book. If data is stale or the order book is crossed, the bot skips the tick to avoid acting on unreliable information.
- Order Placement Logic: The bot places only missing levels and cancels only excess or mispriced orders. This minimizes unnecessary API calls and reduces error exposure.
- Error Status Reporting: If the exchange rejects credentials or critical operations fail, the bot stops with an error status, alerting the user.
- User Controls: Users can cancel individual or all open orders directly from the bot page, and stopping a bot halts all new order activity.
Best Practices for Managing API Errors in Market Making
- Monitor Bot Status: Use real-time console monitoring and Telegram alerts to stay informed about bot activity and errors.
- Regularly Review API Permissions: Ensure API keys have only the required permissions (read and spot trading), and never grant withdrawal access.
- Validate Settings Before Launch: Double-check symbol, order size, price, and spread settings against exchange rules.
- Adjust Tick Intervals: Set tick intervals to balance between responsiveness and avoiding rate limit errors.
- Respond Quickly to Errors: If a bot stops due to an error, investigate the cause (e.g., expired API key, exchange maintenance) before restarting.
Conclusion
Exchange API error responses are an unavoidable part of automated spot market making. By understanding the types of errors and engineering bots to detect, handle, and recover from them, trading teams and token projects can maintain reliable liquidity and minimize operational risk. Atlas LP incorporates multiple safeguards and validation steps to ensure that market making remains compliant, secure, and responsive to the realities of exchange APIs.
Genuine market making means placing resting limit orders that any participant can trade against. Wash trading, self-trading, and volume manipulation are strictly prohibited.
Atlas LP does not guarantee returns, prices, volume, or listings.
Crypto trading involves risk. Atlas LP is software for placing and managing limit orders; it does not guarantee returns, prices, volume or listings. Follow the rules of each exchange and applicable law.