-
Notifications
You must be signed in to change notification settings - Fork 60
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
Implement Stableswap for 2 assets #10
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR! Below are some quick comments, first on general style and then on the actual implementation. :) Example files (and generally in packages) shouldn't include the I think there was an auto-formatting tool being used which has added spacing for a number of operations? (e.g., line 178/179 of On the technical side: I think it's possible to compute the no-arbitrage trade analytically in the two-coin case of Stableswap, no? In particular, given that |
Thanks, will fix the style errors. I had done it like that because I wasn't that familiar with Julia at that point, thanks for taking the time to comment on them. Regarding analytic solution of Stableswap --- it wasn't quadratic as far as could derive. I simplified the objective function that takes the output quantity down to: with So it's a bit hairy with the square root and all. |
This is a work in progress to implement the functions
\varphi
,\nabla\varphi
andfind_arb!
for 2 asset Stableswap.Check out the following write-up for more details.
https://hackmd.io/@prism0x/stableswap-optimal-routing