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

Improve fetching opened positions for balance report #421

Conversation

ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Oct 11, 2024

This PR improves fetching opened positions for the balance report


we use the positions snapshot endpoint (it's daily snapshots) for getting opened positions and then calc p/l using 1D candles
but for the ending point of the balance chart, it does not give accurate results (if it's the middle of the day) and if we try to compare it with Active Positions section we can see slightly different results
so as a solution, we can try to fetch opened positions for the ending point of the balance chart from API (as we do for Active Positions section). But if API request is not successful then fetch the positions snapshot from DB

Copy link
Contributor

@ezewer ezewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

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

Successfully merging this pull request may close these issues.

2 participants