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.
42 lines
3.0 KiB
42 lines
3.0 KiB
package entity |
|
|
|
import "github.com/lib/pq" |
|
|
|
// 交易产品基础信息 |
|
type TradeInstance struct { |
|
InstId string `gorm:"column:inst_id;primaryKey" json:"instId"` // 交易产品id BTC_USDT_SWAP |
|
InstPair string `gorm:"column:inst_pair" json:"instPair"` // 交易对 BTCUSDT |
|
InstType int32 `gorm:"column:inst_type" json:"instType"` // 交易类型: 1现货2永续合约 |
|
InstCoin string `gorm:"column:inst_coin" json:"instCoin"` // 所属币种 BTC |
|
Status int32 `gorm:"column:status" json:"status"` // 状态: 0禁用,1正常,4删除 |
|
PriceSz int32 `gorm:"column:price_sz" json:"priceSz"` // 价格小数点左移位数(float64计算时) |
|
QuantitySz int32 `gorm:"column:quantity_sz" json:"quantitySz"` // 数量小数点左移位数(float64计算时) |
|
PriceScale int32 `gorm:"column:price_scale" json:"priceScale"` // 价格有效小数点位数 |
|
QuantityScale int32 `gorm:"column:quantity_scale" json:"quantityScale"` // 数量有效小数点位数 |
|
Icon string `gorm:"column:icon" json:"icon"` // 币种图标 |
|
Leverages pq.Int32Array `gorm:"column:leverages;type:int[]" json:"leverages"` // 杠杆倍数[5,10,20,50,100] |
|
UpdateBy string `gorm:"column:update_by" json:"updateBy"` // 更新人 |
|
UpdateTime int64 `gorm:"column:update_time" json:"updateTime"` // 更新时间戳毫秒 |
|
Exchanges []*TradeInstanceExchange `gorm:"-" json:"exchanges"` // 交易产品支持交易所 |
|
// 合约面值(0.0001/BTC) 杠杆倍数[5,10,20,50,100] 前端显示(BTC/USDT) 是否可交易 开空 开多 市价开空 市价开多 交易对(btcusdt) |
|
// 资金费率 资金周期 最小下单量 最大下单量 最小下单金额 最大下单金额 |
|
// 开仓手续费 平仓手续费 |
|
} |
|
|
|
func (TradeInstance) TableName() string { |
|
return "t_trade_instance" |
|
} |
|
|
|
// 交易所交易产品 |
|
type TradeInstanceExchange struct { |
|
ExchangeInstId string `gorm:"column:exchange_inst_id;primaryKey" json:"exchangeInstId"` // 交易所交易产品id(交易所交易对) |
|
Exchange int32 `gorm:"column:exchange;primaryKey" json:"exchange"` // 交易所: 1.okx 2.binance |
|
InstId string `gorm:"column:inst_id" json:"instId"` // 交易产品id |
|
Status int32 `gorm:"column:status" json:"status"` // 状态: 0禁用,1正常,2初始化中,4删除 |
|
UpdateBy string `gorm:"column:update_by" json:"updateBy"` // 更新人 |
|
UpdateTime int64 `gorm:"column:update_time" json:"updateTime"` // 更新时间戳毫秒 |
|
} |
|
|
|
func (TradeInstanceExchange) TableName() string { |
|
return "t_trade_instance_exchange" |
|
}
|
|
|