Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBookLimit ¶
func NewBookLimit() *bookLimit
func NewBookSnapshotRecord ¶
Types ¶
type Book ¶
type Book interface { AddBuyOrder(order model.Order) AddSellOrder(order model.Order) CancelOrder(order model.Order) ([]model.OrderCancellation, error) ClearBuySideByUnitsAndPrice(units decimal.Decimal, price decimal.Decimal) (clearedOrders []*model.Order) ClearSellSideByUnitsAndPrice(units decimal.Decimal, price decimal.Decimal) (clearedOrders []*model.Order) ClearBuySideByUnits(units decimal.Decimal) (clearedOrders []*model.Order) ClearSellSideByUnits(units decimal.Decimal) (clearedOrders []*model.Order) GetFullSnapshot() *BookSnapshot GetSnapshotWithDepth(depth int) *BookSnapshot GetTotalBuyUnitsFromPrice(price decimal.Decimal) decimal.Decimal GetTotalSellUnitsToPrice(price decimal.Decimal) decimal.Decimal GetHighestBuy() *bookLimit GetLowestSell() *bookLimit }
type BookSnapshot ¶
type BookSnapshot struct { Buys []*bookSnapshotRecord `json:"buys"` Sells []*bookSnapshotRecord `json:"sells"` }
func NewBookSnapshot ¶
func NewBookSnapshot() *BookSnapshot
func (*BookSnapshot) AppendBuy ¶
func (sn *BookSnapshot) AppendBuy(record *bookSnapshotRecord)
func (*BookSnapshot) AppendSell ¶
func (sn *BookSnapshot) AppendSell(record *bookSnapshotRecord)
Click to show internal directories.
Click to hide internal directories.