Versions in this module Expand all Collapse all v0 v0.0.2 Jun 18, 2020 v0.0.1 Jun 18, 2020 Changes in this version + func CalculateLocked(amount, price decimal.Decimal, side Side) decimal.Decimal + type Engine struct + func New() *Engine + func (e *Engine) Cancel(order *Order) *Order + func (e *Engine) Match(order *Order) ([]Trade, *Order, error) + func (e *Engine) Print(w io.Writer) + func (e *Engine) String() string + type Kind string + const KindLimit + const KindMarket + type Order struct + ID uint64 + Kind Kind + Locked decimal.Decimal + Price decimal.Decimal + Received decimal.Decimal + Side Side + Volume decimal.Decimal + func (o *Order) Less(other btree.Item) bool + type Side string + const SideBuy + const SideSell + type Trade struct + Amount decimal.Decimal + Buy Order + Price decimal.Decimal + Sell Order + func NewTrade(buy, sell *Order, amount, price decimal.Decimal) *Trade