Skip to content

Fix AMM contract template - #18

Open
kosunghun317 wants to merge 8 commits into
octra-labs:mainfrom
kosunghun317:fix/amm-main-contract
Open

Fix AMM contract template#18
kosunghun317 wants to merge 8 commits into
octra-labs:mainfrom
kosunghun317:fix/amm-main-contract

Conversation

@kosunghun317

Copy link
Copy Markdown

Updates the AMM template with logically correct swap/addLiquidity/removeLiquidity.

The contract has a separate _invariant() function, so implementing AMM other than CPMM can be done by just updating the logic in that function (e.g., (x^3 * y + x * y^3)^(1/4) for solidly-style stableswap).

I could not figure out how to use the interface for calling other contracts, so the moving funds part is currently commented out.

@kosunghun317
kosunghun317 force-pushed the fix/amm-main-contract branch from 9ac269a to 85514dd Compare May 15, 2026 23:35
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.

1 participant