mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
max: add fee_discounted to Trade struct for RESTful api
This commit is contained in:
parent
c42ad19955
commit
f5feb72355
|
@ -285,9 +285,6 @@ func convertWebSocketTrade(t max.TradeUpdate) (*types.Trade, error) {
|
|||
// skip trade ID that is the same. however this should not happen
|
||||
var side = toGlobalSideType(t.Side)
|
||||
|
||||
// trade time
|
||||
mts := time.Unix(0, t.Timestamp*int64(time.Millisecond))
|
||||
|
||||
return &types.Trade{
|
||||
ID: t.ID,
|
||||
OrderID: t.OrderID,
|
||||
|
@ -301,7 +298,7 @@ func convertWebSocketTrade(t max.TradeUpdate) (*types.Trade, error) {
|
|||
Fee: t.Fee,
|
||||
FeeCurrency: toGlobalCurrency(t.FeeCurrency),
|
||||
QuoteQuantity: t.Price.Mul(t.Volume),
|
||||
Time: types.Time(mts),
|
||||
Time: types.Time(t.Timestamp.Time()),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ type TradeUpdate struct {
|
|||
FeeCurrency string `json:"fc"`
|
||||
FeeDiscounted bool `json:"fd"`
|
||||
|
||||
Timestamp int64 `json:"T"`
|
||||
Timestamp types.MillisecondTimestamp `json:"T"`
|
||||
UpdateTime int64 `json:"TU"`
|
||||
|
||||
OrderID uint64 `json:"oi"`
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/c9s/bbgo/pkg/exchange/max/maxapi"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"regexp"
|
||||
|
|
|
@ -5,6 +5,13 @@ import (
|
|||
"github.com/c9s/bbgo/pkg/types"
|
||||
)
|
||||
|
||||
type Liquidity string
|
||||
|
||||
const (
|
||||
LiquidityMaker = "maker"
|
||||
LiquidityTaker = "taker"
|
||||
)
|
||||
|
||||
type Trade struct {
|
||||
ID uint64 `json:"id" db:"exchange_id"`
|
||||
WalletType WalletType `json:"wallet_type,omitempty"`
|
||||
|
@ -18,7 +25,8 @@ type Trade struct {
|
|||
OrderID uint64 `json:"order_id"`
|
||||
Fee fixedpoint.Value `json:"fee"` // float number as string
|
||||
FeeCurrency string `json:"fee_currency"`
|
||||
Liquidity string `json:"liquidity"`
|
||||
FeeDiscounted bool `json:"fee_discounted"`
|
||||
Liquidity Liquidity `json:"liquidity"`
|
||||
SelfTradeBidFee fixedpoint.Value `json:"self_trade_bid_fee"`
|
||||
SelfTradeBidFeeCurrency string `json:"self_trade_bid_fee_currency"`
|
||||
SelfTradeBidOrderID uint64 `json:"self_trade_bid_order_id"`
|
||||
|
|
Loading…
Reference in New Issue
Block a user