Implement Stableswap for 2 assets#10
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\varphiandfind_arb!for 2 asset Stableswap.Check out the following write-up for more details.
https://hackmd.io/@prism0x/stableswap-optimal-routing