-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add weighted averages #306
Conversation
Release version to master
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
@@ -50,6 +63,69 @@ class WeightedAveragesReport { | |||
} | |||
} | |||
|
|||
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
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/calc
endpointBasic changes:
symbol
param required for weighted averagessymbol
with params schemaWeightedAveragesReport
service to be able to work with api dataNotes:
nextPage === true
it 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: