This Solana Anchor-based Automated Market Maker (AMM) program enables users to create liquidity pools, provide liquidity, remove liquidity, and swap between two tokens. The program also includes functionality for TWAP (Time Weighted Average Price) calculation.
createAmmInitializes a new AMM pool.
CreateAmmArgsuser [signer, mut]amm [mut]lpMint [mut]baseMint, quoteMint [readonly]vaultAtaBase, vaultAtaQuote [mut]associatedTokenProgram, tokenProgram, systemProgram, eventAuthority, program [readonly]addLiquidityAdds liquidity to an existing AMM pool.
AddLiquidityArgsuser [signer, mut]amm, lpMint, userLpAccount, userBaseAccount, userQuoteAccount, vaultAtaBase, vaultAtaQuote [mut]tokenProgram, eventAuthority, program [readonly]removeLiquidityRemoves liquidity from the pool.
RemoveLiquidityArgsaddLiquidityswapSwaps between base and quote tokens.
SwapArgs