This script automates adding liquidity to multiple DODO V2 DVM pools using Foundry's scripting environment. It calculates proportional token amounts based on pool reserves and your wallet balances, then interacts with the DODO Proxy contract to add liquidity.
- Automatically loops through a list of DVM pools
- Calculates correct base/quote token ratios for each pool
- Approves tokens if needed
- Adds liquidity with slippage protection
- Foundry installed
- Sufficient balances of base and quote tokens for the pools
- Your private key (for testnet/mainnet, use with caution!)
Create a .env file in the project root with your private key:
PRIVATE_KEY=your_private_key_hereThe script contains a list of DVM pool addresses and their base/quote tokens. You can edit these in script/GasPumpLP.s.sol if needed.
Use Foundry's forge script command to execute:
forge script script/GasPumpLP.s.sol --rpc-url <YOUR_RPC_URL> --broadcast --verify- Replace
<YOUR_RPC_URL>with your Ethereum node RPC URL (e.g., Infura, Alchemy, local node). - The
--broadcastflag sends transactions to the network. - The script will loop through pools and add liquidity if your balances are sufficient.
The script prints detailed logs for each pool:
- Pool address, base/quote tokens
- Pool reserves
- Your balances
- Calculated deposit amounts
- Approval and liquidity actions
- Test on testnet first!
- Do not use your mainnet private key unless you understand the risks.
- The script will attempt to add liquidity up to 15 times (can be changed in the code).
- If you see 'Not enough base/quote token balance', ensure your wallet has sufficient tokens.
- If you get RPC errors, check your RPC URL and network connectivity.
- For custom pool/token addresses, edit the
dvmAddressesanddvmTokenPairsin the script.
For questions or improvements, open an issue or PR!