Interface IOrderBook

All Known Implementing Classes:
OrderBook

public interface IOrderBook
Read-only access interface for the OrderBook.

This interface exposes query operations that allow external components to observe the state of the order book without modifying it.

Typical consumers include controllers, analytics modules, and statistics collectors.

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an immutable snapshot of the current order book state.
    boolean
    Checks whether the order book currently contains any ask orders.
    boolean
    Checks whether the order book currently contains any bid orders.
    int
    Returns the total number of resting orders currently stored in the order book across both bid and ask sides.
  • Method Details

    • hasBids

      boolean hasBids()
      Checks whether the order book currently contains any bid orders.
      Returns:
      true if at least one bid exists, otherwise false
    • hasAsks

      boolean hasAsks()
      Checks whether the order book currently contains any ask orders.
      Returns:
      true if at least one ask exists, otherwise false
    • getSnapshot

      Returns an immutable snapshot of the current order book state.

      The snapshot contains aggregated bid and ask levels as well as key market metrics such as:

      • best bid price
      • best ask price
      • mid price
      • bid-ask spread
      Returns:
      an immutable OrderBook.OrderBookSnapshot representing the current state of the book
    • remainingOrderCount

      int remainingOrderCount()
      Returns the total number of resting orders currently stored in the order book across both bid and ask sides.
      Returns:
      the total count of remaining orders