How to go short on isolated margin?

Similar to that question.

I want to go short by borrowing, then repay it (close it) when I’m done. How can I do it?

I understand how this all works in web GUI, but I couldn’t find the related API endpoints to achieve this functionality, most certainly my mistake.

Thanks!

Please check this API document section to get to know the endpoint for placing orders in futures: https://binance-docs.github.io/apidocs/futures/en/#new-order-trade

I would suggest use https://github.com/binance-exchange/binance-api-postman and futures testnet for the testing, because it’s not straightforward. The parameters depends your conditions, but in the simplest conditions (one-way mode, market order and no open positions):

POST https://testnet.binancefuture.com/fapi/v1/order?symbol=BNBUSDT&side=SELL&positionSide=BOTH&type=MARKET&quantity=0.03&timestamp=1616535470671&signature=xxx

You can explore the API document further to see how to change the margin.
If you’re able to close the position with a loss, then you don’t have to repay, it’s already automatically deducted from your margin balance.

I’m sorry, I forgot to add, I’m talking about isolated margin on altcoins and btc in general, not futures.
Thank you for your reply.

You talking about margin trading or futures trading?

Thank you for your reply!

My mistake, I’m sorry I forgot to mention it. Margin trading, specifically isolated margin.

sideEffectType=“MARGIN_BUY” to borrow
sideEffectType=“AUTO_REPAY” to pay back

Read the docs pls - https://binance-docs.github.io/apidocs/spot/en/#margin-account-new-order-trade

1 Like

Thanks!

I missed the “side” parameter. Now it’s clear.