Atlas LP
  1. Home
  2. Blog
  3. Engineering Reliable Spot Market Making: Handling Exchange Downtime and Data Gaps

Engineering

Engineering Reliable Spot Market Making: Handling Exchange Downtime and Data Gaps

Explore engineering practices for building resilient spot market making bots that can handle exchange outages, data lags, and connectivity issues without compromising order book integrity.

Published

Introduction

Spot market making bots are essential tools for maintaining liquidity and orderly trading environments on crypto exchanges. However, the reality of exchange downtime, data lags, and intermittent connectivity can challenge even the most robust systems. Engineering a reliable market making solution means anticipating these disruptions and designing your bot to respond safely and predictably.

This post explores best practices and technical considerations for handling exchange outages and data gaps in spot market making, with concrete examples from the Atlas LP platform.

Why Reliability Matters in Market Making

Market makers provide liquidity by posting resting limit orders that any participant can interact with. If a bot malfunctions during an exchange outage or data lag, it risks:

  • Posting stale or mispriced orders
  • Missing fills or failing to update the order book
  • Leaving orphaned orders on the exchange
  • Exposing the user to unnecessary risk

Reliability is not just about uptime—it’s about ensuring that the bot’s actions always reflect the true state of the market and the user’s intent.

Common Causes of Downtime and Data Gaps

Before diving into solutions, it's helpful to understand where disruptions can arise:

  • Exchange Maintenance: Scheduled or emergency downtime can halt trading or API access.
  • Network Connectivity: Internet outages or high latency between the bot and the exchange.
  • API Rate Limits: Exceeding allowed request rates can result in temporary bans or dropped connections.
  • Data Staleness: Delays in receiving ticker or order book updates, especially if relying on REST polling.
  • Crossed or Inconsistent Order Books: Data anomalies where bids exceed asks, leading to invalid market states.

Engineering Strategies for Bot Reliability

1. Data Freshness and Validation

A robust market making bot must continuously validate the freshness and consistency of incoming data. Atlas LP, for example, reads the latest ticker and order book data on each tick, using either WebSocket streams or REST endpoints depending on the exchange. If the data is stale or the order book is crossed, the bot skips that tick and takes no action.

Best Practices:

  • Define a maximum allowable data age (e.g., only act on data updated within the last few seconds).
  • Check for crossed order books and other anomalies before placing or canceling orders.
  • Log skipped ticks for later analysis.

2. Handling Exchange Downtime

When an exchange becomes unreachable or enters maintenance mode, the bot must avoid making assumptions about the state of open orders or balances. Atlas LP will stop the bot with an error status if credentials are rejected or if critical API endpoints are unavailable.

Best Practices:

  • Detect downtime quickly using connection timeouts and error codes.
  • Stop the bot cleanly, avoiding further order placement or cancellation attempts.
  • Notify the user through alerts (e.g., Telegram notifications) so they can take manual action if needed.

3. Order Book Seeding and Recovery

If a market has no quotes (for example, after a prolonged outage), Atlas LP seeds the order book by placing one buy and one sell order around the base price. This ensures that liquidity is restored in a controlled manner, rather than flooding the book with orders based on outdated data.

Best Practices:

  • On recovery, start with minimal order placement and gradually rebuild the order ladder.
  • Re-validate all symbol rules (minimum quantities, notional values) before submitting new orders.

4. API Error Handling and Retries

APIs can fail intermittently due to network issues or exchange-side throttling. Atlas LP validates API keys and checks all relevant endpoints (ticker, order book, balances, open orders, trades) before starting a bot. If an API call fails mid-operation, the bot skips the tick and retries on the next cycle.

Best Practices:

  • Implement exponential backoff for retrying failed requests.
  • Distinguish between temporary errors (retryable) and permanent errors (require user intervention).
  • Avoid repeated rapid retries that could trigger further rate limits.

5. Open Order and State Synchronization

Maintaining an accurate record of open orders and recent fills is critical, especially after reconnecting following downtime. Atlas LP syncs open orders, recent fills (including fees), and balances with the exchange on each tick, and displays this information in the console for transparency.

Best Practices:

  • On reconnect, fetch the full list of open orders and compare with local state.
  • Cancel any orders that are no longer valid or mispriced.
  • Record a daily snapshot of account asset value for auditing and recovery purposes.

6. User Controls and Alerts

Giving users the ability to intervene is an important safeguard. Atlas LP allows users to cancel individual or all open orders directly from the bot page, and stopping a bot immediately halts new order placement. Telegram alerts can notify users if the bot has had no fills for a chosen number of minutes, which may indicate downtime or market inactivity.

Best Practices:

  • Provide clear, actionable alerts for downtime, data gaps, or unusual inactivity.
  • Make manual controls easily accessible in the user interface.

Example: Atlas LP Bot Tick Workflow

The Atlas LP bot follows a strict workflow on each tick:

  1. Read Data: Fetch the latest ticker and order book.
  2. Validate: Check for data freshness and crossed books.
  3. Compute Ladder: Determine the desired order levels based on the strategy and current market.
  4. Place/Cancel Orders: Submit missing orders and cancel only excess or mispriced ones.
  5. Sync State: Update open orders, fills, balances, and log events.

If any step fails due to downtime or stale data, the bot skips the tick and waits for the next interval. This conservative approach minimizes risk and ensures that only valid, up-to-date information drives trading decisions.

Summary Table: Handling Downtime and Data Gaps

ChallengeAtlas LP ApproachBest Practice
Exchange downtimeStop bot, alert userClean shutdown, user notification
Data staleness/crossedSkip tick, log eventValidate before acting
API errorsRetry or stop based on severityExponential backoff, clear errors
Recovery after outageSeed minimal orders, resync stateGradual restart, full resync
User interventionManual order cancel, bot stopAccessible controls, timely alerts

Conclusion

Building a reliable spot market making bot requires more than just placing orders—it demands careful engineering to handle the realities of exchange downtime, data gaps, and unpredictable connectivity. By validating data, handling errors gracefully, and empowering users with alerts and controls, platforms like Atlas LP help ensure that market making remains safe, transparent, and genuinely beneficial to the market.

To learn more about how Atlas LP approaches market making reliability, visit our liquidity bot overview or explore the supported exchanges.

Atlas LP does not guarantee returns, prices, trading 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.

← Back to blog

Frequently asked questions

How does Atlas LP handle exchange downtime?

If an exchange becomes unreachable or credentials are rejected, Atlas LP stops the bot with an error status and notifies the user, preventing further order activity until the issue is resolved.

What happens if the bot receives stale or inconsistent market data?

Atlas LP validates the freshness and consistency of ticker and order book data on every tick. If data is stale or the book is crossed, the bot skips the tick and takes no trading action.

Can I manually intervene if something goes wrong?

Yes, users can cancel individual or all open orders from the bot page, and stopping a bot will halt all new order placements. Telegram alerts can also notify users of inactivity.

How does Atlas LP resynchronize after downtime?

After downtime, Atlas LP fetches the latest open orders, fills, and balances from the exchange, seeds the order book with minimal orders if needed, and gradually rebuilds the order ladder.

Does Atlas LP guarantee continuous uptime or profit?

No, Atlas LP does not guarantee uptime, returns, trading volume, or listings. The platform is designed for reliability, but market and exchange risks remain.

Related articles

Run your spot liquidity bot with clear controls

Connect an exchange API key, set your spread band and order levels, and monitor orders, fills and balances from one console.

Create an account