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 #266

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 to the bfx-report and the behavior is the same as in the previous PR #246


The idea is: to move the main logic to the bfx-report and extend WeightedAveragesReport service and override _getTrades method to fetch data from DB instead of the bfx-api-v2


Breaking changes

Response example, it returns nextPage: false to have the same response as in hosted ver:

{
  "jsonrpc": "2.0",
  "result": {
    "nextPage": false, // for framework mode, it should be always `false`
    "res": [
      {
        "symbol": "tUSTUSD",
        "buyingWeightedPrice": 1.12345,
        "buyingAmount": 12345,
        "sellingWeightedPrice": 1.12345,
        "sellingAmount": -12345,
        "cumulativeWeightedPrice": 1.12345,
        "cumulativeAmount": 12345
      }
    ]
  },
  "id": null
}

Depends on this PR:

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