Documentation
¶
Overview ¶
Package matcher is an engine that receives and matches orders.
Package orderitem contains implementations of btree.Item interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { TradingPair() pb.TradingPair OrderBook(snapshotTime time.Time) (*pb.OrderBook, error) CreateOrder(order *pb.Order) ([]*pb.TradeEvent, []*pb.OrderBookEvent, error) }
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
func New ¶
func New(tradingPair pb.TradingPair) *Matcher
func (*Matcher) CreateOrder ¶
func (m *Matcher) CreateOrder(order *pb.Order) ([]*pb.TradeEvent, []*pb.OrderBookEvent, error)
CreateOrder submits an order, and gets corresponding trade and order book events.
func (*Matcher) OrderBook ¶
OrderBook gets the orderbook. This function should be called infrequently to ensure the performance of the matching engine. A separate routine should be used for updating the orderbook by listening to OrderBookEvent. This function should only be served as a periodical check point to ensure the correctness.
func (*Matcher) TradingPair ¶
func (m *Matcher) TradingPair() pb.TradingPair
TradingPair gets the trading pair of the matcher.
Click to show internal directories.
Click to hide internal directories.