Skip to content

optimalAmountIn for two xy=k AMMs/pools#3

Open
amalnathsathyan wants to merge 3 commits into
dhruvsol:mainfrom
amalnathsathyan:main
Open

optimalAmountIn for two xy=k AMMs/pools#3
amalnathsathyan wants to merge 3 commits into
dhruvsol:mainfrom
amalnathsathyan:main

Conversation

@amalnathsathyan

Copy link
Copy Markdown

For a successful arbitrage between two pools following the equation xy = k, factors such as slippage, reserves, and amountIn must be take into account. Arbitrary inputs will not yield the expected results when the reserves and fee parameters differ between the two pools. Here is how you can derive an optimalAmountIn for that. Same approach can be extended to any AMMs, not only classical xy=k ones.

@dhruvsol

dhruvsol commented Aug 4, 2025

Copy link
Copy Markdown
Owner

@amalnathsathyan can you update the notes in the readme + add yourself as contributor

@amalnathsathyan

Copy link
Copy Markdown
Author

Sure. I'll update.

@amalnathsathyan

amalnathsathyan commented Aug 5, 2025

Copy link
Copy Markdown
Author

@dhruvsol updated readme. Next, will work on the optimalAmountIn for DLMM pools, so that this can be applied on intra-pool arbitrage in meteora.

@amalnathsathyan

Copy link
Copy Markdown
Author

@dhruvsol you may close and merge this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants