mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
max: handle SelfTradeBidFeeDiscounted
This commit is contained in:
parent
fcca3f6432
commit
b02ac837ea
|
@ -211,6 +211,7 @@ func toGlobalTradeV3(t v3.Trade) ([]types.Trade, error) {
|
||||||
IsMaker: t.IsMaker(),
|
IsMaker: t.IsMaker(),
|
||||||
Fee: t.Fee,
|
Fee: t.Fee,
|
||||||
FeeCurrency: toGlobalCurrency(t.FeeCurrency),
|
FeeCurrency: toGlobalCurrency(t.FeeCurrency),
|
||||||
|
FeeDiscounted: t.FeeDiscounted,
|
||||||
QuoteQuantity: t.Funds,
|
QuoteQuantity: t.Funds,
|
||||||
Time: types.Time(t.CreatedAt),
|
Time: types.Time(t.CreatedAt),
|
||||||
IsMargin: isMargin,
|
IsMargin: isMargin,
|
||||||
|
@ -227,6 +228,7 @@ func toGlobalTradeV3(t v3.Trade) ([]types.Trade, error) {
|
||||||
bidTrade.OrderID = t.SelfTradeBidOrderID
|
bidTrade.OrderID = t.SelfTradeBidOrderID
|
||||||
bidTrade.Fee = t.SelfTradeBidFee
|
bidTrade.Fee = t.SelfTradeBidFee
|
||||||
bidTrade.FeeCurrency = toGlobalCurrency(t.SelfTradeBidFeeCurrency)
|
bidTrade.FeeCurrency = toGlobalCurrency(t.SelfTradeBidFeeCurrency)
|
||||||
|
bidTrade.FeeDiscounted = t.SelfTradeBidFeeDiscounted
|
||||||
bidTrade.IsBuyer = !trade.IsBuyer
|
bidTrade.IsBuyer = !trade.IsBuyer
|
||||||
bidTrade.IsMaker = !trade.IsMaker
|
bidTrade.IsMaker = !trade.IsMaker
|
||||||
trades = append(trades, bidTrade)
|
trades = append(trades, bidTrade)
|
||||||
|
|
|
@ -13,23 +13,24 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Trade struct {
|
type Trade struct {
|
||||||
ID uint64 `json:"id" db:"exchange_id"`
|
ID uint64 `json:"id" db:"exchange_id"`
|
||||||
WalletType WalletType `json:"wallet_type,omitempty"`
|
WalletType WalletType `json:"wallet_type,omitempty"`
|
||||||
Price fixedpoint.Value `json:"price"`
|
Price fixedpoint.Value `json:"price"`
|
||||||
Volume fixedpoint.Value `json:"volume"`
|
Volume fixedpoint.Value `json:"volume"`
|
||||||
Funds fixedpoint.Value `json:"funds"`
|
Funds fixedpoint.Value `json:"funds"`
|
||||||
Market string `json:"market"`
|
Market string `json:"market"`
|
||||||
MarketName string `json:"market_name"`
|
MarketName string `json:"market_name"`
|
||||||
CreatedAt types.MillisecondTimestamp `json:"created_at"`
|
CreatedAt types.MillisecondTimestamp `json:"created_at"`
|
||||||
Side string `json:"side"`
|
Side string `json:"side"`
|
||||||
OrderID uint64 `json:"order_id"`
|
OrderID uint64 `json:"order_id"`
|
||||||
Fee fixedpoint.Value `json:"fee"` // float number as string
|
Fee fixedpoint.Value `json:"fee"` // float number as string
|
||||||
FeeCurrency string `json:"fee_currency"`
|
FeeCurrency string `json:"fee_currency"`
|
||||||
FeeDiscounted bool `json:"fee_discounted"`
|
FeeDiscounted bool `json:"fee_discounted"`
|
||||||
Liquidity Liquidity `json:"liquidity"`
|
Liquidity Liquidity `json:"liquidity"`
|
||||||
SelfTradeBidFee fixedpoint.Value `json:"self_trade_bid_fee"`
|
SelfTradeBidFee fixedpoint.Value `json:"self_trade_bid_fee"`
|
||||||
SelfTradeBidFeeCurrency string `json:"self_trade_bid_fee_currency"`
|
SelfTradeBidFeeCurrency string `json:"self_trade_bid_fee_currency"`
|
||||||
SelfTradeBidOrderID uint64 `json:"self_trade_bid_order_id"`
|
SelfTradeBidFeeDiscounted bool `json:"self_trade_bid_fee_discounted"`
|
||||||
|
SelfTradeBidOrderID uint64 `json:"self_trade_bid_order_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t Trade) IsBuyer() bool {
|
func (t Trade) IsBuyer() bool {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user