chore: sync submodule state (parent ref update)
Made-with: Cursor
This commit is contained in:
@@ -29,11 +29,24 @@ DODO PMM Integration enables liquidity pools between CompliantUSDT (cUSDT)/Compl
|
||||
- Manage liquidity provision
|
||||
|
||||
**Key Features**:
|
||||
- Pool creation (cUSDT/USDT, cUSDC/USDC)
|
||||
- Pool creation (cUSDT/USDT, cUSDC/USDC, cUSDT/cUSDC, and generic pairs)
|
||||
- Liquidity management
|
||||
- Swap execution
|
||||
- Price discovery via PMM algorithm
|
||||
|
||||
### Public Pool Pairs (VAULT_SYSTEM_MASTER_TECHNICAL_PLAN §4)
|
||||
|
||||
The Master Plan specifies four **public** liquidity pool types for user routing and price discovery (not primary stabilization):
|
||||
|
||||
| Pair | Creation method | Notes |
|
||||
|------|-----------------|--------|
|
||||
| **cUSDT / cUSDC** | `createCUSDTCUSDCPool(lpFeeRate, initialPrice, k, isOpenTWAP)` | Dedicated function; swap via `swapCUSDTForUSDC` / `swapUSDCForCUSDT`. Register in DODOPMMProvider for getQuote/executeSwap. |
|
||||
| **cUSDT / XAU** | `createPool(cUSDT, xauTokenAddress, ...)` | Requires XAU token address on Chain 138. Use generic `createPool`. |
|
||||
| **cUSDC / XAU** | `createPool(cUSDC, xauTokenAddress, ...)` | Same as above. |
|
||||
| **cEURT / XAU** | `createPool(cEURTAddress, xauTokenAddress, ...)` | Requires cEURT and XAU token addresses on Chain 138. |
|
||||
|
||||
For cUSDT/XAU, cUSDC/XAU, and cEURT/XAU: deploy or obtain token addresses on Chain 138, then call `createPool(baseToken, quoteToken, lpFeeRate, initialPrice, k, isOpenTWAP)` with `POOL_MANAGER_ROLE`. Public pools serve user routing, price discovery, and flash loan access; they do not serve as the primary stabilization engine (see Master Plan private mesh).
|
||||
|
||||
---
|
||||
|
||||
## DODO PMM Overview
|
||||
@@ -261,11 +274,53 @@ cast send $DODO_PMM_INTEGRATION_ADDRESS \
|
||||
|
||||
---
|
||||
|
||||
## Oracle and Reporting
|
||||
|
||||
### Optional ReserveSystem (oracle-backed mid price)
|
||||
|
||||
PMM pool price can be driven by the **ReserveSystem** when base/quote tokens are registered there. This gives reporting and off-chain services an oracle-backed price when available.
|
||||
|
||||
1. **Set ReserveSystem** (admin only):
|
||||
```bash
|
||||
cast send $DODO_PMM_INTEGRATION_ADDRESS \
|
||||
"setReserveSystem(address)" \
|
||||
$RESERVE_SYSTEM_ADDRESS \
|
||||
--rpc-url $RPC_URL --private-key $PRIVATE_KEY
|
||||
```
|
||||
Use `address(0)` to disable and fall back to pool `getMidPrice()` only.
|
||||
|
||||
2. **getPoolPriceOrOracle(pool)** returns: oracle price (via `reserveSystem.getConversionPrice(baseToken, quoteToken)`) if ReserveSystem is set and returns a valid price; otherwise pool `getMidPrice()`.
|
||||
|
||||
3. **DODOPMMProvider** uses `getPoolPriceOrOracle` for quotes, so liquidity provider quotes prefer the oracle when configured.
|
||||
|
||||
### Reporting API and pool indexer
|
||||
|
||||
The **token-aggregation** service indexes PMM pools for `/report/all`, `/report/coingecko`, and `/report/cross-chain` when **CHAIN_138_DODO_PMM_INTEGRATION** is set.
|
||||
|
||||
- Set in token-aggregation `.env`: `CHAIN_138_DODO_PMM_INTEGRATION=<DODOPMMIntegration address>`.
|
||||
- The pool indexer calls `getAllPools()`, then for each pool `getPoolConfig`, `getPoolReserves`, and `getPoolPriceOrOracle` to compute TVL and persist pools to the DB.
|
||||
- Ensure the indexer runs for Chain 138 (cron or on-demand) so report endpoints include PMM pools.
|
||||
|
||||
See also: [PRICE_FEED_SETUP.md](PRICE_FEED_SETUP.md) for ReserveSystem/OraclePriceFeed setup; [ORACLE_AND_KEEPER_CHAIN138.md](ORACLE_AND_KEEPER_CHAIN138.md) for ORACLE_AGGREGATOR/ORACLE_PROXY and keeper flows on Chain 138.
|
||||
|
||||
### PMM price for vault / reporting
|
||||
|
||||
**PMMPriceProvider** (`contracts/vault/adapters/PMMPriceProvider.sol`) exposes `getPrice(asset, quoteToken)` using DODOPMMIntegration’s `getPoolPriceOrOracle`. Use it for vault collateral valuation (e.g. cUSDT/cUSDC in USD terms) or off-chain reporting when the asset is a PMM pair token. Deploy with the DODOPMMIntegration address; see [Vault IMPLEMENTATION_SUMMARY](../vault/IMPLEMENTATION_SUMMARY.md#gru-smart-vault-and-pmm-integration).
|
||||
|
||||
---
|
||||
|
||||
## Query Functions
|
||||
|
||||
### Get Pool Price
|
||||
### Get Pool Price (oracle if configured)
|
||||
|
||||
```bash
|
||||
# Prefer oracle when ReserveSystem is set
|
||||
cast call $DODO_PMM_INTEGRATION_ADDRESS \
|
||||
"getPoolPriceOrOracle(address)" \
|
||||
$POOL_ADDRESS \
|
||||
--rpc-url $RPC_URL
|
||||
|
||||
# Pool mid only (no oracle)
|
||||
cast call $DODO_PMM_INTEGRATION_ADDRESS \
|
||||
"getPoolPrice(address)" \
|
||||
$POOL_ADDRESS \
|
||||
|
||||
Reference in New Issue
Block a user