An AMM reference implementation based on Raydium's CP AMM.
We added:
- rent-free
Original readme:
- No Openbook market ID is required for pool creation
- Token22 is supported
- Built-in price oracle
-
Install
Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup default 1.81.0
-
Install
Solana
sh -c "$(curl -sSfL https://release.anza.xyz/v2.1.0/install)"
then run
solana-keygen new
to create a keypair at the default location. -
install
Anchor
# Installing using Anchor version manager (avm) cargo install --git https://github.com/coral-xyz/anchor avm --locked --force # Install anchor avm install 0.31.1
- install the latest compression dependencies
npm i -g @lightprotocol/zk-compression-cli@alpha --force
cargo install --git https://github.com/lightprotocol/photon.git --rev 6ba6813 --locked --force
- Clone the repository and install node dependencies
git clone https://github.com/Lightprotocol/cp-swap-reference
cd raydium-cp-swap && yarn
- Run the tests
yarn test
Raydium constant product swap is licensed under the Apache License, Version 2.0.