Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- Marked submodules ai-mcp-pmm-controller, explorer-monorepo, and smom-dbis-138 as dirty to reflect recent changes. - Updated documentation to clarify operator script usage, including dotenv loading and task execution instructions. - Enhanced the README and various index files to provide clearer navigation and task completion guidance. Made-with: Cursor
73 lines
2.8 KiB
Markdown
73 lines
2.8 KiB
Markdown
# Add Liquidity to PMM Pools (Chain 138) — Runbook
|
||
|
||
**Purpose:** Add base/quote liquidity to the three DODO PMM pools on Chain 138 (cUSDT/cUSDC, cUSDT/USDT, cUSDC/USDC).
|
||
|
||
**Prerequisites:**
|
||
- Deployer is **owner** of cUSDT and cUSDC contracts (to mint), or already has balance.
|
||
- `smom-dbis-138/.env` has: `PRIVATE_KEY`, `RPC_URL_138`, `DODO_PMM_INTEGRATION_ADDRESS` (or `DODO_PMM_INTEGRATION`), pool addresses and amounts.
|
||
|
||
---
|
||
|
||
## 0. Mint tokens for liquidity (if deployer has no balance)
|
||
|
||
From `smom-dbis-138/`:
|
||
|
||
```bash
|
||
source .env
|
||
# Mint 1M cUSDT and 1M cUSDC to deployer (default)
|
||
./scripts/mint-for-liquidity.sh
|
||
|
||
# Mint custom amounts (human units)
|
||
MINT_CUSDT_AMOUNT=2000000 MINT_CUSDC_AMOUNT=2000000 ./scripts/mint-for-liquidity.sh
|
||
|
||
# Mint then add liquidity in one go (uses half of minted for cUSDT/cUSDC pool)
|
||
./scripts/mint-for-liquidity.sh --add-liquidity
|
||
```
|
||
|
||
Deployer must be the **owner** of both cUSDT and cUSDC contracts (onlyOwner can mint). Amounts use 6 decimals internally (1M tokens = 1_000_000 × 10^6 base units).
|
||
|
||
**If mint fails:** Ensure `RPC_URL_138` is reachable and deployer is owner (`cast call <CUSDT> "owner()(address)" --rpc-url $RPC_URL_138`). Alternative: use `./scripts/mint-to-750m.sh both <deployer_address>` to mint 749M each (one-time top-up to 750M supply).
|
||
|
||
---
|
||
|
||
## 1. Set pool addresses and amounts in .env
|
||
|
||
Add or set in `smom-dbis-138/.env`:
|
||
|
||
```bash
|
||
# Pool addresses (from PRE_DEPLOYMENT_CHECKLIST / create-all-pmm-pools-chain138.sh)
|
||
POOL_CUSDTCUSDC=0x9fcB06Aa1FD5215DC0E91Fd098aeff4B62fEa5C8
|
||
POOL_CUSDTUSDT=0xa3Ee6091696B28e5497b6F491fA1e99047250c59
|
||
POOL_CUSDCUSDC=0x90bd9Bf18Daa26Af3e814ea224032d015db58Ea5
|
||
|
||
# Amounts in base units (6 decimals): 1M tokens = 1000000000000
|
||
ADD_LIQUIDITY_BASE_AMOUNT=1000000000000
|
||
ADD_LIQUIDITY_QUOTE_AMOUNT=1000000000000
|
||
```
|
||
|
||
Optional per-pool overrides: `ADD_LIQUIDITY_CUSDTCUSDC_BASE`, `ADD_LIQUIDITY_CUSDTCUSDC_QUOTE`, etc.
|
||
|
||
---
|
||
|
||
## 2. Run the add-liquidity script
|
||
|
||
From repo root (or from `smom-dbis-138` with `RPC_URL_138` and `DODO_PMM_INTEGRATION` set):
|
||
|
||
```bash
|
||
cd smom-dbis-138
|
||
source .env
|
||
forge script script/dex/AddLiquidityPMMPoolsChain138.s.sol:AddLiquidityPMMPoolsChain138 \
|
||
--rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" --with-gas-price 1000000000
|
||
```
|
||
|
||
Ensure the deployer has approved (or the script will approve) base/quote tokens to `DODOPMMIntegration` and has sufficient balance for the chosen amounts.
|
||
|
||
---
|
||
|
||
## 3. References
|
||
|
||
- [PMM_POOLS_FUNDING_PLAN.md](PMM_POOLS_FUNDING_PLAN.md) — Full funding plan (three pools, amounts, cast commands, checklist)
|
||
- [DODO_PMM_INTEGRATION.md](../../smom-dbis-138/docs/integration/DODO_PMM_INTEGRATION.md) — `addLiquidity(pool, baseAmount, quoteAmount)`
|
||
- [PRE_DEPLOYMENT_CHECKLIST](PRE_DEPLOYMENT_CHECKLIST.md) § Step 3
|
||
- [DEPLOYMENT_ORDER_OF_OPERATIONS](DEPLOYMENT_ORDER_OF_OPERATIONS.md) § Phase 3.1
|