You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.2 KiB

package market
import (
"github.com/shopspring/decimal"
"wss-pool/pkg/model/base"
)
type SubscribeCtTradeDetailResponse struct {
base base.WebSocketResponseBase
Channel string `json:"ch"` // 数据所属的 channel,格式: market.$contract_code.bbo
Timestamp int64 `json:"ts"` // 响应生成时间点,单位:毫秒(指接口响应时间)
Tick *CtTradeDetailTick
}
type CtTradeDetailTick struct {
Id int64 `json:"id"` // 订单唯一id(品种唯一)
Ts int64 `json:"ts"` // tick数据戳
Data []TradeDetail `json:"data"`
}
type TradeDetail struct {
Amount decimal.Decimal `json:"amount"` // 数量(张)。 值是买卖双边之和
Ts int64 `json:"ts"` // 订单时间戳
Id int64 `json:"id"` // 成交唯一id(品种唯一)
Price decimal.Decimal `json:"price"` // 价格
Direction string `json:"direction"` // 买卖方向,即taker(主动成交)的方向
Quantity decimal.Decimal `json:"quantity"` // 成交量(币)
TradeTurnover decimal.Decimal `json:"trade_turnover"` // 成交额(计价币种)
}