Let’s say I want to buy AUDIOUSDT on isolated margin. If I put $10 into my isolated margin account, I get $30 buying power for long, $20 for short positions. How can I fetch this leverage information (2x, 3x, etc) via API?
Hello, sorry we’ve missed this post.
“positions” is for futures product, from the endpoint you’ve sent , you’re in spot and the endpoint allows you to send parameter “isolatedSymbol” which will return max borrowable info for your isolated margin account.
I think I don’t understand, I’ll try to explain it further. It’s in Node.js, by the way. As of now, I have $12 in my AUDIOUSDT isolated margin account, and it says I can buy on margin $36.11 worth of AUDIO and I can sell on margin 17.53 AUDIOs at maximum. The function below returns
{ amount: ‘17.53056095’, borrowLimit: ‘7100’ }
I can access 17.53, which is maximum shortable amount. How do I access $36.11 (maximum long usdt amount)?
/sapi/v1/marvel dgin/isolated/account
here is the data of the leverage level in the marginRatio value, on the other hand I recommend that you change your maxBorrowable function since the /sapi/v1/margin/maxBorrowable entry allows you to consult both the asset and the quote of the pair that passes in it isolatedSymbol field
I believe the endpoint /sapi/v1/margin/maxBorrowable? will return the max amount borrowable for the account assuming there is no initial debt. How can we reach to the net borrowable amount (post any existing debts)?