Skip to content

Commit

Permalink
maxapi: volume, side, market is always required for creating orders
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jun 16, 2021
1 parent 9332383 commit 28f67bd
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions pkg/exchange/max/maxapi/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand Down

0 comments on commit 28f67bd

Please sign in to comment.