mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
max: add fee processing field
This commit is contained in:
parent
5e0ff7afed
commit
0318e08e0f
|
@ -201,6 +201,11 @@ func toGlobalTradeV3(t v3.Trade) ([]types.Trade, error) {
|
|||
isMargin := t.WalletType == max.WalletTypeMargin
|
||||
side := toGlobalSideType(t.Side)
|
||||
|
||||
fee := fixedpoint.Zero
|
||||
if t.Fee != nil {
|
||||
fee = *t.Fee
|
||||
}
|
||||
|
||||
trade := types.Trade{
|
||||
ID: t.ID,
|
||||
OrderID: t.OrderID,
|
||||
|
@ -211,7 +216,8 @@ func toGlobalTradeV3(t v3.Trade) ([]types.Trade, error) {
|
|||
Side: side,
|
||||
IsBuyer: t.IsBuyer(),
|
||||
IsMaker: t.IsMaker(),
|
||||
Fee: t.Fee,
|
||||
Fee: fee,
|
||||
FeeProcessing: t.Fee == nil,
|
||||
FeeCurrency: toGlobalCurrency(t.FeeCurrency),
|
||||
FeeDiscounted: t.FeeDiscounted,
|
||||
QuoteQuantity: t.Funds,
|
||||
|
|
|
@ -23,7 +23,7 @@ type Trade struct {
|
|||
CreatedAt types.MillisecondTimestamp `json:"created_at"`
|
||||
Side string `json:"side"`
|
||||
OrderID uint64 `json:"order_id"`
|
||||
Fee fixedpoint.Value `json:"fee"` // float number as string
|
||||
Fee *fixedpoint.Value `json:"fee"` // float number in string, could be optional
|
||||
FeeCurrency string `json:"fee_currency"`
|
||||
FeeDiscounted bool `json:"fee_discounted"`
|
||||
Liquidity Liquidity `json:"liquidity"`
|
||||
|
|
|
@ -76,6 +76,7 @@ type Trade struct {
|
|||
Time Time `json:"tradedAt" db:"traded_at"`
|
||||
Fee fixedpoint.Value `json:"fee" db:"fee"`
|
||||
FeeCurrency string `json:"feeCurrency" db:"fee_currency"`
|
||||
FeeProcessing bool `json:"feeProcessing" db:"-"`
|
||||
|
||||
// FeeDiscounted is an optional field which indicates whether the trade is using the platform fee token for discount.
|
||||
// When FeeDiscounted = true, means the fee is deducted outside the trade
|
||||
|
|
Loading…
Reference in New Issue
Block a user