Skip to content
This repository was archived by the owner on Mar 18, 2026. It is now read-only.

rionnaldi/RiseTestnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GasPumpLP.s.sol: DODO V2 DVM Liquidity Script at Rise Testnet

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.

Features

  • 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

Prerequisites

  • Foundry installed
  • Sufficient balances of base and quote tokens for the pools
  • Your private key (for testnet/mainnet, use with caution!)

How to Use

1. Set Up Environment

Create a .env file in the project root with your private key:

PRIVATE_KEY=your_private_key_here

2. Review/Edit Pool Addresses

The script contains a list of DVM pool addresses and their base/quote tokens. You can edit these in script/GasPumpLP.s.sol if needed.

3. Run the Script

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 --broadcast flag sends transactions to the network.
  • The script will loop through pools and add liquidity if your balances are sufficient.

4. Output

The script prints detailed logs for each pool:

  • Pool address, base/quote tokens
  • Pool reserves
  • Your balances
  • Calculated deposit amounts
  • Approval and liquidity actions

Safety Notes

  • 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).

Troubleshooting

  • 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 dvmAddresses and dvmTokenPairs in the script.

References


For questions or improvements, open an issue or PR!

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors