max: handle SelfTradeBidFeeDiscounted

This commit is contained in:
c9s 2023-07-27 16:28:54 +08:00
parent fcca3f6432
commit b02ac837ea
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 20 additions and 17 deletions

View File

@ -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)

View File

@ -29,6 +29,7 @@ type Trade struct {
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"`
SelfTradeBidFeeDiscounted bool `json:"self_trade_bid_fee_discounted"`
SelfTradeBidOrderID uint64 `json:"self_trade_bid_order_id"` SelfTradeBidOrderID uint64 `json:"self_trade_bid_order_id"`
} }