Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

futuresPositionRisk isn't working in the latest version #919

Closed
luiztools opened this issue Mar 11, 2025 · 5 comments
Closed

futuresPositionRisk isn't working in the latest version #919

luiztools opened this issue Mar 11, 2025 · 5 comments
Assignees
Labels

Comments

@luiztools
Copy link

It returns always [] if you use the code below:

futuresPositionRisk: async ( params = {} ) => { return promiseRequest( 'v3/positionRisk', params, { base:fapi, type:'SIGNED' } ); },

To resolve the problem, change it to the following code:

futuresPositionRisk: async ( params = {} ) => { return promiseRequest( 'v2/positionRisk', params, { base:fapi, type:'SIGNED' } ); },

@carlosmiei
Copy link
Collaborator

Hello @luiztools thanks for reporting it, we will check it.

@carlosmiei carlosmiei self-assigned this Mar 11, 2025
@carlosmiei
Copy link
Collaborator

@luiztools
Copy link
Author

I investigated further and when I've changed from v2 to v3 using the code above, the feature that use it stopped working because it needs all positions and related info. I've logged the response with v3 and it was just [], probably because of this statement in the new version:

"only symbol that has position or open orders will be returned"

For now, I'd prefer to keep using the v2 that works perfectly and returns all positions, but I'll understand if it is ok yo you to change in the main code (I'm using a personal fork).

@carlosmiei
Copy link
Collaborator

@luiztools I will add an option for the users to choose (v2 or v3), but I suspect that v2/ will be deprecared soon.

@carlosmiei
Copy link
Collaborator

@luiztools If you upgrade your node-binance-api to the latest you can now do

// uses v3
 await binance.futuresPositionRisk()

or

// uses v2
 await binance.futuresPositionRiskV2()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants