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 test for slippage #89

Closed
wants to merge 7 commits into from
Closed

Add test for slippage #89

wants to merge 7 commits into from

Conversation

fhenneke
Copy link
Contributor

This is a draft PR for including a slippage test.

At the moment it computes buffer changes from tenderly settlement information. Those imbalances are corrected for fees.

TODO

  • correct for buffer trading
  • handle the case of the settlement contract being a trader itself

- adds functionality to tenderly for getting trace information from
  settlements
- adds initial implementation for computing token imbalances from this
  data

todo:
- cover more corner cases
- convert to eth using some price feed and make it an actual test
sell amounts for market orders were not exactly equal to the sell amount
due to rounding errors. It not now uses the exact expression for the buy
amount to circumvent the issue.
otherwise a missing token might result in an error
not sure why that takes longer than doing actual simulations
@fhenneke fhenneke requested a review from harisang November 24, 2023 17:37
@harisang
Copy link
Contributor

What is the status of this @fhenneke ?

@fhenneke
Copy link
Contributor Author

The code is outdated. I have refactored half of it but will not have time to clean it up now.

This PR might become relevant again if we decide to refactor slippage accounting.

@fhenneke
Copy link
Contributor Author

Closing as slippage will follow a different approach in the future.

A new test could be added once we have infrastructure around imbalances.

@fhenneke fhenneke closed this Aug 21, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants