Jagadish Writes Logo - Light Theme
Published on

How AI Analyzes Bid-Ask Spreads in Crypto

Listen to the full article:

Authors
  • avatar
    Name
    Jagadish V Gaikwad
    Twitter
Source

What AI Analyzes in a Crypto Bid-Ask Spread

A crypto bid-ask spread is the gap between the highest price a buyer currently offers and the lowest price a seller currently accepts. The highest bid represents immediate buying demand, while the lowest ask represents immediate selling supply.

For example, if the best bid for Bitcoin is 60,000 and the best ask is 60,012, the quoted spread is 12 units of the quote currency. The spread can also be expressed in basis points, where one basis point equals one hundredth of a percentage point. Converting the spread into basis points makes comparisons easier across assets with different prices.

AI does not treat the spread as a single static number. It analyzes how the spread changes through time, how much liquidity sits behind the best prices, how quickly orders appear or disappear, and whether trades are consuming one side of the order book.

That distinction matters because a narrow spread does not always mean a cheap or easy trade. A market may show a narrow top-level spread while offering very little quantity at those prices. A larger order can then move through several price levels and experience substantial slippage, which is the difference between the expected execution price and the actual average price.

The Data AI Uses

Most spread-analysis systems combine order-book data with trade, market, and operational signals.

Order-book snapshots

A limit order book records outstanding buy and sell orders by price and quantity. AI systems commonly extract:

  • Best bid and best ask
  • Spread in price units and basis points
  • Quantity at the first price level
  • Quantity across several price levels
  • Distance between successive price levels
  • Imbalance between bid-side and ask-side depth
  • Number of orders and their concentration
  • Changes in depth between snapshots

Depth matters because the best bid and ask show only the first available prices. A model that sees multiple levels can estimate how much a proposed order might move the market.

Trades and order flow

Trade data tells the system what actually happened rather than what participants merely displayed. Useful signals include:

  • Trade direction, when available
  • Trade size
  • Time between trades
  • Aggressive buying or selling volume
  • Cancellations and new order arrivals
  • Whether market orders are repeatedly consuming one side

Order flow can reveal pressure that is not obvious from the quoted spread. For instance, a stable spread combined with repeated market buys may indicate that ask-side liquidity is being consumed. The spread could widen soon if sellers do not replenish that liquidity.

Volatility and cross-market data

AI may also incorporate recent returns, realized volatility, funding rates, open interest, liquidation activity, and spreads on other exchanges. These variables help distinguish ordinary spread movement from conditions associated with rapid repricing.

Cross-exchange data can be useful because crypto markets operate across many venues. If one exchange shows a wider spread while other venues remain active, the difference may reflect local liquidity, latency, or a temporary imbalance rather than a market-wide change.

However, combining feeds introduces technical risks. Timestamps may not align, symbols may differ, and exchanges may report snapshots at different frequencies. A 2025 study using high-frequency crypto order-book data describes preprocessing steps such as symbol normalization, validation of price ordering, detection of crossed markets, and spread filtering before modeling.

Source

How the Analysis Works

AI spread analysis usually follows a pipeline rather than a single prediction.

1. Clean and synchronize the data

The system first removes or flags invalid records. Examples include negative quantities, duplicated timestamps, impossible price ordering, missing levels, crossed markets, and stale snapshots.

The data is then synchronized. A model should not compare a trade from one moment with an order-book state from an unrelated moment. Depending on the strategy, the system may sample data by time interval, trade event, or order-book event.

Poor data preparation can make a model appear accurate while hiding an unrealistic trading process. This is especially dangerous when the training data contains information that would not have been available at the time of a historical decision.

2. Create features

Features translate raw market activity into measurable variables. Common examples include:

  • Current spread and recent spread average
  • Spread change over several observation periods
  • Bid and ask depth near the midpoint
  • Order-book imbalance
  • Recent trade intensity
  • Volatility over short and medium windows
  • Cancellation-to-arrival patterns
  • Price distance from the midpoint
  • Differences between venues

The midpoint is the average of the best bid and best ask. It is useful as a reference price, but it is not necessarily an executable price. A trader buying immediately generally pays the ask, while a trader selling immediately generally receives the bid.

A 2025 study of 11 cryptocurrency pairs found that lagged spread measurements and moving averages retained predictive value among its microstructure features. The study also reported that spread characteristics varied by asset and market capitalization, reinforcing the need to avoid treating every token as equally liquid.

3. Estimate the next market state

Different models answer different questions.

A classification model may estimate whether the spread will widen, narrow, or remain within a selected range during the next interval. A regression model may estimate the future spread in basis points. A time-series model may forecast several horizons, while a reinforcement-learning system may choose actions such as quoting, canceling, or waiting.

Machine learning research in crypto markets has used methods ranging from linear models and random forests to support vector machines and neural networks. The right choice depends on the task, data quality, latency requirements, and cost of operating the model.

4. Convert forecasts into execution decisions

A predicted spread is not automatically a trading opportunity. The system must compare the expected benefit with fees, slippage, inventory risk, adverse price movement, and operational failure.

For a market-making strategy, the model may place quotes farther from the midpoint when volatility or adverse-selection risk rises. Adverse selection occurs when another trader is more likely to trade because they possess better information about the next price move.

For an execution strategy, the model may decide between a market order and a limit order. A market order prioritizes immediate execution but accepts available prices. A limit order controls the maximum buying price or minimum selling price but may not execute. The practical trade-off depends on urgency, depth, and the probability that the market moves away before the order fills.

What AI Can Detect Beyond the Quoted Spread

Liquidity quality

Two markets can show the same top-level spread but have very different depth. AI can measure how much volume is available within a selected price range and estimate the likely execution cost for a particular order size.

This helps answer a more useful question than “How narrow is the spread?” The better question is “How much can be traded before the expected price becomes unacceptable?”

Short-term spread regimes

Spreads often behave differently during calm, active, and stressed conditions. A model can classify these regimes using spread history, volatility, trade intensity, and depth.

In a calm regime, the system may quote more actively. In a stressed regime, it may reduce order size, widen quotes, cancel exposed orders, or stop trading. These are risk controls, not guarantees of protection.

Hidden execution risk

Displayed liquidity can disappear. Orders may be canceled before execution, and a thin market can change substantially between an observation and an order submission. AI can monitor cancellation patterns and the time that quotes remain available, but it cannot make displayed liquidity permanent.

Cross-venue differences

A model can compare the spread and depth of the same asset across exchanges. This may identify better execution venues or potential arbitrage conditions. Yet apparent price differences can disappear after fees, transfer constraints, latency, settlement risk, and the possibility that one venue’s data is stale.

Source

Comparing Common AI Uses

AI useMain questionPotential benefitMain limitation
Spread forecastingWill the spread widen or narrow soon?Helps time orders and adjust quotesShort-lived patterns can disappear
Depth estimationHow much can be traded near the current price?Improves slippage estimatesDisplayed orders may be canceled
Market makingWhere should bids and asks be placed?Can automate quote adjustmentInventory and adverse-selection risk remain
Execution routingWhich venue or order type is preferable?May reduce transaction costsFees, latency, and outages affect results
Regime detectionIs the market calm or stressed?Supports position and risk controlsRegimes can change abruptly

Why Narrow Spreads Can Mislead

A narrow spread is only one part of transaction cost. A complete estimate should consider the quoted spread, exchange fees, expected slippage, funding or borrowing costs where relevant, and the risk of non-execution.

A limit order may avoid paying the full spread if it fills, but it can remain unfilled while the market moves away. A market order may execute immediately but pay the spread and consume multiple levels of depth.

The order-book display can also create false confidence. A large order may be canceled, divided into smaller orders, or placed far enough from the midpoint that it has little relevance to immediate execution. A model trained only on snapshots may learn patterns that do not survive real-time conditions.

Research findings also require careful interpretation. A model that predicts the next spread movement is not necessarily profitable. Profitability depends on execution, costs, inventory management, latency, market impact, and the difference between historical simulation and live conditions.

Main Risks and Validation Checks

Look-ahead bias

Look-ahead bias occurs when training data includes information that would not have been available at the decision time. Even a small timestamp mistake can make a high-frequency strategy look far better than it could perform in practice.

Overfitting

A model may memorize the behavior of a particular asset, exchange, or market period. Testing across different tokens, venues, volatility conditions, and time periods is essential.

Non-stationary markets

Crypto market structure changes as liquidity, fees, participants, exchange rules, and trading activity change. A relationship that worked during one period may weaken or reverse later.

Data and venue risk

Exchange outages, API delays, dropped messages, inconsistent symbols, and stale order books can corrupt both predictions and execution. A production system needs monitoring, fallbacks, position limits, and a clear shutdown policy.

Model and strategy mismatch

A spread forecast can be statistically useful but operationally irrelevant. If the predicted change is smaller than fees and slippage, acting on it may reduce rather than improve performance.

A sound evaluation should therefore include:

  • Out-of-sample and walk-forward testing
  • Fees and realistic slippage
  • Partial fills and canceled orders
  • Latency between signal and submission
  • Exchange outages and missing data
  • Inventory limits and drawdown controls
  • Comparison with simple execution benchmarks

Reinforcement-learning research has explored crypto market making with limit-order-book data and order-flow statistics, but experimental results should not be treated as universal evidence that an automated strategy will succeed in live markets.

Source

A Practical Example

Suppose an AI system monitors an ETH trading pair. The best bid and ask are close, but the model also observes that ask-side depth has declined, cancellations are increasing, and aggressive buying has accelerated.

The system may classify the market as vulnerable to a wider spread. An execution algorithm buying ETH could respond by reducing order size, splitting the order, waiting for additional liquidity, or choosing another venue after accounting for fees.

A market-making system could reduce its displayed size or move its ask farther from the midpoint. It might also lower its overall inventory target if the probability of an upward move appears elevated.

This example describes a decision framework, not a guaranteed prediction. The model can be wrong, the liquidity can vanish, and the market can move before the order reaches the exchange.

How to Evaluate an AI Spread Tool

Before trusting a system, ask:

  • What exact target does it predict: spread width, depth, fill probability, or execution cost?
  • Which exchanges and assets supplied the training data?
  • Are timestamps, fees, latency, and partial fills modeled?
  • Does testing include periods of extreme volatility?
  • Is performance reported net of all material costs?
  • How often is the model recalibrated?
  • What happens when data is missing or an exchange becomes unavailable?
  • Are position limits and automatic shutdown rules defined?
  • Does the reported result come from a live account, a paper system, or historical simulation?

Vendor accuracy claims deserve particular caution when the evaluation period, benchmark, costs, and failure cases are not disclosed. A lower prediction error does not automatically translate into better execution.

Conclusion

AI analyzes crypto bid-ask spreads by combining order-book depth, trade flow, volatility, cancellations, and cross-venue information. It can forecast spread changes, estimate execution costs, detect liquidity regimes, and adjust order placement.

The most useful systems focus on executable outcomes rather than the displayed spread alone. They account for depth, fees, slippage, latency, partial fills, inventory, and changing market conditions. A model may identify a pattern, but disciplined validation and risk controls determine whether that pattern has practical value.

For traders and builders, the central lesson is simple: treat AI spread analysis as a decision-support layer, not a promise of profitable prediction. The quality of the data, the realism of the execution model, and the handling of failure matter at least as much as the sophistication of the algorithm.

You may also like

Comments: