Why Data Consistency Matters in Spot Market Making
Automated spot market making relies on timely and accurate market data from exchange APIs. For a market making bot to place and manage limit orders effectively, it must have access to up-to-date ticker and order book information. Inconsistent or stale data can lead to mispriced orders, missed trading opportunities, and increased risk exposure.
This article explores how to evaluate the consistency of exchange API data and why it is essential for anyone running a spot market making strategy.
Key API Data Types: Ticker and Order Book
Two primary data types drive most spot market making strategies:
- Ticker Data: Provides the latest traded price, best bid/ask, and sometimes 24-hour statistics.
- Order Book Data: Shows the current resting buy (bid) and sell (ask) orders, typically at multiple price levels.
Bots use this information to determine where to place new limit orders and which existing orders may need adjustment or cancellation.
What is Data Consistency?
Data consistency, in the context of exchange APIs, means that the information provided (such as ticker prices and order book snapshots) accurately reflects the current state of the market and aligns across different API endpoints. Inconsistent data can manifest as:
- Stale Data: Updates lag behind real market activity.
- Crossed Order Books: Best bid is higher than best ask, which should not occur in a healthy market.
- Mismatched Ticker and Order Book: Ticker prices do not align with the top of the order book.
- Missing or Incomplete Levels: Order book snapshots omit levels or quantities.
How Inconsistent Data Impacts Market Making Bots
A market making bot that acts on inconsistent data can:
- Place orders at uncompetitive or risky prices.
- Miss opportunities to adjust to market moves.
- Leave stale orders resting, increasing the chance of adverse selection.
- Fail to maintain a balanced presence on both sides of the book.
For example, if a bot receives an order book snapshot where the best ask is below the best bid, it may attempt to place orders at nonsensical prices or halt activity altogether. Similarly, if ticker data is not synchronized with the order book, the bot may misjudge the fair price and set spreads incorrectly.
Evaluating Exchange API Data Consistency
To ensure reliable operation, market makers should regularly evaluate the consistency of exchange API data. Here are practical steps:
1. Compare Ticker and Order Book Data
- Check Alignment: The ticker's best bid/ask should match the top levels of the order book.
- Monitor for Crossed Books: If the best bid is greater than or equal to the best ask, flag this as a data issue.
2. Assess Data Freshness
- Timestamps: Use the exchange-provided timestamps to check how recent the data is.
- Update Frequency: Monitor how often the API updates. High latency or infrequent updates can result in stale data.
3. Validate Order Book Structure
- Depth and Completeness: Ensure the order book contains enough levels and that quantities are non-zero.
- No Negative or Zero Prices: All price levels should be positive and sensible.
4. Test with Real-Time Streams and Snapshots
- WebSocket vs. REST: Compare the data from WebSocket streams (real-time) and REST API snapshots. Significant discrepancies may indicate issues.
- Reconcile Fills and Balances: After trades, verify that fills and balances reported by the API match expected outcomes.
5. Automated Verification
Platforms like Atlas LP include built-in API verification steps:
- Ticker, order book, symbol rules, balances, open orders, and trades are checked before a bot starts.
- Optionally, the bot can place a limit order far from the market and cancel it immediately to test order placement and cancellation.
- Each tick, the bot reads the latest ticker and order book, skipping the tick if data is stale or crossed.
Example: Spot Market Making Workflow with Data Checks
Below is a simplified illustration of how a market making bot like Atlas LP evaluates data consistency during operation:
| Step | Data Check | Action if Inconsistent |
|---|
| API Key Verification | Credentials, permissions, symbol rules | Stop bot, report error |
| Tick Start | Latest ticker and order book fetched | Skip tick if data is stale/crossed |
| Ladder Calculation | Compare ticker to order book top levels | Adjust base price if misaligned |
| Order Management | Place/cancel orders based on desired ladder | Only adjust mispriced/excess orders |
By integrating these checks into each tick, the bot minimizes the risk of acting on faulty data.
Best Practices for Market Makers
- Monitor API Status: Stay informed about exchange API health and maintenance windows.
- Set Reasonable Tick Intervals: Avoid overwhelming the API or missing updates by tuning tick intervals (Atlas LP supports intervals from 0.5 seconds).
- Use Telegram Alerts: Get notified if your bot has no fills for a set period, which may indicate data or market issues.
- Review Console Logs: Regularly check open orders, fills, and balance snapshots for anomalies.
Why Genuine Market Making Requires Data Integrity
Genuine market making means placing resting limit orders that any participant can trade against. This approach supports fair and transparent markets, but only if the underlying data is accurate and current. Wash trading, self-trading, and volume manipulation are not only prohibited—they often rely on exploiting inconsistent or fabricated data, which undermines market integrity.
Conclusion
Evaluating and ensuring exchange API data consistency is a foundational task for any spot market maker. By systematically checking ticker and order book alignment, monitoring data freshness, and leveraging automated verification steps, you can improve the reliability and safety of your market making operations.
Atlas LP includes robust API verification, tick-by-tick data checks, and secure handling of API keys to support genuine, transparent spot market making. To learn more about how Atlas LP approaches secure and reliable market making, visit [/liquidity-bot].
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.