Using Margin


I am using Python to access the BINANCE servers.

Question : Can the code I used to “create orders” for Futures and Spot Exchanges (on Binance) also be used for trading Margin (on Binance)?

I also found this information here speaking of Applying For and Repaying Loans (for use with Margin)


Can one apply for a loan AND create an order at the same time? If so, how long would such an operation take?

Below is the way I am seeing it now …

=> For Order Creation:

  1. Determine a safe amount to borrow (max is 3 to 1 - i.e. if you have 1 BTC, you can borrow 2 more)
  2. Check the interest rate (how can this be calculated)
  3. Calculate the liquidation level ( see here: )
  4. Apply for the loan
  5. If approved, open the Order

My questions are:
=> How to find the interest rate for the coin ( #2 above)
=> How could one calculate the liquidation level (#3 above)
=> How long would it take to be ‘apporoved’ or ‘denied’ for the loan. Does one have to use asyncio to track the “approval” or denial"

In the case of a CANCEL or SELL, one would have to “Repay” the loan - but - for a SELL, it would be better to SELL First. Once complete, then “Repay” the loan.


  1. current interest rate is available from here only
  2. margin level is available from endpoint GET /sapi/v1/margin/account
  3. borrow is automatically
    • from API, POST sapi/v1/margin/loan
    • borrow when placing the order from endpoint POST sapi/v1/margin/order, set the sideEffectType to MARGIN_BUY