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 TypeMethodDescriptionReturns an immutable snapshot of the current order book state.booleanhasAsks()Checks whether the order book currently contains any ask orders.booleanhasBids()Checks whether the order book currently contains any bid orders.intReturns 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:
trueif at least one bid exists, otherwisefalse
-
hasAsks
boolean hasAsks()Checks whether the order book currently contains any ask orders.- Returns:
trueif at least one ask exists, otherwisefalse
-
getSnapshot
OrderBook.OrderBookSnapshot 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.OrderBookSnapshotrepresenting 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
-