Binance Margin API, select leverage value

Hi all, I’d need to place a margin order by selecting the leverage (3x or 10x).
I read both the binance API doc and the python-binance doc, however I cannot find the way to select the leverage. I’d need something like:

order = client.create_margin_order(symbol='BTCBUSD',
                                   side=SIDE_BUY,
                                   type=ORDER_TYPE_LIMIT,
                                   timeInForce=TIME_IN_FORCE_GTC,
                                   quantity=quantity,
                                   price=price, 
                                   leverage=3, //this parameter, unfortunately, does not exist
                                   isIsolated='TRUE')

How can I solve this?

Thank you in advance

You need to make use of the parameter sideEffectType as MARGIN_BUY . With that the system will automatically borrow the assets you need.

1 Like

Thank you so much! Exactly the parameter I was looking for!