Position Risk endpoint doesn't return all positions


Hi! I want to receive current leverage for each symbol, but positionRisk endpoint doesn’t return all positions. I know there is restriction: I can’t fetch positions until some position has been opened, but I already have opened positions. By the way, I have another account and can fetch all 24 positions for it.

You can see the position of the symbol from the endpoint if:

  1. has/had open position.
  2. changed the margin mode: Isolated or Cross

Ok, I understood, thanks. But it would be great if you will add separate endpoints like GET /fapi/v1/leverage and GET /fapi/v1/marginType. The reason is I want to know my current leverage and margin type before open position. For now behavior is very strange, I can’t build GUI in my application without current values.
By the way, binance web client shows x20 leverage and cross margin type by default. Are these values hardcoded on the client-side?

By default, the marginType is one-way, and the leverage is 20X.
So when you have the account without any position yet, you can work with these default values until different setting is done either from UI or API.

Unfortunately, this is not the best solution. User may change leverage (for example to x15 ) and close the application (without opening any position). When he will launch the application again, the default leverage will be set again as x20 instead of x15. But in reality the value for leverage is x15.

I think user should know if the position is not initialised yet, the updated leverage is not returning from API.

BTW we have endpoint to change the margin type, that will be helpful to initialise position for new account.