how to get the max leverage for futures using the binance API or ccxt?
GET /fapi/v1/leverageBracket
get the different leverages from here.
Thanks for your answer. Could you please tell me how to run this request using python?
Thank you
The signature is required in this endpoint, here is a script in python without dependency,
Hope this will be helpful.
@dino Would be great if there was a market data endpoint that returned the range (or just the max possible) leverage. The api docs state
"initialLeverage": 75, // Max initial leverge for this bracket
but that is not what is returned. The âmax initialâ here is for the bracket (whatever that is)⌠not for the USDT pair.
Probably should be part of exchangeInfo as a filter for each symbol.
Hi, sorry for so later reply, but i hope that this can help to someone in Future, just take it python code
from binance_f import RequestClient
from binance_f.constant.test import *
from binance_f.base.printobject import *
from binance_f.model.constant import *
g_api_key = âyour api keyâ
g_secret_key = âyour secret keyâ
request_client = RequestClient(api_key=g_api_key, secret_key=g_secret_key)
def maxLeverage(pair):
request_client = RequestClient(api_key=g_api_key, secret_key=g_secret_key)
result = request_client.get_leverage_bracket()
for x in result:
if x.symbol == pair:
hallow = x.brackets[0]
return(hallow.initialLeverage)
reback = maxLeverage(âETHUSDTâ)
print(reback)
\\\NOTE, this what does is connect to this api -> https://github.com/Binance-docs/Binance_Futures_python/blob/master/example/trade/get_leverage_bracket.py
and goes to the pair that you just specify and find the maxLeverage that you can do with this pair, if anyone has any questions can write me via Telegram (preferred) [@Nightscript], or gmail (maybe youâll get response a lit later =)) [kevinabadromero@gmail.com], Kevin.
Hello.can i set leverage in Kucoinâs API white python?