Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MajorUpdate ¶
type MajorUpdate struct { Exchange string // Name of the exchange Symbol string // Trading pair symbol }
MajorUpdate represents a significant change in the order book
type OrderBook ¶
type OrderBook struct { Updates chan PriceLevel // Channel for receiving updates MajorUpdates chan MajorUpdate // Channel for sending notifications of major changes ProcessingComplete chan struct{} // Channel for signaling when all updates are processed // contains filtered or unexported fields }
OrderBook represents the full order book for a trading pair
func NewOrderBook ¶
func NewOrderBook(exchange, symbol string, depth int, updateChan chan PriceLevel, majorUpdateChan chan MajorUpdate) *OrderBook
NewOrderBook creates and initializes a new OrderBook
func (*OrderBook) BestBidAsk ¶
BestBidAsk returns the best bid and ask prices
func (*OrderBook) GetTopLevels ¶
func (ob *OrderBook) GetTopLevels() ([]PriceLevel, []PriceLevel)
GetTopLevels returns copies of the top bid and ask levels
Click to show internal directories.
Click to hide internal directories.