Files
exchange_go/models/futuresdto/futuresdto.go
2025-02-06 11:14:33 +08:00

173 lines
10 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package futuresdto
type FutureTicker24h struct {
Symbol string `json:"symbol"` // 交易对符号 (e.g., BTCUSDT)
PriceChange string `json:"priceChange"` // 24小时价格变动
PriceChangePercent string `json:"priceChangePercent"` // 24小时价格变动百分比
WeightedAvgPrice string `json:"weightedAvgPrice"` // 加权平均价
LastPrice string `json:"lastPrice"` // 最近一次成交价
LastQty string `json:"lastQty"` // 最近一次成交额
OpenPrice string `json:"openPrice"` // 24小时内第一次成交的价格
HighPrice string `json:"highPrice"` // 24小时最高价
LowPrice string `json:"lowPrice"` // 24小时最低价
Volume string `json:"volume"` // 24小时成交量
QuoteVolume string `json:"quoteVolume"` // 24小时成交额
OpenTime int64 `json:"openTime"` // 24小时内第一笔交易的发生时间 (Unix timestamp)
CloseTime int64 `json:"closeTime"` // 24小时内最后一笔交易的发生时间 (Unix timestamp)
FirstId int `json:"firstId"` // 首笔成交id
LastId int `json:"lastId"` // 末笔成交id
Count int `json:"count"` // 成交笔数
}
type FundingInfo struct {
Symbol string `json:"symbol"` // 交易对符号 (e.g., ORBSUSDT)
MarkPrice string `json:"markPrice"` // 标记价格
IndexPrice string `json:"indexPrice"` // 指数价格
EstimatedSettlePrice string `json:"estimatedSettlePrice"` // 预计结算价格
LastFundingRate string `json:"lastFundingRate"` // 最后一次资金费率
InterestRate string `json:"interestRate"` // 利率
NextFundingTime int64 `json:"nextFundingTime"` // 下次资金费用时间 (Unix timestamp)
// Time int64 `json:"time"` // 当前时间 (Unix timestamp)
}
type RateLimit struct {
Interval string `json:"interval"` // 限制时间间隔 (e.g., MINUTE)
IntervalNum int `json:"intervalNum"` // 间隔数量 (e.g., 1)
Limit int `json:"limit"` // 限制次数
RateLimitType string `json:"rateLimitType"` // 限制类型 (e.g., REQUEST_WEIGHT)
}
type Asset struct {
Asset string `json:"asset"` // 资产名称 (e.g., BUSD)
MarginAvailable bool `json:"marginAvailable"` // 是否可用作保证金
AutoAssetExchange *string `json:"autoAssetExchange"` // 自动兑换阈值 (可选)
}
type Filter struct {
FilterType string `json:"filterType"` // 过滤器类型 (e.g., PRICE_FILTER)
MaxPrice *string `json:"maxPrice,omitempty"` // 最大价格 (可选)
MinPrice *string `json:"minPrice,omitempty"` // 最小价格 (可选)
TickSize *string `json:"tickSize,omitempty"` // 最小价格间隔 (可选)
MaxQty *string `json:"maxQty,omitempty"` // 最大数量 (可选)
MinQty *string `json:"minQty,omitempty"` // 最小数量 (可选)
StepSize *string `json:"stepSize,omitempty"` // 最小数量间隔 (可选)
Limit *int `json:"limit,omitempty"` // 限制 (可选)
Notional *string `json:"notional,omitempty"` // 最小名义价值 (可选)
MultiplierUp *string `json:"multiplierUp,omitempty"` // 价格上限百分比 (可选)
MultiplierDown *string `json:"multiplierDown,omitempty"` // 价格下限百分比 (可选)
// MultiplierDecimal *int `json:"multiplierDecimal,omitempty"` // 小数位数 (可选)
}
type FutSymbol struct {
Symbol string `json:"symbol"` // 交易对 (e.g., BLZUSDT)
Pair string `json:"pair"` // 标的交易对
ContractType string `json:"contractType"` // 合约类型
DeliveryDate int64 `json:"deliveryDate"` // 交割日期 (Unix timestamp)
OnboardDate int64 `json:"onboardDate"` // 上线日期 (Unix timestamp)
Status string `json:"status"` // 交易对状态 (e.g., TRADING)
BaseAsset string `json:"baseAsset"` // 标的资产
QuoteAsset string `json:"quoteAsset"` // 报价资产
MarginAsset string `json:"marginAsset"` // 保证金资产
PricePrecision int `json:"pricePrecision"` // 价格小数点位数
QuantityPrecision int `json:"quantityPrecision"` // 数量小数点位数
BaseAssetPrecision int `json:"baseAssetPrecision"` // 标的资产精度
QuotePrecision int `json:"quotePrecision"` // 报价资产精度
UnderlyingType string `json:"underlyingType"` // 标的类型
// UnderlyingSubType []string `json:"underlyingSubType"` // 子类型
// SettlePlan int `json:"settlePlan"` // 结算计划
TriggerProtect string `json:"triggerProtect"` // 触发保护阈值
Filters []Filter `json:"filters"` // 过滤器列表
// OrderType []string `json:"OrderType"` // 订单类型
// TimeInForce []string `json:"timeInForce"` // 有效方式
LiquidationFee string `json:"liquidationFee"` // 强平费率
MarketTakeBound string `json:"marketTakeBound"` // 市价吃单最大偏离比例
}
type FutExchangeInfo struct {
// ExchangeFilters []interface{} `json:"exchangeFilters"` // 交易所过滤器
RateLimits []RateLimit `json:"rateLimits"` // API访问限制
ServerTime int64 `json:"serverTime"` // 服务器时间 (Unix timestamp)
Assets []Asset `json:"assets"` // 资产信息
Symbols []FutSymbol `json:"symbols"` // 交易对信息
Timezone string `json:"timezone"` // 服务器时区
}
// AllTickersResp 获取所有合约币--app
type AllTickersResp struct {
SymbolId int `json:"symbol_id"` // 交易对id
CoinId int `json:"coin_id"` // 交易币id
Coin string `json:"coin"` // 交易币
PriceDigit int `json:"price_digit"` // 价格小数点位数
AmountDigit int32 `json:"amount_digit"` // 基础币种计数精度
Multiplier int `json:"multiplier"` // 合约乘数
NewPrice string `json:"new_price"` // 最新价格
DealAmt string `json:"deal_amt"` // 24小时成交总额-usd
DealNum string `json:"deal_num"` // 24小时成交总额-张
DealCoin string `json:"deal_coin"` // 24小时成交量-币
Ratio string `json:"ratio"` // 涨跌幅
MaxLever int `json:"max_lever"` //最大杠杆倍数
UserLike int `json:"user_like"` // 是否自选
FutType int `json:"fut_type"` // 数据类型 1==U本位数据 2==币本位数据
}
// AllTickersRespPc 获取所有合约币--pc
type AllTickersRespPc struct {
SymbolId int `json:"symbol_id"` // 交易对id
CoinId int `json:"coin_id"` // 交易币id
Coin string `json:"coin"` // 交易币
PriceDigit int `json:"price_digit"` // 价格小数点位数
UserLike int `json:"user_like"` // 是否自选
AmountDigit int32 `json:"amount_digit"` // 基础币种计数精度
NewPrice string `json:"new_price"` // 最新价格
DealAmt string `json:"deal_amt"` // 24小时成交总额-usd
DealNum string `json:"deal_num"` // 24小时成交总额-张
DealCoin string `json:"deal_coin"` // 24小时成交量-币
Ratio string `json:"ratio"` // 涨跌幅
HighPrice string `json:"high_price"` // 24小时最高价
LowPrice string `json:"low_price"` // 24小时最小价格
DisplaySort int `json:"display_sort"` // 排序号
FutType int `json:"fut_type"` // 数据类型 1==U本位数据 2==币本位数据
}
// MarketResp 获取单个合约币返回
type MarketResp struct {
SymbolId int `json:"symbol_id"` // 交易对id
CoinId int `json:"coin_id"` // 交易币id
Coin string `json:"coin"` // 交易币
PriceDigit int `json:"price_digit"` // 价格小数点位数
AmountDigit int `json:"amount_digit"` // 基础币种计数精度
USDTDigit int `json:"usdt_digit"` // 基础币种计数精度
Multiplier int `json:"multiplier"` //合约乘数
NewPrice string `json:"new_price"` // 最新价格
MinBuyVal string `json:"min_buy_val"` // 最小下单金额
Ratio string `json:"ratio"` // 涨跌幅
ImageStr string `json:"image_str"` // 币种图片
DetailCode string `json:"detail_code"` // 币种全称
DealNum string `json:"deal_num"` // 24小时成交量-张
DealAmt string `json:"deal_amt"` // 24小时成交金额-usd
DealCoin string `json:"deal_coin"` // 24小时成交量-币
OpenPrice string `json:"open_price"` // 开盘价
HighPrice string `json:"high_price"` // 24小时最高价
LowPrice string `json:"low_price"` // 24小时最小价格
MergeDepth string `json:"merge_depth"` // 合并深度 如:0.1,0.001,0.0001
MarkPrice string `json:"mark_price"` // 标记价格
IndexPrice string `json:"index_price"` // 指数价格
FundRate string `json:"fund_rate"` //资金费率
UserLike int `json:"user_like"` // 是否自选
NextFundingSec int `json:"next_funding_sec"` // 距离下次收资金费用时间,多少秒
}
type WsKline struct {
Line string `json:"i"` // K线间隔,比如1m
LineTime string `json:"t"` // k线时间撮
Open string `json:"o"` // 这根K线期间第一笔成交价
Close string `json:"c"` // 这根K线期间末一笔成交价
High string `json:"h"` // 这根K线期间最高成交价
Low string `json:"l"` // 这根K线期间最低成交价
Volume string `json:"v"` // 这根K线期间成交量
VolCoin string `json:"vc"` // 成交量-币
QuoteVolume string `json:"q"` // 这根K线期间成交额
Chg string `json:"chg"` //涨幅
Ampl string `json:"ampl"` //震幅
}