Documentation
¶
Index ¶
- Constants
- Variables
- func AppendEventJSON(dst []byte, topic Topic, buf []byte) []byte
- type AbnormalEvent
- type BalanceUpdate
- type DepthSnapshot
- type DepthSnapshotView
- func (v DepthSnapshotView) Ask(i int) common.PriceLevel
- func (v DepthSnapshotView) Asks() []common.PriceLevel
- func (v DepthSnapshotView) Bid(i int) common.PriceLevel
- func (v DepthSnapshotView) Bids() []common.PriceLevel
- func (v DepthSnapshotView) DepthID() int
- func (v DepthSnapshotView) NumAsks() int
- func (v DepthSnapshotView) NumBids() int
- func (v DepthSnapshotView) SymbolID() int
- func (v DepthSnapshotView) Timestamp() uint64
- type DepthUpdate
- type DepthUpdateView
- func (v DepthUpdateView) Ask(i int) common.PriceLevel
- func (v DepthUpdateView) Asks() []common.PriceLevel
- func (v DepthUpdateView) Bid(i int) common.PriceLevel
- func (v DepthUpdateView) Bids() []common.PriceLevel
- func (v DepthUpdateView) CurrentDepthID() int
- func (v DepthUpdateView) DepthID() int
- func (v DepthUpdateView) NextDepthID() int
- func (v DepthUpdateView) NumAsks() int
- func (v DepthUpdateView) NumBids() int
- func (v DepthUpdateView) PreviousDepthID() int
- func (v DepthUpdateView) SymbolID() int
- func (v DepthUpdateView) Timestamp() uint64
- type Execution
- type FinishedEvent
- type Kline
- type KlineBar
- type OrderAccepted
- type OrderCanceled
- type OrderError
- type OrderFilled
- type OrderNew
- type OrderPartiallyFilled
- type OrderRejected
- type OrderRiskInvalid
- type OrderUnknownStatus
- type ReadyEvent
- type RespBalanceSnapshot
- type RespDepthSnapshot
- type RespHistoricalKline
- type StopEvent
- type Tick
- type TimeEvent
- type Topic
Constants ¶
const ( BalanceSize = int(unsafe.Sizeof(common.Balance{})) // RespBalanceSnapshotHeaderSize is the size of respBalanceSnapshotHeader. RespBalanceSnapshotHeaderSize = int(unsafe.Sizeof(respBalanceSnapshotHeader{})) // BalanceUpdateHeaderSize is the size of balanceUpdateHeader. BalanceUpdateHeaderSize = int(unsafe.Sizeof(balanceUpdateHeader{})) )
const ( PriceLevelSize = int(unsafe.Sizeof(common.PriceLevel{})) DepthSnapshotHeaderSize = int(unsafe.Sizeof(depthSnapshotHeader{})) DepthUpdateHeaderSize = int(unsafe.Sizeof(depthUpdateHeader{})) )
Exported layout constants for direct buffer manipulation (used by HTTP adapters).
Variables ¶
var ErrBufferTooSmall = codec.ErrBufferTooSmall
ErrBufferTooSmall is returned when the provided buffer is too small for encoding or decoding. It is the same error value as codec.ErrBufferTooSmall so identity comparisons work across packages.
var ErrInvalidBuffer = errors.New("invalid buffer layout")
ErrInvalidBuffer is returned when a decoded buffer is structurally invalid (e.g. its length does not match the header-declared element counts).
Functions ¶
Types ¶
type AbnormalEvent ¶
type AbnormalEvent struct {
Source common.EngineType
ErrorCode int
Timestamp uint64
}
func NewAbnormalEventFromBytes ¶
func NewAbnormalEventFromBytes(buf []byte) (AbnormalEvent, error)
func (AbnormalEvent) AppendJSON ¶
func (a AbnormalEvent) AppendJSON(dst []byte) []byte
func (AbnormalEvent) Encode ¶
func (a AbnormalEvent) Encode(buf []byte) error
func (AbnormalEvent) GetBufferLength ¶
func (a AbnormalEvent) GetBufferLength() int
func (AbnormalEvent) Topic ¶
func (a AbnormalEvent) Topic() Topic
type BalanceUpdate ¶
func NewBalanceUpdateFromBytes ¶
func NewBalanceUpdateFromBytes(buf []byte) (BalanceUpdate, error)
NewBalanceUpdateFromBytes interprets buf as a BalanceUpdate. The buffer length is validated against the header-declared balance count before any read. The Balances slice is a zero-copy view into buf and is only valid while buf is (i.e. within the dispatch handler, before the event's arena reservation is released).
func (BalanceUpdate) AppendJSON ¶
func (b BalanceUpdate) AppendJSON(dst []byte) []byte
func (BalanceUpdate) Encode ¶
func (b BalanceUpdate) Encode(buf []byte) error
Encode writes the BalanceUpdate into buf (layout: balanceUpdateHeader).
func (BalanceUpdate) GetBufferLength ¶
func (b BalanceUpdate) GetBufferLength() int
GetBufferLength returns the number of bytes needed to encode a BalanceUpdate.
func (BalanceUpdate) Topic ¶
func (b BalanceUpdate) Topic() Topic
type DepthSnapshot ¶
type DepthSnapshot struct {
SymbolID int
DepthID int
Timestamp uint64
Asks []common.PriceLevel
Bids []common.PriceLevel
}
func NewDepthSnapshotFromBytes ¶
func NewDepthSnapshotFromBytes(buf []byte) (DepthSnapshot, error)
NewDepthSnapshotFromBytes interprets buf as a DepthSnapshot. The buffer length is validated against the header-declared level counts before any read. The Asks/Bids slices are zero-copy views into buf and are only valid while buf is (i.e. within the dispatch handler, before the event's arena reservation is released). Prefer NewDepthSnapshotView, which avoids materializing the slices at all.
func (DepthSnapshot) AppendJSON ¶
func (d DepthSnapshot) AppendJSON(dst []byte) []byte
func (DepthSnapshot) Encode ¶
func (d DepthSnapshot) Encode(buf []byte) error
Encode writes the DepthSnapshot into buf (snapshot layout, see depthSnapshotHeader).
func (DepthSnapshot) GetBufferLength ¶
func (d DepthSnapshot) GetBufferLength() int
GetBufferLength returns the number of bytes needed to encode a DepthSnapshot.
func (DepthSnapshot) Topic ¶
func (d DepthSnapshot) Topic() Topic
type DepthSnapshotView ¶
type DepthSnapshotView struct {
// contains filtered or unexported fields
}
DepthSnapshotView is a zero-copy view over an encoded DepthSnapshot or RespDepthSnapshot (they share the same wire layout, depthSnapshotHeader).
func NewDepthSnapshotView ¶
func NewDepthSnapshotView(buf []byte) (DepthSnapshotView, error)
NewDepthSnapshotView validates the minimum length and the header + n*PriceLevelSize invariant, then wraps buf without copying.
func (DepthSnapshotView) Ask ¶
func (v DepthSnapshotView) Ask(i int) common.PriceLevel
Ask returns the i-th ask level by value (copied out of the buffer). Panics if i is out of [0, NumAsks()).
func (DepthSnapshotView) Asks ¶
func (v DepthSnapshotView) Asks() []common.PriceLevel
Asks returns a zero-copy slice aliasing the buffer's ask levels. Same lifetime contract as the view itself.
func (DepthSnapshotView) Bid ¶
func (v DepthSnapshotView) Bid(i int) common.PriceLevel
Bid returns the i-th bid level by value (copied out of the buffer). Panics if i is out of [0, NumBids()).
func (DepthSnapshotView) Bids ¶
func (v DepthSnapshotView) Bids() []common.PriceLevel
Bids returns a zero-copy slice aliasing the buffer's bid levels. Same lifetime contract as the view itself.
func (DepthSnapshotView) DepthID ¶
func (v DepthSnapshotView) DepthID() int
func (DepthSnapshotView) NumAsks ¶
func (v DepthSnapshotView) NumAsks() int
func (DepthSnapshotView) NumBids ¶
func (v DepthSnapshotView) NumBids() int
func (DepthSnapshotView) SymbolID ¶
func (v DepthSnapshotView) SymbolID() int
func (DepthSnapshotView) Timestamp ¶
func (v DepthSnapshotView) Timestamp() uint64
type DepthUpdate ¶
type DepthUpdate struct {
SymbolID int
PreviousDepthID int
DepthID int
CurrentDepthID int
NextDepthID int
Timestamp uint64
Asks []common.PriceLevel
Bids []common.PriceLevel
}
func NewDepthUpdateFromBytes ¶
func NewDepthUpdateFromBytes(buf []byte) (DepthUpdate, error)
NewDepthUpdateFromBytes interprets buf as a DepthUpdate. The buffer length is validated against the header-declared level counts before any read. The Asks/Bids slices are zero-copy views into buf and are only valid while buf is (i.e. within the dispatch handler, before the event's arena reservation is released). Prefer NewDepthUpdateView, which avoids materializing the slices at all.
func (DepthUpdate) AppendJSON ¶
func (d DepthUpdate) AppendJSON(dst []byte) []byte
func (DepthUpdate) Encode ¶
func (d DepthUpdate) Encode(buf []byte) error
Encode writes the DepthUpdate into buf (update layout, see depthUpdateHeader).
func (DepthUpdate) GetBufferLength ¶
func (d DepthUpdate) GetBufferLength() int
GetBufferLength returns the number of bytes needed to encode a DepthUpdate.
func (DepthUpdate) Topic ¶
func (d DepthUpdate) Topic() Topic
type DepthUpdateView ¶
type DepthUpdateView struct {
// contains filtered or unexported fields
}
DepthUpdateView is a zero-copy view over an encoded DepthUpdate (wire layout: depthUpdateHeader).
func NewDepthUpdateView ¶
func NewDepthUpdateView(buf []byte) (DepthUpdateView, error)
NewDepthUpdateView validates the minimum length and the header + n*PriceLevelSize invariant, then wraps buf without copying.
func (DepthUpdateView) Ask ¶
func (v DepthUpdateView) Ask(i int) common.PriceLevel
Ask returns the i-th ask level by value (copied out of the buffer). Panics if i is out of [0, NumAsks()).
func (DepthUpdateView) Asks ¶
func (v DepthUpdateView) Asks() []common.PriceLevel
Asks returns a zero-copy slice aliasing the buffer's ask levels. Same lifetime contract as the view itself.
func (DepthUpdateView) Bid ¶
func (v DepthUpdateView) Bid(i int) common.PriceLevel
Bid returns the i-th bid level by value (copied out of the buffer). Panics if i is out of [0, NumBids()).
func (DepthUpdateView) Bids ¶
func (v DepthUpdateView) Bids() []common.PriceLevel
Bids returns a zero-copy slice aliasing the buffer's bid levels. Same lifetime contract as the view itself.
func (DepthUpdateView) CurrentDepthID ¶
func (v DepthUpdateView) CurrentDepthID() int
func (DepthUpdateView) DepthID ¶
func (v DepthUpdateView) DepthID() int
func (DepthUpdateView) NextDepthID ¶
func (v DepthUpdateView) NextDepthID() int
func (DepthUpdateView) NumAsks ¶
func (v DepthUpdateView) NumAsks() int
func (DepthUpdateView) NumBids ¶
func (v DepthUpdateView) NumBids() int
func (DepthUpdateView) PreviousDepthID ¶
func (v DepthUpdateView) PreviousDepthID() int
func (DepthUpdateView) SymbolID ¶
func (v DepthUpdateView) SymbolID() int
func (DepthUpdateView) Timestamp ¶
func (v DepthUpdateView) Timestamp() uint64
type Execution ¶
type Execution struct {
ClientOrderID int
OrderID int
AccountID int
SymbolID int
Side common.Side
IsMaker bool
FillID int
FilledQty float64
FilledPrice float64
FeeCcyID int
FeeQty float64
FilledAt uint64
}
func NewExecutionFromBytes ¶
func (Execution) AppendJSON ¶
func (Execution) GetBufferLength ¶
type FinishedEvent ¶
type FinishedEvent struct {
Source common.EngineType
Timestamp uint64
}
func NewFinishedEventFromBytes ¶
func NewFinishedEventFromBytes(buf []byte) (FinishedEvent, error)
func (FinishedEvent) AppendJSON ¶
func (f FinishedEvent) AppendJSON(dst []byte) []byte
func (FinishedEvent) Encode ¶
func (f FinishedEvent) Encode(buf []byte) error
func (FinishedEvent) GetBufferLength ¶
func (f FinishedEvent) GetBufferLength() int
func (FinishedEvent) Topic ¶
func (f FinishedEvent) Topic() Topic
type Kline ¶
type Kline struct {
SymbolID int
Interval common.Interval
StartTime uint64 // candle open time, nanoseconds
EndTime uint64 // candle close time, nanoseconds
Timestamp uint64 // venue event / last-match time, nanoseconds
Open float64
High float64
Low float64
Close float64
Volume float64 // base asset volume
QuoteVolume float64 // quote asset volume / turnover
TradeCount int
Closed bool // true when the candle is finalized
}
Kline is a candlestick / OHLCV update from a venue kline stream.
func NewKlineFromBytes ¶
NewKlineFromBytes decodes a Kline by copying out of buf (bounds-checked).
func (Kline) AppendJSON ¶
func (Kline) GetBufferLength ¶
GetBufferLength returns the number of bytes needed to encode a Kline.
type KlineBar ¶
type KlineBar struct {
StartTime uint64
EndTime uint64
Timestamp uint64
Open float64
High float64
Low float64
Close float64
Volume float64
QuoteVolume float64
TradeCount int
Closed bool
}
KlineBar is one OHLCV bar inside RespHistoricalKline (no symbol/interval; those live on the response header). Times are nanoseconds.
func (KlineBar) AppendJSON ¶
type OrderAccepted ¶
func NewOrderAcceptedFromBytes ¶
func NewOrderAcceptedFromBytes(buf []byte) (OrderAccepted, error)
func (OrderAccepted) AppendJSON ¶
func (o OrderAccepted) AppendJSON(dst []byte) []byte
func (OrderAccepted) Encode ¶
func (o OrderAccepted) Encode(buf []byte) error
func (OrderAccepted) GetBufferLength ¶
func (o OrderAccepted) GetBufferLength() int
func (OrderAccepted) Topic ¶
func (o OrderAccepted) Topic() Topic
type OrderCanceled ¶
type OrderCanceled struct {
ClientOrderID int
OrderID int
AccountID int
ErrorCode int // 0 = success, non-zero = exchange error code
UpdatedAt uint64
}
func NewOrderCanceledFromBytes ¶
func NewOrderCanceledFromBytes(buf []byte) (OrderCanceled, error)
func (OrderCanceled) AppendJSON ¶
func (o OrderCanceled) AppendJSON(dst []byte) []byte
func (OrderCanceled) Encode ¶
func (o OrderCanceled) Encode(buf []byte) error
func (OrderCanceled) GetBufferLength ¶
func (o OrderCanceled) GetBufferLength() int
func (OrderCanceled) Topic ¶
func (o OrderCanceled) Topic() Topic
type OrderError ¶
func NewOrderErrorFromBytes ¶
func NewOrderErrorFromBytes(buf []byte) (OrderError, error)
func (OrderError) AppendJSON ¶
func (o OrderError) AppendJSON(dst []byte) []byte
func (OrderError) Encode ¶
func (o OrderError) Encode(buf []byte) error
func (OrderError) GetBufferLength ¶
func (o OrderError) GetBufferLength() int
func (OrderError) Topic ¶
func (o OrderError) Topic() Topic
type OrderFilled ¶
type OrderFilled struct {
ClientOrderID int
OrderID int
AccountID int
ExecutedQty float64
UpdatedAt uint64
}
func NewOrderFilledFromBytes ¶
func NewOrderFilledFromBytes(buf []byte) (OrderFilled, error)
func (OrderFilled) AppendJSON ¶
func (o OrderFilled) AppendJSON(dst []byte) []byte
func (OrderFilled) Encode ¶
func (o OrderFilled) Encode(buf []byte) error
func (OrderFilled) GetBufferLength ¶
func (o OrderFilled) GetBufferLength() int
func (OrderFilled) Topic ¶
func (o OrderFilled) Topic() Topic
type OrderNew ¶
type OrderNew struct {
AccountID int
ClientOrderID int
OrderID int
SymbolID int
Side common.Side
OrderType common.OrderType
TimeInForce common.TimeInForce
Quantity float64
Price float64
ExecutedQty float64
CreatedAt uint64
UpdatedAt uint64
}
func NewOrderNewFromBytes ¶
func (OrderNew) AppendJSON ¶
func (OrderNew) GetBufferLength ¶
type OrderPartiallyFilled ¶
type OrderPartiallyFilled struct {
ClientOrderID int
OrderID int
AccountID int
ExecutedQty float64
UpdatedAt uint64
}
func NewOrderPartiallyFilledFromBytes ¶
func NewOrderPartiallyFilledFromBytes(buf []byte) (OrderPartiallyFilled, error)
func (OrderPartiallyFilled) AppendJSON ¶
func (o OrderPartiallyFilled) AppendJSON(dst []byte) []byte
func (OrderPartiallyFilled) Encode ¶
func (o OrderPartiallyFilled) Encode(buf []byte) error
func (OrderPartiallyFilled) GetBufferLength ¶
func (o OrderPartiallyFilled) GetBufferLength() int
func (OrderPartiallyFilled) Topic ¶
func (o OrderPartiallyFilled) Topic() Topic
type OrderRejected ¶
type OrderRejected struct {
ClientOrderID int
OrderID int
AccountID int
ErrorCode int
UpdatedAt uint64
Msg string
}
func NewOrderRejectedFromBytes ¶
func NewOrderRejectedFromBytes(buf []byte) (OrderRejected, error)
func (OrderRejected) AppendJSON ¶
func (o OrderRejected) AppendJSON(dst []byte) []byte
func (OrderRejected) Encode ¶
func (o OrderRejected) Encode(buf []byte) error
func (OrderRejected) GetBufferLength ¶
func (o OrderRejected) GetBufferLength() int
func (OrderRejected) Topic ¶
func (o OrderRejected) Topic() Topic
type OrderRiskInvalid ¶
func NewOrderRiskInvalidFromBytes ¶
func NewOrderRiskInvalidFromBytes(buf []byte) (OrderRiskInvalid, error)
func (OrderRiskInvalid) AppendJSON ¶
func (o OrderRiskInvalid) AppendJSON(dst []byte) []byte
func (OrderRiskInvalid) Encode ¶
func (o OrderRiskInvalid) Encode(buf []byte) error
func (OrderRiskInvalid) GetBufferLength ¶
func (o OrderRiskInvalid) GetBufferLength() int
func (OrderRiskInvalid) Topic ¶
func (o OrderRiskInvalid) Topic() Topic
type OrderUnknownStatus ¶
func NewOrderUnknownStatusFromBytes ¶
func NewOrderUnknownStatusFromBytes(buf []byte) (OrderUnknownStatus, error)
func (OrderUnknownStatus) AppendJSON ¶
func (o OrderUnknownStatus) AppendJSON(dst []byte) []byte
func (OrderUnknownStatus) Encode ¶
func (o OrderUnknownStatus) Encode(buf []byte) error
func (OrderUnknownStatus) GetBufferLength ¶
func (o OrderUnknownStatus) GetBufferLength() int
func (OrderUnknownStatus) Topic ¶
func (o OrderUnknownStatus) Topic() Topic
type ReadyEvent ¶
type ReadyEvent struct {
Source common.EngineType
Timestamp uint64
}
func NewReadyEventFromBytes ¶
func NewReadyEventFromBytes(buf []byte) (ReadyEvent, error)
func (ReadyEvent) AppendJSON ¶
func (r ReadyEvent) AppendJSON(dst []byte) []byte
func (ReadyEvent) Encode ¶
func (r ReadyEvent) Encode(buf []byte) error
func (ReadyEvent) GetBufferLength ¶
func (r ReadyEvent) GetBufferLength() int
func (ReadyEvent) Topic ¶
func (r ReadyEvent) Topic() Topic
type RespBalanceSnapshot ¶
func NewRespBalanceSnapshotFromBytes ¶
func NewRespBalanceSnapshotFromBytes(buf []byte) (RespBalanceSnapshot, error)
NewRespBalanceSnapshotFromBytes interprets buf as a RespBalanceSnapshot. The buffer length is validated against the header-declared balance count before any read. The Balances slice is a zero-copy view into buf and is only valid while buf is (i.e. within the dispatch handler, before the event's arena reservation is released).
func (RespBalanceSnapshot) AppendJSON ¶
func (r RespBalanceSnapshot) AppendJSON(dst []byte) []byte
func (RespBalanceSnapshot) Encode ¶
func (r RespBalanceSnapshot) Encode(buf []byte) error
Encode writes the RespBalanceSnapshot into buf (layout: respBalanceSnapshotHeader).
func (RespBalanceSnapshot) GetBufferLength ¶
func (r RespBalanceSnapshot) GetBufferLength() int
GetBufferLength returns the number of bytes needed to encode a RespBalanceSnapshot.
func (RespBalanceSnapshot) Topic ¶
func (r RespBalanceSnapshot) Topic() Topic
type RespDepthSnapshot ¶
type RespDepthSnapshot struct {
SymbolID int
DepthID int
Timestamp uint64
AskLength int // number of ask price levels
BidLength int // number of bid price levels
Asks []common.PriceLevel // points into arena buffer
Bids []common.PriceLevel // points into arena buffer
}
func NewRespDepthSnapshotFromBytes ¶
func NewRespDepthSnapshotFromBytes(buf []byte) (RespDepthSnapshot, error)
NewRespDepthSnapshotFromBytes interprets buf as a RespDepthSnapshot. Same validation and slice-lifetime contract as NewDepthSnapshotFromBytes.
func (RespDepthSnapshot) AppendJSON ¶
func (r RespDepthSnapshot) AppendJSON(dst []byte) []byte
func (RespDepthSnapshot) Encode ¶
func (r RespDepthSnapshot) Encode(buf []byte) error
Encode writes the RespDepthSnapshot into buf. Uses the same layout as DepthSnapshot.
func (RespDepthSnapshot) GetBufferLength ¶
func (r RespDepthSnapshot) GetBufferLength() int
GetBufferLength returns the number of bytes needed to encode a RespDepthSnapshot.
func (RespDepthSnapshot) Topic ¶
func (r RespDepthSnapshot) Topic() Topic
type RespHistoricalKline ¶
type RespHistoricalKline struct {
SymbolID int
Interval common.Interval
Bars []KlineBar // may alias the arena buffer until the handler returns
}
RespHistoricalKline is the reply to CommandTypeReqHistoricalKline. Bars are ordered oldest → newest.
func NewRespHistoricalKlineFromBytes ¶
func NewRespHistoricalKlineFromBytes(buf []byte) (RespHistoricalKline, error)
NewRespHistoricalKlineFromBytes interprets buf as a RespHistoricalKline. Bars is a zero-copy view into buf and is only valid while buf is.
func (RespHistoricalKline) AppendJSON ¶
func (r RespHistoricalKline) AppendJSON(dst []byte) []byte
func (RespHistoricalKline) Encode ¶
func (r RespHistoricalKline) Encode(buf []byte) error
Encode writes the RespHistoricalKline into buf.
func (RespHistoricalKline) GetBufferLength ¶
func (r RespHistoricalKline) GetBufferLength() int
GetBufferLength returns the number of bytes needed to encode a RespHistoricalKline.
func (RespHistoricalKline) Topic ¶
func (r RespHistoricalKline) Topic() Topic
type StopEvent ¶
type StopEvent struct {
Source common.EngineType
Timestamp uint64
}
func NewStopEventFromBytes ¶
func (StopEvent) AppendJSON ¶
func (StopEvent) GetBufferLength ¶
type Tick ¶
func NewTickFromBytes ¶
NewTickFromBytes decodes a Tick by copying out of buf (bounds-checked).
func (Tick) AppendJSON ¶
func (Tick) GetBufferLength ¶
GetBufferLength returns the number of bytes needed to encode a Tick.
type TimeEvent ¶
TimeEvent is published by the Clock on each timer tick. TimerID identifies which registered timer fired. ScheduledNs is the scheduled fire time (not wall-clock).
func NewTimeEventFromBytes ¶
func (TimeEvent) AppendJSON ¶
func (TimeEvent) GetBufferLength ¶
type Topic ¶
type Topic int
const ( TopicEventUnknown Topic = iota TopicEventUnhandled // Known but not handled // State Topic TopicEventAbnormal TopicEventReady TopicEventStop TopicEventFinished // Market Data TopicEventDepthSnapshot TopicEventRespDepthSnapshot TopicEventDepthUpdate TopicEventTick // Execution Data TopicEventOrderUnknownStatus TopicEventOrderError TopicEventOrderRiskInvalid TopicEventOrderNew TopicEventOrderAccepted TopicEventOrderPartialFill TopicEventOrderFilled TopicEventExecution TopicEventOrderCanceled TopicEventOrderRejected // Reconciliation Data TopicEventRespBalanceSnapshot TopicEventBalanceUpdate // Timer TopicEventTimer // Market Data (appended: keep prior iota values stable) TopicEventKline TopicEventRespHistoricalKline // TopicCount is a sentinel: the number of defined topics. It must remain // the last entry in this block (used to size per-topic counter arrays). TopicCount )
func ParseTopic ¶
ParseTopic converts a config string (e.g. "OrderNew") to its Topic constant.
func ParseTopics ¶
ParseTopics converts a slice of config strings to a slice of Topics.
func (Topic) IsDroppable ¶
IsDroppable reports whether events of this topic may be dropped under overflow (ring buffer or arena full). Droppable topics are recoverable by construction: market-data topics are re-synced via depth-snapshot re-request on DepthID gap detection, and timer events are superseded by the next tick. All other topics (engine state, order lifecycle, execution, balance) are critical and must never be dropped.