Binance API Futures - {'code': -1117, 'msg': 'Invalid side.'}

1.9k Views Asked by At

I'm trying to place a future position with /fapi/v1/order.

I keep encounter the error {'code': -1117, 'msg': 'Invalid side.'}.
More info on code 1117

Actual pseudo code

futures.orders.create(
            symbol='ADAUSDT',
            market_type="TRAILING_STOP_MARKET",
            position='LONG',
            activationPrice=1.80,
            callbackRate=2.0
        )

I've tried ['BOTH', 'BUY/LONG', 'SELL/SHORT', 'LONG', 'SHORT', 'BUY', 'SELL'] but the same erros keeps coming back, so what do I do wrong?

1

There are 1 best solutions below

0
On BEST ANSWER

I just realized you got two side parameters; positionSide and side. positionSide was set but side was not.

Additional information:

There are only two available values for the side parameter of the order endpoint, one is BUY another is SELL. If you want to place an order under the hedge mode, please use another parameter positionSide along with the side parameter.

  • positionSide=LONG&side=BUY -> represents open long position
  • positionSide=LONG&side=SELL -> represents close long position
  • positionSide=SHORT&side=SELL -> represents open short position
  • positionSide=SHORT&side=BUY -> represents close short position

Hope this helps future people : )