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

Add weighted averages report to web ver #289

Conversation

ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Mar 30, 2023

This PR adds the Weighted Averages report to the web version. The main part of logic moves from the bfx-reports-framework and the behavior is the same as in the previous PR bitfinexcom/bfx-reports-framework#246


Breaking changes

Response example in case trades number is more than 2k (if trades number is less than 2k -> nextPage: false):

{
  "jsonrpc": "2.0",
  "result": {
    "nextPage": 1542191602000, // trades number is less than 2k -> `nextPage: false`
    "res": [
      {
        "symbol": "tUSTUSD",
        "buyingWeightedPrice": 1.12345,
        "buyingAmount": 12345,
        "sellingWeightedPrice": 1.12345,
        "sellingAmount": -12345,
        "cumulativeWeightedPrice": 1.12345,
        "cumulativeAmount": 12345
      }
    ]
  },
  "id": null
}

Basic changes:

  • Adds getWeightedAveragesReport method to the main service
  • Adds getWeightedAveragesReportCsv method to the main service
  • Adds corresponding test coverage

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.

Looks good to me!

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.

3 participants