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

Balancer base code, part 1 #87

Merged
merged 8 commits into from
Aug 27, 2023
Merged

Balancer base code, part 1 #87

merged 8 commits into from
Aug 27, 2023

Conversation

sklbancor
Copy link
Collaborator

@sklbancor sklbancor commented Aug 21, 2023

Adjusting the ConstantProductCurve class to also allow for certain Balancer-like curves. More specifically, the class will allow for a weight parameter alpha = 0..1 where alpha = 1/2 is constant product, and more generally the invariant is x^al y^1-al = k^al.

This is in preparation for allowing certain Balancer curves to be treated within the Fastlane framework. Note that the CPC class will never be able to accommodate more than two assets. Also, for the Optimizer framework this is somewhat overkill is we only need x(p), and CPC adds much more.

Note: also adds some documentation. and cleans the area, and adds the tests

@mikewcasale mikewcasale merged commit 0cc5cff into main Aug 27, 2023
3 checks passed
@mikewcasale mikewcasale deleted the balancer branch August 27, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants