-
Notifications
You must be signed in to change notification settings - Fork 12
Add weighted averages #306
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
Conversation
Release version to master
ezewer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small comment
| } | ||
|
|
||
| async _getWeightedAveragesReportFromApi (args) { | ||
| const limit = 100_000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the lodash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JS shipped a new feature called numeric separator to improve readability on numbers. The underscore _ was introduced in ES2021 as a separator in numbers and we can use it for decimal, binary, hexadecimal, and BigInt numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting
ezewer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
This PR adds ability to fetch weighted averages data from the BFX API using
v2/auth/r/trades/calcendpointBasic changes:
symbolparam required for weighted averagessymbolwith params schemaWeightedAveragesReportservice to be able to work with api dataNotes:
nextPage === trueit means that data is not consistent and need to change timeframe. That is, when requesting, we set a limit of 100k and in the api response it returns the number of trade records participating in the calculation, if their number has reached the requested limit, this means that the user may not see the data for the desired period of time and it needs to be reduced. This message should be displayed to the userDepends on these PRs: