diff --git a/pkg/exchange/binance/convert.go b/pkg/exchange/binance/convert.go index 2d123cee0..7573fdcc4 100644 --- a/pkg/exchange/binance/convert.go +++ b/pkg/exchange/binance/convert.go @@ -105,6 +105,10 @@ func toGlobalTicker(stats *binance.PriceChangeStats) types.Ticker { func toLocalOrderType(orderType types.OrderType) (binance.OrderType, error) { switch orderType { + + case types.OrderTypeLimitMaker: + return binance.OrderTypeLimitMaker, nil + case types.OrderTypeLimit: return binance.OrderTypeLimit, nil @@ -118,7 +122,7 @@ func toLocalOrderType(orderType types.OrderType) (binance.OrderType, error) { return binance.OrderTypeMarket, nil } - return "", fmt.Errorf("order type %s not supported", orderType) + return "", fmt.Errorf("can not convert to local order, order type %s not supported", orderType) } func toGlobalOrders(binanceOrders []*binance.Order) (orders []types.Order, err error) { @@ -223,7 +227,7 @@ func toGlobalSideType(side binance.SideType) types.SideType { return types.SideTypeSell default: - log.Errorf("unknown side type: %v", side) + log.Errorf("can not convert binance side type, unknown side type: %q", side) return "" } } diff --git a/pkg/exchange/binance/exchange.go b/pkg/exchange/binance/exchange.go index 6b6f1c852..f523dd4bb 100644 --- a/pkg/exchange/binance/exchange.go +++ b/pkg/exchange/binance/exchange.go @@ -556,7 +556,7 @@ func (e *Exchange) submitMarginOrder(ctx context.Context, order types.SubmitOrde // set price field for limit orders switch order.Type { - case types.OrderTypeStopLimit, types.OrderTypeLimit: + case types.OrderTypeStopLimit, types.OrderTypeLimit, types.OrderTypeLimitMaker: if len(order.PriceString) > 0 { req.Price(order.PriceString) } else if order.Market.Symbol != "" { @@ -669,7 +669,7 @@ func (e *Exchange) submitSpotOrder(ctx context.Context, order types.SubmitOrder) // set price field for limit orders switch order.Type { - case types.OrderTypeStopLimit, types.OrderTypeLimit: + case types.OrderTypeStopLimit, types.OrderTypeLimit, types.OrderTypeLimitMaker: if len(order.PriceString) > 0 { req.Price(order.PriceString) } else if order.Market.Symbol != "" { @@ -696,6 +696,8 @@ func (e *Exchange) submitSpotOrder(ctx context.Context, order types.SubmitOrder) } } + req.NewOrderRespType(binance.NewOrderRespTypeRESULT) + response, err := req.Do(ctx) if err != nil { return nil, err