- DODO’s official contract list ([api.dodoex.io/dodo-contract/list?version=v1,v2](https://api.dodoex.io/dodo-contract/list?version=v1,v2)) includes chains such as **1** (Ethereum), **5** (Goerli), **10** (Optimism), **56** (BSC), **133** (Syscoin), **137** (Polygon), **8453** (Base), etc.
- **Chain ID 138 is still not in that list**, so there is no DODO-published canonical DVM factory address for Chain 138.
- This repo now operates a **self-deployed official DODO V2 DVM stack** on Chain 138:
- **`DODO_VENDING_MACHINE_ADDRESS`** in `.env` must point to a Chain 138 factory adapter **you deploy or obtain**; it is not a DODO-listed public address.
- The canonical Chain 138 PMM path is now the **official DODO V2 DVMFactoryAdapter** above, not the earlier mock DVM path.
- Set `DODO_VENDING_MACHINE_ADDRESS` in `.env` to the deployed address, then run `scripts/deployment/run-pmm-and-pools.sh`. Pools created are mocks (no real AMM); swap views return stubs.
1.**Deploy official DODO DVM on Chain 138 (this repo)**
- Submodule **lib/dodo-contractV2** (DODOEX/contractV2) is used to deploy the official DVM stack via Truffle. Our **DVMFactoryAdapter** wraps `createDODOVendingMachine` as `createDVM` so `DODOPMMIntegration` works unchanged.
- The repo deployment helper now runs the vendored DODO tree in a **DVM-only compile mode** by temporarily hiding unrelated Solidity `0.8.x` contracts during `truffle compile` / `truffle migrate`, then restoring them on exit. That allows the official DVM `0.6.9` stack to compile without forking the upstream repo.
- **Current live Chain 138 result:** the repo has already deployed this path and currently uses the addresses listed in the Summary section above.
- **Stable-pair calibration note:** for equal-reserve stable pairs on the official DODO V2 DVM stack, the current canonical Chain 138 pools use `i = 1e18`, `k = 0`, `lpFeeRate = 10 bps`, `isOpenTWAP = false`. Earlier `k = 0.5e18` pools were removed because they priced above parity.
2.**Deploy DVM factory yourself from DODO source (outside this repo)**
- DODO’s contracts are open source: [DODOEX GitHub](https://github.com/DODOEX) (contractV2).
- Deploy **DVMFactory** (and dependencies) to Chain 138, then deploy our **DVMFactoryAdapter** pointing at that factory, set `DODO_VENDING_MACHINE_ADDRESS` to the adapter, and run `run-pmm-and-pools.sh`.
3.**Use an existing DVM factory on Chain 138 (if any)**
- If someone else has already deployed a DODO-compatible DVM factory on Chain 138, set `DODO_VENDING_MACHINE_ADDRESS` to that address.
- We are not aware of any public deployment; you would need to confirm with your network or chain operator.
4.**Leave PMM disabled on Chain 138**
- Keep `DODO_VENDING_MACHINE_ADDRESS` unset.
-`ensure-prerequisites.sh` will continue to warn; `run-pmm-and-pools.sh` will exit until the variable is set.