fix(max): IsBuyer should check side "buy" and "bid"

This commit is contained in:
Jui-Nan Lin 2021-02-06 17:29:38 +08:00
parent 7e1825d991
commit 30f085fa91
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ type Trade struct {
}
func (t Trade) IsBuyer() bool {
return t.Side == "bid"
return t.Side == "bid" || t.Side == "buy"
}
func (t Trade) IsMaker() bool {

View File

@ -194,7 +194,7 @@ func convertWebSocketTrade(t max.TradeUpdate) (*types.Trade, error) {
Price: price,
Quantity: quantity,
Side: side,
IsBuyer: side == "bid",
IsBuyer: side == "bid" || side == "buy",
IsMaker: t.Maker,
Fee: fee,
FeeCurrency: toGlobalCurrency(t.FeeCurrency),