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 open long delta calculations and add tests #178

Merged
merged 6 commits into from
Jul 22, 2024
Merged

Conversation

dpaiton
Copy link
Member

@dpaiton dpaiton commented Jul 16, 2024

Resolved Issues

working towards #171 and #21

Description

  • The code for calculating pool deltas & state after opening a long did not correctly account for the gov fee's impact on the share reserves. I fixed this and added a test to demonstrate the failure
  • I added a similar test on the short side, which almost passes with equality (seems there is a rounding error)
  • I renamed some functions, cleaned up some comments, fixed some typos

@dpaiton dpaiton changed the title new tests fix calculate_pool_share_bond_deltas_after_open_long and long_trade_needed_given_reserves and add tests Jul 16, 2024
@dpaiton dpaiton changed the title fix calculate_pool_share_bond_deltas_after_open_long and long_trade_needed_given_reserves and add tests fix open long fns and add tests Jul 16, 2024
@dpaiton dpaiton force-pushed the dpaiton/long-tests branch 5 times, most recently from ab6ee98 to a4252ad Compare July 16, 2024 20:52
@dpaiton dpaiton changed the title fix open long fns and add tests fix long functions and add tests Jul 16, 2024
@dpaiton dpaiton force-pushed the dpaiton/long-tests branch 2 times, most recently from 4258923 to e095c56 Compare July 16, 2024 21:33
@dpaiton dpaiton changed the title fix long functions and add tests fix open long delta calculations and add tests Jul 16, 2024
@dpaiton dpaiton marked this pull request as ready for review July 16, 2024 21:39
@dpaiton dpaiton enabled auto-merge (squash) July 17, 2024 16:44
Copy link
Member

@ryangoree ryangoree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed in #180

@dpaiton dpaiton merged commit 2d56ace into main Jul 22, 2024
8 checks passed
@dpaiton dpaiton deleted the dpaiton/long-tests branch July 22, 2024 19:39
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.

2 participants