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

fix: swap volume calculations #72

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

fix: swap volume calculations #72

wants to merge 4 commits into from

Conversation

dib542
Copy link
Contributor

@dib542 dib542 commented Mar 28, 2024

There are some issues with the current swap volume calculations:

  • Fees may be incorrectly calculated from incorrect Fee keys from the Dex

    • resolution: add better restrictions on Fee values accepted, fees on tranches are not valid
  • Where Fees are null the calculated fee volume may return null instead of 0

    • resolution: set null values to 0 in calculations
  • Volume currently includes token reserves placed in tranches without any swap execution

    • resolution: track volume by the swapped tokens out of limit orders, which better represent executed volume

dib542 added 4 commits March 29, 2024 02:37
    - and note that TokenOut volume excludes the value of fees paid.
      this is because the swap volume is a balance of the equation:
      `value in (reserves in) = value out (reserves out + fee out)`
    - calculate fees using only withdrawn reserves and fee percentage
@dib542 dib542 changed the title Fix: swap volume calculations fix: swap volume calculations Apr 8, 2024
dib542 added a commit that referenced this pull request Apr 8, 2024
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.

1 participant