Documentation ¶
Index ¶
- type Base
- type Broker
- type EventFilter
- type MarketDepth
- type MarketDepthBuilder
- func (mdb *MarketDepthBuilder) GetAllOrders(market string) map[string]*types.Order
- func (mdb *MarketDepthBuilder) GetBestAskPrice(market string) *num.Uint
- func (mdb *MarketDepthBuilder) GetBestBidPrice(market string) *num.Uint
- func (mdb *MarketDepthBuilder) GetBuyPriceLevels(market string) int
- func (mdb *MarketDepthBuilder) GetMarketDepth(ctx context.Context, market string, limit uint64) (*types.MarketDepth, error)
- func (mdb *MarketDepthBuilder) GetOrderCount(market string) int64
- func (mdb *MarketDepthBuilder) GetOrderCountAtPrice(market string, side types.Side, price uint64) uint64
- func (mdb *MarketDepthBuilder) GetPriceLevels(market string) int
- func (mdb *MarketDepthBuilder) GetSellPriceLevels(market string) int
- func (mdb *MarketDepthBuilder) GetTotalVolume(market string) int64
- func (mdb *MarketDepthBuilder) GetVolumeAtPrice(market string, side types.Side, price uint64) uint64
- func (mdb *MarketDepthBuilder) Push(evts ...events.Event)
- func (mdb *MarketDepthBuilder) Subscribe(updates chan<- *types.MarketDepthUpdate) uint64
- func (mdb *MarketDepthBuilder) Types() []events.Type
- func (mdb *MarketDepthBuilder) Unsubscribe(id uint64) error
- type MarketStreamEvent
- type OE
- type Service
- type StreamEvent
- type StreamSub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func (*Base) Closed ¶
func (b *Base) Closed() <-chan struct{}
Closed indicates to the broker that the subscriber is closed for business.
func (*Base) Halt ¶
func (b *Base) Halt()
Halt is called by the broker on shutdown, this closes the open channels.
type EventFilter ¶
type MarketDepth ¶
type MarketDepth struct {
// contains filtered or unexported fields
}
MarketDepth holds all the details about a single markets MarketDepth.
type MarketDepthBuilder ¶
type MarketDepthBuilder struct { *Base // contains filtered or unexported fields }
MarketDepthBuilder is a subscriber of order events used to build the live market depth structure.
func NewMarketDepthBuilder ¶
NewMarketDepthBuilder constructor to create a market depth subscriber.
func (*MarketDepthBuilder) GetAllOrders ¶
func (mdb *MarketDepthBuilder) GetAllOrders(market string) map[string]*types.Order
func (*MarketDepthBuilder) GetBestAskPrice ¶
func (mdb *MarketDepthBuilder) GetBestAskPrice(market string) *num.Uint
GetBestAskPrice returns the highest bid price in the book.
func (*MarketDepthBuilder) GetBestBidPrice ¶
func (mdb *MarketDepthBuilder) GetBestBidPrice(market string) *num.Uint
GetBestBidPrice returns the highest bid price in the book.
func (*MarketDepthBuilder) GetBuyPriceLevels ¶
func (mdb *MarketDepthBuilder) GetBuyPriceLevels(market string) int
GetBuyPriceLevels returns the number of non empty buy price levels.
func (*MarketDepthBuilder) GetMarketDepth ¶
func (mdb *MarketDepthBuilder) GetMarketDepth(ctx context.Context, market string, limit uint64) (*types.MarketDepth, error)
GetMarketDepth builds up the structure to be sent out to any market depth listeners.
func (*MarketDepthBuilder) GetOrderCount ¶
func (mdb *MarketDepthBuilder) GetOrderCount(market string) int64
GetOrderCount returns the number of live orders for the given market.
func (*MarketDepthBuilder) GetOrderCountAtPrice ¶
func (mdb *MarketDepthBuilder) GetOrderCountAtPrice(market string, side types.Side, price uint64) uint64
GetOrderCountAtPrice returns the number of orders at the given price level.
func (*MarketDepthBuilder) GetPriceLevels ¶
func (mdb *MarketDepthBuilder) GetPriceLevels(market string) int
GetPriceLevels returns the number of non empty price levels.
func (*MarketDepthBuilder) GetSellPriceLevels ¶
func (mdb *MarketDepthBuilder) GetSellPriceLevels(market string) int
GetSellPriceLevels returns the number of non empty sell price levels.
func (*MarketDepthBuilder) GetTotalVolume ¶
func (mdb *MarketDepthBuilder) GetTotalVolume(market string) int64
GetTotalVolume returns the total volume in the order book.
func (*MarketDepthBuilder) GetVolumeAtPrice ¶
func (mdb *MarketDepthBuilder) GetVolumeAtPrice(market string, side types.Side, price uint64) uint64
GetVolumeAtPrice returns the order volume at the given price level.
func (*MarketDepthBuilder) Push ¶
func (mdb *MarketDepthBuilder) Push(evts ...events.Event)
Push takes order messages and applied them to the makret depth structure.
func (*MarketDepthBuilder) Subscribe ¶
func (mdb *MarketDepthBuilder) Subscribe(updates chan<- *types.MarketDepthUpdate) uint64
Subscribe allows a client to register for updates of the market depth book.
func (*MarketDepthBuilder) Types ¶
func (mdb *MarketDepthBuilder) Types() []events.Type
Types returns all the message types this subscriber wants to receive.
func (*MarketDepthBuilder) Unsubscribe ¶
func (mdb *MarketDepthBuilder) Unsubscribe(id uint64) error
Unsubscribe allows the client to unregister interest in market depth updates.
type MarketStreamEvent ¶
type MarketStreamEvent interface { StreamEvent StreamMarketMessage() *eventspb.BusEvent }