How to place and close BINANCE FUTURES order with leverage

3.2k Views Asked by At

I'm trying to place a 2x leverage order on BINANCE Futures as follows:

(a) POST /fapi/v1/leverage with {'symbol': 'ETHUSDT', 'leverage': 2}

(b) POST /fapi/v1/order with { 'quantity': 100, ....}

Is this the correct way of setting the leverage? I don't know how to verify it went with leverage. I see the position on BINANCE FUTURES Web that says 2x but I'm not sure this is enough.

What's the best way to sell everything I bought before? I'm now selling 99 but there are always some 0.x remaining. Should I close the position instead of placing another SELL ORDER?

Thank you

1

There are 1 best solutions below

0
On

Based on this answer, this is correct:

POST /fapi/v1/leverage with {‘symbol’: ‘ETHUSDT’, ‘leverage’: 2}
POST /fapi/v1/order with    {‘symbol’: ‘ETHUSDT’, ‘side’: ‘BUY’, ‘quantity’: xx, …}

WAIT FOR SOME TIME ...

POST /fapi/v1/leverage with {‘symbol’: ‘ETHUSDT’, ‘leverage’: 2}
POST /fapi/v1/order with    {‘symbol’: ‘ETHUSDT’, ‘side’: ‘SELL’, ‘quantity’: xx, …}

what's important to understand is that when you are using leverage what changes is the "used balance".

For example if you want to sell 1 ETH with price 3000 USDT and 2x leverage, what changes is your free USDT balance will have less 1500 USDT instead of the 3000 USDT if you had no leverage.

To check your open positions leverage use THIS:

GET /fapi/v2/positionRisk