You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current code to calculate prices for swaps on the AMM is spread across several files: calcFees, calcSwapPrices,getXY, core, invariants, and swap. Some have found it hard to follow. estimate.js was written to allow the UI to predict prices without requiring a round trip to the chain. It has a test that shows it behaves the same as the more complex solution. If estimate is easier to explain, it might be a good idea to use it for the AMM's own calculations.
Description of the Design
Replace the code. Add more thorough documentation in the code to show how it carries out the design in README.md.
Security Considerations
This shouldn't effect security.
Test Plan
Consider whether any test cases need to be added. Consider substituting estimate.js in the existing AMM tests.
The text was updated successfully, but these errors were encountered:
What is the Problem Being Solved?
The current code to calculate prices for swaps on the AMM is spread across several files: calcFees, calcSwapPrices,getXY, core, invariants, and swap. Some have found it hard to follow.
estimate.js
was written to allow the UI to predict prices without requiring a round trip to the chain. It has a test that shows it behaves the same as the more complex solution. Ifestimate
is easier to explain, it might be a good idea to use it for the AMM's own calculations.Description of the Design
Replace the code. Add more thorough documentation in the code to show how it carries out the design in README.md.
Security Considerations
This shouldn't effect security.
Test Plan
Consider whether any test cases need to be added. Consider substituting
estimate.js
in the existing AMM tests.The text was updated successfully, but these errors were encountered: