I’ve just noticed that leverage set by futures_change_leverage is invalidated if you have the browser open on the pair you are trying to set leverage for.
Example:
-
I have my browser open on Binance Futures USDT for ETHUSDT. The leverage is currently set to 20x.
-
My script instantiates a binance python client (using the python-binance package) and sets leverage=1 for ETHUSDT. It then checks the leverage for each position side of the pair by calling futures_position_information - the returned value is ‘leverage’: ‘1’, which is correct so I proceed to open a trade using futures_create_order.
-
However the trade is opened at 20x, not 1x as was set with the API.
-
If I refresh the browser, the leverage is only then switches to 1x and any future API trades are opened at 1x.
Is this is bug - should the API leverage update not take precedence?
Flagging this as a warning for other users.
Thanks