From 48c84824cf2adbf510144f336111eb7b0c9b444a Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 9 Jun 2021 02:15:50 +0800 Subject: [PATCH] maxapi: volume, side, market is always required for creating orders --- pkg/exchange/max/maxapi/order.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/pkg/exchange/max/maxapi/order.go b/pkg/exchange/max/maxapi/order.go index 58a411dae..0d4db7cb2 100644 --- a/pkg/exchange/max/maxapi/order.go +++ b/pkg/exchange/max/maxapi/order.go @@ -499,14 +499,10 @@ func (r *CreateOrderRequest) ClientOrderID(clientOrderID string) *CreateOrderReq } func (r *CreateOrderRequest) Do(ctx context.Context) (order *Order, err error) { - var payload = map[string]interface{}{} - - if r.market != nil { - payload["market"] = r.market - } - - if r.volume != nil { - payload["volume"] = r.volume + var payload = map[string]interface{}{ + "market": r.market, + "volume": r.volume, + "side": r.side, } if r.price != nil { @@ -517,10 +513,6 @@ func (r *CreateOrderRequest) Do(ctx context.Context) (order *Order, err error) { payload["stop_price"] = r.stopPrice } - if r.side != nil { - payload["side"] = r.side - } - if r.orderType != nil { payload["ord_type"] = r.orderType }