blockchain/internal/domain/entity/kline.go

25 lines
2.2 KiB
Go
Raw Normal View History

2025-08-04 17:01:27 +00:00
package entity
type Kline struct {
2025-08-05 23:41:29 +00:00
OpenTime int64 `csv:"open_time" db:"open_time" cql:"open_time" clustering_key:"true"` // 開盤時間毫秒clustering key用於時序查詢
Open string `csv:"open" db:"open" cql:"open"` // 開盤價
High string `csv:"high" db:"high" cql:"high"` // 最高價
Low string `csv:"low" db:"low" cql:"low"` // 最低價
Close string `csv:"close" db:"close" cql:"close"` // 收盤價
Volume string `csv:"volume" db:"volume" cql:"volume"` // 成交量
CloseTime int64 `csv:"close_time" db:"close_time" cql:"close_time"` // 收盤時間(毫秒)
QuoteAssetVolume string `csv:"quote_asset_volume" db:"quote_asset_volume" cql:"quote_asset_volume"` // 成交額(以報價資產計)
NumberOfTrades int `csv:"number_of_trades" db:"number_of_trades" cql:"number_of_trades"` // 交易筆數
TakerBuyBaseAssetVolume string `csv:"taker_buy_base_asset_volume" db:"taker_buy_base_asset_volume" cql:"taker_buy_base_asset_volume"` // 主動買入成交量
TakerBuyQuoteAssetVolume string `csv:"taker_buy_quote_asset_volume" db:"taker_buy_quote_asset_volume" cql:"taker_buy_quote_asset_volume"` // 主動買入成交額
Symbol string `db:"symbol" partition_key:"true" cql:"symbol"` // 交易對partition key
2025-08-06 23:41:18 +00:00
// K 線時間區間partition key // 12h,15m,1d,1h,1m,1s,2h,30m,3m,4h,5m,6h,8h
Interval string `db:"interval" partition_key:"true" cql:"interval"`
2025-08-04 17:01:27 +00:00
}
func (s *Kline) TableName() string {
2025-08-06 23:41:18 +00:00
return "kline"
2025-08-04 17:01:27 +00:00
}
2025-08-06 23:41:18 +00:00
// todo 未來在分表,每一個交易幣兌一個表