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
155 lines
6.9 KiB
Markdown
155 lines
6.9 KiB
Markdown
# PMM Pools Funding Plan - Chain 138
|
|
|
|
**Purpose:** Step-by-step plan to fund the three DODO PMM liquidity pools on Chain 138.
|
|
**Deployer:** `0x4A666F96fC8764181194447A7dFdb7d471b301C8`
|
|
**Integration:** `DODOPMMIntegration` at `0x79cdbaFBaA0FdF9F55D26F360F54cddE5c743F7D`
|
|
|
|
---
|
|
|
|
## 1. The three pools
|
|
|
|
| Pool | Base token | Quote token | Pool address | Fund when |
|
|
|------|------------|-------------|--------------|-----------|
|
|
| **1. cUSDT/cUSDC** | cUSDT | cUSDC | `0x9fcB06Aa1FD5215DC0E91Fd098aeff4B62fEa5C8` | Deployer has cUSDT + cUSDC (mintable) |
|
|
| **2. cUSDT/USDT** | cUSDT | USDT (official) | `0xa3Ee6091696B28e5497b6F491fA1e99047250c59` | Deployer has cUSDT + official USDT |
|
|
| **3. cUSDC/USDC** | cUSDC | USDC (official) | `0x90bd9Bf18Daa26Af3e814ea224032d015db58Ea5` | Deployer has cUSDC + official USDC |
|
|
|
|
- **Pool 1** uses only c* tokens; you can mint both on Chain 138 and fund fully.
|
|
- **Pools 2 and 3** need "official" USDT/USDC on 138 (set in DODOPMMIntegration at deploy time). If those are deployer-owned mocks, mint them too; otherwise fund only from existing balance.
|
|
|
|
---
|
|
|
|
## 2. Token addresses (Chain 138)
|
|
|
|
| Token | Address | Mintable by deployer? |
|
|
|-------|---------|------------------------|
|
|
| cUSDT | `0x93E66202A11B1772E55407B32B44e5Cd8eda7f22` | Yes (owner) |
|
|
| cUSDC | `0xf22258f57794CC8E06237084b353Ab30fFfa640b` | Yes (owner) |
|
|
| Official USDT | From integration: cast call INT "officialUSDT()(address)" | Depends (check owner) |
|
|
| Official USDC | From integration: cast call INT "officialUSDC()(address)" | Depends (check owner) |
|
|
|
|
---
|
|
|
|
## 3. Current state (as of 2026-03-02)
|
|
|
|
- **Pool 1 (cUSDT/cUSDC):** Already funded with 500,000 cUSDT and 500,000 cUSDC (single addLiquidity tx).
|
|
- **Pools 2 and 3:** Not funded yet (require deployer balance of official USDT/USDC on 138).
|
|
- **Deployer c* supply:** 1M+ of each c* minted (including cUSDT, cUSDC) via mint-all-c-star-138.sh and earlier mints.
|
|
|
|
---
|
|
|
|
## 4. Funding plan options
|
|
|
|
### Plan A - Fund only Pool 1 (cUSDT/cUSDC) - recommended first
|
|
|
|
Use only cUSDT and cUSDC; no official USDT/USDC needed.
|
|
|
|
| Step | Action | Command / notes |
|
|
|------|--------|------------------|
|
|
| 1 | Ensure deployer has enough cUSDT and cUSDC | Mint if needed: ./scripts/mint-for-liquidity.sh or ./scripts/mint-all-c-star-138.sh [amount] |
|
|
| 2 | Decide amount per side (base units, 6 decimals) | e.g. 1M each = 1000000000000 (1e12) |
|
|
| 3 | Approve integration to spend cUSDT and cUSDC | See section 5 below (cast) or run add-liquidity script |
|
|
| 4 | Add liquidity to Pool 1 | addLiquidity(POOL_CUSDTCUSDC, baseAmount, quoteAmount) via cast or Forge script |
|
|
|
|
### Plan B - Fund all three pools
|
|
|
|
Requires deployer to hold official USDT and USDC on Chain 138 (in addition to cUSDT/cUSDC).
|
|
|
|
| Step | Action | Command / notes |
|
|
|------|--------|------------------|
|
|
| 1 | Check deployer balances | ./scripts/deployment/check-deployer-balance-chain138-and-funding-plan.sh |
|
|
| 2 | Mint cUSDT/cUSDC (and official USDT/USDC if deployer is owner) | ./scripts/mint-for-liquidity.sh; mint official tokens if contracts allow |
|
|
| 3 | Set .env amounts | ADD_LIQUIDITY_BASE_AMOUNT, ADD_LIQUIDITY_QUOTE_AMOUNT; optionally per-pool overrides |
|
|
| 4 | Add liquidity to all three pools | Forge script (if it compiles) or three separate cast addLiquidity calls |
|
|
|
|
### Plan C - "Half of balance" rule (from existing doc)
|
|
|
|
Use 50% of deployer cUSDT and cUSDC for liquidity; keep the rest for gas/other use.
|
|
|
|
1. Run: RPC_URL_138=<rpc> ./scripts/deployment/check-deployer-balance-chain138-and-funding-plan.sh
|
|
2. Copy the printed ADD_LIQUIDITY_BASE_AMOUNT and ADD_LIQUIDITY_QUOTE_AMOUNT (half of current balances) into smom-dbis-138/.env
|
|
3. Add liquidity (Pool 1 only if you do not have official USDT/USDC) per section 5.
|
|
|
|
---
|
|
|
|
## 5. Commands to add liquidity
|
|
|
|
**Prereqs:** smom-dbis-138/.env with PRIVATE_KEY, RPC_URL_138. Deployer must hold at least the amounts you add.
|
|
|
|
### Option 1 - Cast (reliable; use if Forge script fails)
|
|
|
|
From repo root, with smom-dbis-138/.env sourced:
|
|
|
|
```bash
|
|
cd smom-dbis-138 && source .env
|
|
|
|
INT=0x79cdbaFBaA0FdF9F55D26F360F54cddE5c743F7D
|
|
POOL1=0x9fcB06Aa1FD5215DC0E91Fd098aeff4B62fEa5C8
|
|
CUSDT=0x93E66202A11B1772E55407B32B44e5Cd8eda7f22
|
|
CUSDC=0xf22258f57794CC8E06237084b353Ab30fFfa640b
|
|
RPC="$RPC_URL_138"
|
|
MAX=0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
|
|
|
# Approve (once per token)
|
|
cast send "$CUSDT" "approve(address,uint256)" "$INT" "$MAX" --rpc-url "$RPC" --private-key "$PRIVATE_KEY" --legacy --gas-limit 100000
|
|
cast send "$CUSDC" "approve(address,uint256)" "$INT" "$MAX" --rpc-url "$RPC" --private-key "$PRIVATE_KEY" --legacy --gas-limit 100000
|
|
|
|
# Add liquidity to Pool 1 (amounts in base units, 6 decimals; e.g. 1M = 1000000000000)
|
|
BASE_AMOUNT=1000000000000
|
|
QUOTE_AMOUNT=1000000000000
|
|
cast send "$INT" "addLiquidity(address,uint256,uint256)" "$POOL1" "$BASE_AMOUNT" "$QUOTE_AMOUNT" --rpc-url "$RPC" --private-key "$PRIVATE_KEY" --legacy --gas-limit 500000
|
|
```
|
|
|
|
### Option 2 - Forge script (if it compiles)
|
|
|
|
```bash
|
|
cd smom-dbis-138 && source .env
|
|
export POOL_CUSDTCUSDC=0x9fcB06Aa1FD5215DC0E91Fd098aeff4B62fEa5C8
|
|
export ADD_LIQUIDITY_BASE_AMOUNT=1000000000000
|
|
export ADD_LIQUIDITY_QUOTE_AMOUNT=1000000000000
|
|
|
|
forge script script/dex/AddLiquidityPMMPoolsChain138.s.sol:AddLiquidityPMMPoolsChain138 \
|
|
--rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" --with-gas-price 1000000000 --legacy
|
|
```
|
|
|
|
### Option 3 - Mint and add in one go (Pool 1 only)
|
|
|
|
```bash
|
|
./scripts/mint-for-liquidity.sh --add-liquidity
|
|
```
|
|
|
|
Uses half of minted amounts for Pool 1; requires DODO_PMM_INTEGRATION and pool addresses set in smom-dbis-138/.env.
|
|
|
|
---
|
|
|
|
## 6. Suggested amounts (Pool 1)
|
|
|
|
| Goal | Base (cUSDT) | Quote (cUSDC) | Base units each (6 decimals) |
|
|
|------|----------------|----------------|------------------------------|
|
|
| Light | 100,000 | 100,000 | 100000000000 |
|
|
| Medium | 500,000 | 500,000 | 500000000000 |
|
|
| Heavy | 1,000,000 | 1,000,000 | 1000000000000 |
|
|
| Already added | 500,000 | 500,000 | (done) |
|
|
|
|
You can run the Add liquidity step multiple times to add more (e.g. another 500k/500k for Pool 1).
|
|
|
|
---
|
|
|
|
## 7. Checklist summary
|
|
|
|
- [ ] 1. Run check-deployer-balance-chain138-and-funding-plan.sh and note half-balance amounts.
|
|
- [ ] 2. Mint cUSDT/cUSDC if needed: ./scripts/mint-for-liquidity.sh or ./scripts/mint-all-c-star-138.sh
|
|
- [ ] 3. (Optional) If funding Pools 2 and 3: obtain or mint official USDT/USDC on 138; approve integration.
|
|
- [ ] 4. Approve cUSDT and cUSDC to DODOPMMIntegration (see section 5 Option 1).
|
|
- [ ] 5. Add liquidity to Pool 1 (and optionally Pools 2 and 3) via cast or Forge script.
|
|
- [ ] 6. Verify on explorer: pool balances or LP tokens for deployer.
|
|
|
|
---
|
|
|
|
## 8. References
|
|
|
|
- ADD_LIQUIDITY_PMM_CHAIN138_RUNBOOK.md - Add-liquidity runbook
|
|
- docs/11-references/DEPLOYER_WALLET_FUNDING_PLAN_PMM_POOLS.md - Deployer balances and 50% rule
|
|
- docs/11-references/LIQUIDITY_POOLS_MASTER_MAP.md - Pool addresses and status
|
|
- docs/11-references/TOKENS_AND_NETWORKS_MINTABLE_TO_DEPLOYER.md - How to mint c* on 138
|