Files
proxmox/docs/03-deployment/MAINNET_STANDARD_DODO_POOL_MIGRATION_PLAN.md

113 lines
4.8 KiB
Markdown
Raw Normal View History

# Mainnet Standard DODO Pool Migration Plan
**Purpose:** replace partial-surface Mainnet cW public pools with canonical full-surface DODO pools so routing, explorers, and indexers can treat them as ordinary DODO venues.
## 1. Audit the current factory path
Run:
```bash
bash scripts/verify/audit-mainnet-dodo-standard-pool-readiness.sh
```
This reports:
- `DODO_PMM_INTEGRATION_MAINNET`
- `dodoVendingMachine()` on the live integration
- runtime code size for the integration, factory, and each recorded pool
- integration mapping vs env-backed pool address
- `querySellBase` / `querySellQuote` probe status
- whether `hasStandardPoolSurface(pool)` is set
## 2. Target state
Each replacement pool should satisfy all of the following:
- canonical factory-backed creation path
- `_BASE_TOKEN_` / `_QUOTE_TOKEN_` match the intended pair
- `getVaultReserve`, `getMidPrice`, `_BASE_RESERVE_`, `_QUOTE_RESERVE_` succeed
- `querySellBase` and `querySellQuote` succeed after liquidity is added
- `refreshPoolSurface(pool)` returns `true`
The integration now enforces this for future create-and-seed flows in `smom-dbis-138/contracts/dex/DODOPMMIntegration.sol`.
## 3. Files and scripts to update during replacement rollout
### 3.1 Canonical creation and verification path
- `smom-dbis-138/contracts/dex/DODOPMMIntegration.sol`
This is now the contract-level guardrail. Future replacement pools should be created through this integration and validated after liquidity.
- `smom-dbis-138/script/dex/DeployDODOPMMIntegration.s.sol`
Confirms which `DODO_VENDING_MACHINE_ADDRESS` is wired into the integration deployment.
- `scripts/deployment/deploy-mainnet-public-dodo-wave1-pool.sh`
Main operator entrypoint for creating and seeding replacement Mainnet cW public pools.
- `scripts/verify/check-mainnet-public-dodo-cw-bootstrap-pools.sh`
Post-migration verification for mapping, reserves, and dry-run routability.
- `scripts/verify/audit-mainnet-dodo-standard-pool-readiness.sh`
Migration audit for factory path and standard-surface readiness.
### 3.2 Address and env inventory
Update the env-backed pool address references used by scripts and operators:
- root `.env`
- `.env.master.example`
Pool keys to review and replace as each migration lands:
- `POOL_CWUSDT_USDC_MAINNET`
- `POOL_CWUSDC_USDC_MAINNET`
- `POOL_CWUSDT_USDT_MAINNET`
- `POOL_CWUSDC_USDT_MAINNET`
- `POOL_CWEURC_USDC_MAINNET`
- `POOL_CWGBPC_USDC_MAINNET`
- `POOL_CWAUDC_USDC_MAINNET`
- `POOL_CWCADC_USDC_MAINNET`
- `POOL_CWJPYC_USDC_MAINNET`
- `POOL_CWCHFC_USDC_MAINNET`
Also confirm:
- `DODO_PMM_INTEGRATION_MAINNET`
- `DODO_VENDING_MACHINE_ADDRESS` for the deployment context that creates replacement pools
- any explicit mainnet DODO factory env, if introduced for stricter deployment controls
### 3.3 Routing and public status surfaces
Update the public inventories that describe the active pool set:
- `config/smart-contracts-master.json`
Add or replace canonical Mainnet DODO pool references if this file is used as the public address source of truth.
- `config/aggregator-route-matrix.csv`
- `config/aggregator-route-matrix.json`
Update any rows that embed legacy pool addresses or notes.
- `docs/11-references/PMM_DEX_ROUTING_STATUS.md`
- `docs/03-deployment/MAINNET_PMM_TRUU_CWUSD_PEG_AND_BOT_RUNBOOK.md`
Remove partial-surface caveats only after every active public pool in scope has been replaced and validated.
### 3.4 Swap and operational helpers
Review helpers that may have embedded assumptions or pool references:
- `scripts/deployment/run-mainnet-public-dodo-cw-swap.sh`
- `scripts/deployment/plan-mainnet-cw-stabilization.sh`
- `scripts/verify/check-mainnet-pmm-peg-bot-readiness.sh`
- `scripts/verify/check-full-deployment-status.sh`
- `scripts/README.md`
- `scripts/verify/README.md`
## 4. Recommended rollout sequence
1. Audit the current integration/factory/pool path with `audit-mainnet-dodo-standard-pool-readiness.sh`.
2. Confirm the live integration is wired to the intended canonical DODO factory or adapter.
3. Deploy one replacement pool for a single pair through the integration.
4. Seed liquidity through `addLiquidity(...)`; this now fails unless the pool exposes the standard quote surface.
5. Call `refreshPoolSurface(pool)` and confirm `hasStandardPoolSurface(pool) == true`.
6. Update env/config references for that pair.
7. Run `check-mainnet-public-dodo-cw-bootstrap-pools.sh` and the relevant dry-run/live swap checks.
8. Repeat pair-by-pair, then retire the legacy pool references from public docs and route inventories.
## 5. Immediate migration risk to watch
Because replacement is address-based, any public explorer, route matrix, or env file that still points at the old pool will continue to show the legacy partial-surface behavior even after a correct replacement pool exists. The migration only becomes visible to routers and indexers after those references are updated.