This project is a CLI tool for interacting with Raydium liquidity pools on the Solana blockchain. It allows users to:
- Create a new liquidity pool
- Add liquidity to an existing pool
- Remove liquidity from a pool
The tool reads configuration parameters from a config file and executes the specified liquidity commands on-chain.
- Uses Solana's RPC Client for blockchain interactions
- Reads keypairs securely from files
- Implements Raydium liquidity pool operations
- CLI parsing with
clap
The tool uses an INI configuration file to store key Solana parameters
- payer_path: Path to the private key file of the Solana payer account (for transaction fees)
- admin_path: Path to the admin keypair managing liquidity operations
- http_url: Solana RPC endpoint for blockchain interaction
cargo run -- create-pool --config-index <index> --price <price> --mint0 <MINT0> --mint1 <MINT1> --open-time <TIME>Arguments:
config-index- Index of the pool configurationprice- Initial price of the poolmint0,mint1- Token mint addresses for the liquidity pairopen-time- Timestamp for when the pool opens
cargo run -- add-liquidity --pool <POOL_ID> --amount-a <AMOUNT_A> --amount-b <AMOUNT_B> --min-price <MIN> --max-price <MAX>Arguments:
pool- Liquidity pool addressamount-a,amount-b- Amounts of token A and B to depositmin-price,max-price- Price range for the liquidity position
cargo run -- remove-liquidity --pool <POOL_ID>Arguments:
pool- Liquidity pool address from which to remove all liquidity
The tool uses the following crates:
solana-sdk- For working with Solana accounts and transactionssolana-client- For interacting with the Solana blockchainclap- CLI argument parsinganyhow- Error handling
- Ensure Rust is installed.
- Set up your Solana CLI and wallet (
solana-keygen newif needed). - Create and configure
raydium_config.ini. - Run commands using
cargo run -- <command>.