Margin Order & Loan

Hey, I’ve created a Margin Buy order, it went well with it. But in case of margin Sell order I’m getting insufficient balance notice (yup there isn’t any ZEC balance).
But I want to create a loan and go short. And also want to create loan at the time of order execution.

assuming you have 0.1btc and the average price of zec is 0.0055btc, the amount to borrow would be (0.1 / 0.0055) = 18.18 which you would later have to sell to pass it back to btc, all this operation is summarized in this request

https://api.binance.com/sapi/v1/margin/order?symbol=ZECBTC&side=SELL&type=MARKET&quantity=18.18&sideEffectType=MARGIN_BUY&recvWindow=60000&timestamp=XXXXXXXXXX&signature=XXXXXXXXXXXX

This request will make the loan of the 18.18 ZEC and later it will pass them to BTC, executing the two operations the loan and the sale

2 Likes

Thank you very much :pray: @Saratoga

set sideEffectType=MARGIN_BUY, then you will be able to borrow during placing new order.

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

Yeah, but I want to put margin short/sell order on ZECBTC pair. So how do I do that, by ‘MARGIN_BUY’ I’ll buy some ZECs at that price right ?

you will borrow some ZEC from Binance, and interested is calculated for that.