Further scaffolding

This commit is contained in:
2025-11-27 20:34:34 +08:00
parent c52b2f7aa6
commit f1e5937978
28 changed files with 322 additions and 143 deletions

12
core/data/events/bar.go Normal file
View File

@@ -0,0 +1,12 @@
package events
import "time"
type Bar struct {
Open float64
High float64
Low float64
Close float64
Volume float64
Interval time.Duration
}

View File

@@ -0,0 +1,6 @@
package events
type Custom struct {
Bytes []byte
ContentType string
}

View File

@@ -0,0 +1,22 @@
// Package events ...
package events
type DataType uint8
const (
TradeType DataType = iota
QuoteType
BarType
MBPDeltaType
MBPSnapshotType
MBODeltaType
MBOSnapshotType
CustomType
)
type Side uint8
const (
Bid Side = iota
Ask
)

View File

@@ -0,0 +1,20 @@
package events
type MBODelta struct {
Operation MBOOrderOp
OrderID string
Side Side
Price float64
Size float64
IsMaker bool
Seq uint64
ParentID string
}
type MBOOrderOp uint8
const (
OrderAdd MBOOrderOp = iota
OrderMod
OrderDel
)

View File

@@ -0,0 +1,14 @@
package events
type MBOSnapshot struct {
Orders []OrderEntry
Seq uint64
}
type OrderEntry struct {
OrderID string
Side Side
Price float64
Size float64
IsMaker bool
}

View File

@@ -0,0 +1,8 @@
package events
type MBPDelta struct {
Side Side
Price float64
Size float64
Seq uint64
}

View File

@@ -0,0 +1,13 @@
package events
type MBPSnapshot struct {
Bids []PriceLevel
Asks []PriceLevel
Depth int
Seq uint64
}
type PriceLevel struct {
Price float64
Size float64
}

View File

@@ -0,0 +1,8 @@
package events
type Quote struct {
BidPrice float64
BidSize float64
AskPrice float64
AskSize float64
}

16
core/data/events/trade.go Normal file
View File

@@ -0,0 +1,16 @@
package events
type Trade struct {
Price float64
Qty float64
Aggressor AggressorSide
TradeID string
}
type AggressorSide uint8
const (
AggUnknown AggressorSide = iota
AggBuy
AggSell
)