Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Depth ¶
Depth .
func (*Depth) Serialize ¶
func (d *Depth) Serialize() *oceanbookpb.Depth
Serialize returns a protobuf encoded depth.
func (*Depth) UpdatePriceLevel ¶
func (d *Depth) UpdatePriceLevel(pl *PriceLevel)
UpdatePriceLevel updates depth with price level.
type OrderBook ¶
type OrderBook struct { sync.RWMutex Symbol string Price decimal.Decimal Bids *rbt.Tree Asks *rbt.Tree StopBids *rbt.Tree StopAsks *rbt.Tree // contains filtered or unexported fields }
OrderBook is the order book.
func NewOrderBook ¶
NewOrderBook returns a pointer to an orderbook.
func (*OrderBook) CancelOrder ¶
CancelOrder removes order with specified id.
func (*OrderBook) InsertOrder ¶
InsertOrder inserts new order into orderbook.
type PriceLevel ¶
type PriceLevel struct { Price decimal.Decimal Quantity decimal.Decimal Side order.Side Count uint64 }
PriceLevel .
func (*PriceLevel) Key ¶
func (pl *PriceLevel) Key() *PriceLevelKey
Key returns a key for PriceLevel.
Click to show internal directories.
Click to hide internal directories.