From 9e0795dbc453f2285880dbf62e72513dd3f4370c Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 19:05:36 +0000 Subject: [PATCH 1/2] ci(phoenix): workflow_dispatch reinstall for phoenix-deploy-api on CT 5700 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes the gap where phoenix-deploy-api/server.js on master is the real implementation, but the running service on CT 5700 is the older stub that returns 'Deploy request queued (stub)' for every target. The new workflow .gitea/workflows/bootstrap-phoenix-deploy-api.yml is manual-only (workflow_dispatch). When triggered it: 1. Validates the repo layout (phoenix-deploy-api/server.js MUST NOT contain the stub string). 2. Tars phoenix-deploy-api/ + config/public-sector-program-manifest.json into a deploy bundle. 3. scp's the bundle to the PVE node that hosts CT 5700 using a dedicated deploy SSH key (PHOENIX_PVE_SSH_KEY repo secret). 4. pct push / pct exec the bundle into the CT and runs the existing phoenix-deploy-api/scripts/install-systemd.sh which already drops /opt/phoenix-deploy-api/, writes the systemd unit, and restarts the service. 5. Health-checks GET http://:4001/health (with retry). 6. Posts a non-stub probe: POST /api/deploy with target __bootstrap_probe__ + the deploy bearer token. Fails the workflow if the response body still contains 'Deploy request queued (stub)' or any auth-rejection signal. That gives an unambiguous post-bootstrap health signal in CI logs without depending on a successful real deploy. Required new secrets (documented in docs/04-configuration/DEVIN_GITEA_PROXMOX_CICD.md section 3a): PHOENIX_PVE_HOST, PHOENIX_PVE_USER (default root), PHOENIX_PVE_SSH_KEY, PHOENIX_PVE_KNOWN_HOSTS (optional), PHOENIX_DEV_VM_VMID (default 5700), PHOENIX_DEPLOY_DEV_VM_IP (default 192.168.11.59). Triggered manually only — bootstrap is sensitive enough that we do NOT fire on every master push. Once the running service on CT 5700 is post-stub, the existing deploy job in deploy-to-phoenix.yml will actually execute scripts/deployment/deploy-atomic-swap-dapp-5801.sh on each push instead of returning a 202 stub. Co-Authored-By: Nakamoto, S --- .../bootstrap-phoenix-deploy-api.yml | 210 ++++++++++++++++++ .../DEVIN_GITEA_PROXMOX_CICD.md | 34 +++ 2 files changed, 244 insertions(+) create mode 100644 .gitea/workflows/bootstrap-phoenix-deploy-api.yml diff --git a/.gitea/workflows/bootstrap-phoenix-deploy-api.yml b/.gitea/workflows/bootstrap-phoenix-deploy-api.yml new file mode 100644 index 00000000..9512f72d --- /dev/null +++ b/.gitea/workflows/bootstrap-phoenix-deploy-api.yml @@ -0,0 +1,210 @@ +name: Bootstrap Phoenix Deploy API + +# Reinstalls phoenix-deploy-api on the dev VM (CT 5700) with the latest server.js +# from master. This is the missing link between "code on master is the real +# implementation" and "running service on CT 5700 still has the stub". Run this +# workflow_dispatch job whenever phoenix-deploy-api/server.js, deploy-targets.json +# or related scripts change and you need the running service to pick up the change +# without a manual LAN visit. +# +# Required Gitea repo secrets (Settings -> Secrets): +# PHOENIX_PVE_HOST PVE node IP that hosts CT 5700 (e.g. 192.168.11.12) +# PHOENIX_PVE_USER SSH user on the PVE node (default: root) +# PHOENIX_PVE_SSH_KEY Private SSH key (PEM, OpenSSH format) authorised on the PVE node +# PHOENIX_PVE_KNOWN_HOSTS Pre-populated known_hosts entry for the PVE node (avoids strict-host prompt) +# PHOENIX_DEV_VM_VMID Container VMID (default: 5700) +# PHOENIX_DEPLOY_DEV_VM_IP IP of the dev VM for the post-install health check (default: 192.168.11.59) +# PHOENIX_DEPLOY_URL Phoenix deploy webhook URL (already used by deploy job) +# PHOENIX_DEPLOY_TOKEN Bearer token for the webhook (already used by deploy job) +# +# Trigger only via Gitea UI (Actions tab -> "Bootstrap Phoenix Deploy API" -> Run +# workflow). NOT triggered on push: reinstalling the deploy service is sensitive +# enough that we want it gated behind a manual click. + +on: + workflow_dispatch: + inputs: + verify_only: + description: "If true, only run the post-install /health + auth probe and skip the reinstall step." + type: boolean + required: false + default: false + +jobs: + bootstrap: + runs-on: ubuntu-latest + steps: + - name: Checkout proxmox repo + uses: actions/checkout@v4 + + - name: Validate repo layout + run: | + set -euo pipefail + test -d phoenix-deploy-api || { echo "phoenix-deploy-api/ missing" >&2; exit 1; } + test -f phoenix-deploy-api/server.js + test -f phoenix-deploy-api/scripts/install-systemd.sh + test -f phoenix-deploy-api/deploy-targets.json + # Manifest is optional; warn if missing but do not fail. + if [ ! -f config/public-sector-program-manifest.json ]; then + echo "::warning::config/public-sector-program-manifest.json missing — install will warn on CT" + fi + # Make sure the running master implementation is NOT the stub message + # that triggered this whole bootstrap thread. + if grep -q "Deploy request queued (stub)" phoenix-deploy-api/server.js; then + echo "phoenix-deploy-api/server.js still contains the stub string — refusing to bootstrap." >&2 + exit 1 + fi + + - name: Install SSH key for PVE access + if: ${{ github.event.inputs.verify_only != 'true' }} + run: | + set -euo pipefail + mkdir -p "$HOME/.ssh" + chmod 700 "$HOME/.ssh" + umask 077 + printf '%s\n' "${{ secrets.PHOENIX_PVE_SSH_KEY }}" > "$HOME/.ssh/id_pve" + chmod 600 "$HOME/.ssh/id_pve" + if [ -n "${{ secrets.PHOENIX_PVE_KNOWN_HOSTS }}" ]; then + printf '%s\n' "${{ secrets.PHOENIX_PVE_KNOWN_HOSTS }}" > "$HOME/.ssh/known_hosts" + chmod 644 "$HOME/.ssh/known_hosts" + else + # Fall back to accept-new on first connect; subsequent connects pin. + touch "$HOME/.ssh/known_hosts" + chmod 644 "$HOME/.ssh/known_hosts" + fi + + - name: Build deploy bundle + if: ${{ github.event.inputs.verify_only != 'true' }} + run: | + set -euo pipefail + mkdir -p .out + if [ -f config/public-sector-program-manifest.json ]; then + tar czf .out/pda-deploy-bundle.tar.gz \ + phoenix-deploy-api \ + config/public-sector-program-manifest.json + else + tar czf .out/pda-deploy-bundle.tar.gz phoenix-deploy-api + fi + ls -lh .out/pda-deploy-bundle.tar.gz + + - name: scp bundle to PVE host + if: ${{ github.event.inputs.verify_only != 'true' }} + env: + PVE_HOST: ${{ secrets.PHOENIX_PVE_HOST }} + PVE_USER: ${{ secrets.PHOENIX_PVE_USER }} + run: | + set -euo pipefail + : "${PVE_HOST:?PHOENIX_PVE_HOST not set in repo secrets}" + PVE_USER_VAL="${PVE_USER:-root}" + KNOWN_HOSTS_OPT="-o UserKnownHostsFile=$HOME/.ssh/known_hosts" + if [ ! -s "$HOME/.ssh/known_hosts" ]; then + KNOWN_HOSTS_OPT="$KNOWN_HOSTS_OPT -o StrictHostKeyChecking=accept-new" + else + KNOWN_HOSTS_OPT="$KNOWN_HOSTS_OPT -o StrictHostKeyChecking=yes" + fi + scp -i "$HOME/.ssh/id_pve" $KNOWN_HOSTS_OPT \ + -o ConnectTimeout=20 \ + .out/pda-deploy-bundle.tar.gz \ + "${PVE_USER_VAL}@${PVE_HOST}:/tmp/pda-deploy-bundle.tar.gz" + + - name: pct push + install-systemd on CT + if: ${{ github.event.inputs.verify_only != 'true' }} + env: + PVE_HOST: ${{ secrets.PHOENIX_PVE_HOST }} + PVE_USER: ${{ secrets.PHOENIX_PVE_USER }} + VMID: ${{ secrets.PHOENIX_DEV_VM_VMID }} + run: | + set -euo pipefail + : "${PVE_HOST:?PHOENIX_PVE_HOST not set in repo secrets}" + PVE_USER_VAL="${PVE_USER:-root}" + VMID_VAL="${VMID:-5700}" + KNOWN_HOSTS_OPT="-o UserKnownHostsFile=$HOME/.ssh/known_hosts" + if [ ! -s "$HOME/.ssh/known_hosts" ]; then + KNOWN_HOSTS_OPT="$KNOWN_HOSTS_OPT -o StrictHostKeyChecking=accept-new" + else + KNOWN_HOSTS_OPT="$KNOWN_HOSTS_OPT -o StrictHostKeyChecking=yes" + fi + ssh -i "$HOME/.ssh/id_pve" $KNOWN_HOSTS_OPT \ + -o ConnectTimeout=20 \ + "${PVE_USER_VAL}@${PVE_HOST}" "VMID=${VMID_VAL} bash -s" <<'REMOTE_EOF' + set -euo pipefail + : "${VMID:?}" + # Verify CT exists and is running. + if ! pct status "${VMID}" >/dev/null 2>&1; then + echo "CT ${VMID} not found on this PVE node." >&2 + exit 1 + fi + if ! pct exec "${VMID}" -- true 2>/dev/null; then + echo "CT ${VMID} not running. Start it first: pct start ${VMID}" >&2 + exit 1 + fi + STAGE="/tmp/proxmox-pda-stage" + pct push "${VMID}" /tmp/pda-deploy-bundle.tar.gz /root/pda-deploy.tar.gz + pct exec "${VMID}" -- bash -c " + set -euo pipefail + rm -rf '${STAGE}' + mkdir -p '${STAGE}' + tar xzf /root/pda-deploy.tar.gz -C '${STAGE}' + cd '${STAGE}' + bash phoenix-deploy-api/scripts/install-systemd.sh + rm -f /root/pda-deploy.tar.gz + " + rm -f /tmp/pda-deploy-bundle.tar.gz + REMOTE_EOF + + - name: Health check (no auth) + env: + DEV_VM_IP: ${{ secrets.PHOENIX_DEPLOY_DEV_VM_IP }} + run: | + set -euo pipefail + IP="${DEV_VM_IP:-192.168.11.59}" + # Service may take a moment to come up after install; retry briefly. + for i in 1 2 3 4 5 6; do + if curl -sSf -m 5 "http://${IP}:4001/health" -o /tmp/health.json; then + echo "Health check OK on attempt ${i}" + cat /tmp/health.json || true + echo + break + fi + echo "Health check attempt ${i}/6 failed; sleeping 3s" + sleep 3 + if [ "${i}" = "6" ]; then + echo "Phoenix Deploy API /health unreachable after install." >&2 + exit 1 + fi + done + + - name: Auth + non-stub probe (POST with bogus target) + env: + PHOENIX_DEPLOY_URL: ${{ secrets.PHOENIX_DEPLOY_URL }} + PHOENIX_DEPLOY_TOKEN: ${{ secrets.PHOENIX_DEPLOY_TOKEN }} + run: | + set -euo pipefail + : "${PHOENIX_DEPLOY_URL:?}" + : "${PHOENIX_DEPLOY_TOKEN:?}" + # POST a bogus target. The post-bootstrap server should: + # - accept the bearer token (NOT 401) + # - reject the unknown target with a non-stub error + # The pre-bootstrap stub returned 202 with "Deploy request queued (stub)" + # for ANY target. So we explicitly check the response body does NOT + # contain that stub phrase. + BODY="$(curl -sS -m 10 -X POST "${PHOENIX_DEPLOY_URL}" \ + -H "Authorization: Bearer ${PHOENIX_DEPLOY_TOKEN}" \ + -H "Content-Type: application/json" \ + -d '{"repo":"d-bis/proxmox","sha":"HEAD","branch":"master","target":"__bootstrap_probe__"}' || true)" + echo "Response body:" + echo "${BODY}" + if echo "${BODY}" | grep -q 'Deploy request queued (stub)'; then + echo "::error::Phoenix Deploy API still returning stub response — bootstrap did not take effect." + exit 1 + fi + if echo "${BODY}" | grep -qi 'unauthorized\|invalid token\|401'; then + echo "::error::Phoenix Deploy API rejected the bearer token. PHOENIX_DEPLOY_TOKEN is out of sync with PHOENIX_DEPLOY_SECRET on the CT." + exit 1 + fi + echo "Phoenix Deploy API is post-stub and authenticating correctly." + + - name: Cleanup secrets + if: always() + run: | + rm -f "$HOME/.ssh/id_pve" "$HOME/.ssh/known_hosts" || true diff --git a/docs/04-configuration/DEVIN_GITEA_PROXMOX_CICD.md b/docs/04-configuration/DEVIN_GITEA_PROXMOX_CICD.md index 6af93eae..053909b7 100644 --- a/docs/04-configuration/DEVIN_GITEA_PROXMOX_CICD.md +++ b/docs/04-configuration/DEVIN_GITEA_PROXMOX_CICD.md @@ -119,6 +119,40 @@ For webhook signing, the bootstrap/helper path also expects: Do not enable both repo Actions deploys and webhook deploys for the same repo unless you intentionally want duplicate deploy attempts. +### 3a. Bootstrap workflow secrets (one-time per CT) + +The reinstall workflow `.gitea/workflows/bootstrap-phoenix-deploy-api.yml` +ships the latest `phoenix-deploy-api/` from `master` to CT 5700 via +scp + `pct push` and re-runs `install-systemd.sh`. This is the path you +take when the running service on the CT is older than the code on +`master` (e.g. it still returns the "Deploy request queued (stub)" +message). Trigger via the Gitea Actions UI → "Bootstrap Phoenix Deploy +API" → Run workflow. + +Required secrets (in addition to the deploy secrets above): + +- `PHOENIX_PVE_HOST` — PVE node IP that hosts CT 5700 (e.g. + `192.168.11.12` for `r630-02`). +- `PHOENIX_PVE_USER` — SSH user on the PVE node (default `root`). +- `PHOENIX_PVE_SSH_KEY` — Private SSH key (OpenSSH format) authorised + on the PVE node. Use a dedicated deploy key, not your personal key. +- `PHOENIX_PVE_KNOWN_HOSTS` — Pre-populated `known_hosts` line for the + PVE host (skip strict-host-key prompt). Optional; if absent the + workflow uses `accept-new` on first connect. +- `PHOENIX_DEV_VM_VMID` — Container VMID (default `5700`). +- `PHOENIX_DEPLOY_DEV_VM_IP` — IP of the dev VM for the post-install + health check (default `192.168.11.59`). + +After a successful run the workflow performs a non-stub probe: it POSTs +`{ "target": "__bootstrap_probe__" }` with the deploy bearer token and +fails the workflow if the response body still contains +`Deploy request queued (stub)` or any auth-rejection signal. That gives +you an unambiguous "the running service on CT 5700 is now post-stub" +signal in CI logs. + +The workflow only triggers on `workflow_dispatch` (never on push) so +deploy-service reinstalls remain a deliberate manual step. + ## Adding more repos or VM targets Extend [deploy-targets.json](/home/intlc/projects/proxmox/phoenix-deploy-api/deploy-targets.json) with another entry. -- 2.34.1 From 9286a95fcec430f9908d073eabc58887ea54774e Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 04:19:06 +0000 Subject: [PATCH 2/2] docs(chain138): canonicalize Stack-A DODO PMM stack (live, traded) On-chain probe (2026-04-22) confirms two parallel DODOPMM deployments on Chain 138. Stack A is the live, traded one: - DODOPMMIntegration (Stack A): 0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895 - DODOPMMProvider (Stack A): 0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e - 8 registered pools, all isKnownPool=true, with traded liquidity (cUSDT/cUSDC, cUSDT/USDT, cUSDC/USDC, cBTC/cUSDT, cBTC/cUSDC, WETH/USDC, WETH/USDT, cBTC/cXAUC). Stack B (DODOPMMIntegration=0x5BDc62f1..., DODOPMMProvider=0x5CAe6Ce1..., pools 0xff8d3b8f.../0x6fc60D.../0x9f74Be...) is a parallel deployment with seeded but un-traded pools (10M/10M flat or 0/0). Earlier docs that cited Stack B as canonical are superseded. Updates: - .cursor/rules/chain138-tokens-and-pmm.mdc: replace integration + pool addresses with Stack A; add provider, cBTC, and full live-pool table. - docs/11-references/ADDRESS_MATRIX_AND_STATUS.md: re-version to 2026-04-22; show both stacks with status flags; add 5 cBTC/WETH pools; flip EnhancedSwapRouter row from Not deployed to Pending Phase 3. - docs/11-references/PMM_DEX_ROUTING_STATUS.md: rewrite executive summary; refer to Phase 3 LAN deploy command. No code change. Companion to atomic-swap-dapp PR #4 (frontend routing-honesty) and the upcoming Phase 3 EnhancedSwapRouter deploy. Co-Authored-By: Nakamoto, S --- .cursor/rules/chain138-tokens-and-pmm.mdc | 18 +++++++++-- .../ADDRESS_MATRIX_AND_STATUS.md | 30 ++++++++++++------- docs/11-references/PMM_DEX_ROUTING_STATUS.md | 26 +++++++++------- 3 files changed, 52 insertions(+), 22 deletions(-) diff --git a/.cursor/rules/chain138-tokens-and-pmm.mdc b/.cursor/rules/chain138-tokens-and-pmm.mdc index dd909425..a0b7adb8 100644 --- a/.cursor/rules/chain138-tokens-and-pmm.mdc +++ b/.cursor/rules/chain138-tokens-and-pmm.mdc @@ -10,9 +10,23 @@ alwaysApply: true - **cUSDT:** `0x93E66202A11B1772E55407B32B44e5Cd8eda7f22` (6 decimals) - **cUSDC:** `0xf22258f57794CC8E06237084b353Ab30fFfa640b` (6 decimals) -**DODOPMMIntegration:** `0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` — reconciled with `docs/11-references/ADDRESS_MATRIX_AND_STATUS.md` (on-chain verification 2026-03-26); `compliantUSDT()` / `compliantUSDC()` return the canonical cUSDT/cUSDC above. +**DODOPMMIntegration (live, traded):** `0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` — confirmed live via on-chain probe (2026-04-22): `compliantUSDT()` / `compliantUSDC()` return the canonical cUSDT/cUSDC above; `pools[][]` mapping resolves to the live funded pool set below; `isRegisteredPool` is TRUE for all 8 pools listed under "PMM pools (live, traded)". `0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` is a parallel deployment of the same source with different immutables and seeded but un-traded pools — do not wire dApps or routers to it. -**PMM pools (live funded public):** cUSDT/cUSDC `0xff8d3b8fDF7B112759F076B69f4271D4209C0849` | cUSDT/USDT `0x6fc60DEDc92a2047062294488539992710b99D71` | cUSDC/USDC `0x9f74Be42725f2Aa072a9E0CdCce0E7203C510263` — see `docs/11-references/ADDRESS_MATRIX_AND_STATUS.md` / `PMM_DEX_ROUTING_STATUS.md`. +**DODOPMMProvider (ILiquidityProvider, live):** `0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e` — `dodoIntegration() == 0x86ADA6Ef…`, `providerName() == "DODO PMM"`, `isKnownPool` TRUE for all 8 live pools. Use this address as `dodoLiquidityProvider` when deploying `EnhancedSwapRouter`; see `docs/11-references/PMM_DEX_ROUTING_STATUS.md`. + +**PMM pools (live, traded — 2026-04-22 on-chain probe):** +- cUSDT/cUSDC `0x9e89bAe009adf128782E19e8341996c596ac40dC` (~983k cUSDT / ~1.016M cUSDC, asymmetric — actively traded) +- cUSDT/USDT `0x866Cb44b59303d8dc5f4F9E3E7A8e8b0bf238d66` (~1M / ~1M) +- cUSDC/USDC `0xc39B7D0F40838cbFb54649d327f49a6DAC964062` (~1M / ~1M) +- cBTC/cUSDT `0x67049e7333481e2cac91af61403ac7bddfab7bcd` (10k cBTC base / 9M cUSDT quote) +- cBTC/cUSDC `0x72f1a0794153c3b8a1e8a731f1d8e1a52cb10dc5` (10k cBTC base / 9M cUSDC quote) +- WETH/USDC `0xb53a0508940b1ff90f1aad4f6cb50a7012fe5593` (~10.1M USDC quote) +- WETH/USDT `0xe227f6c0520c0c6e8786fe56fa76c4914f861533` (~10.1M USDT quote) +- cBTC/cXAUC `0xf3e8a07d419b61f002114e64d79f7cf8f7989433` (10k cBTC base / 1.7k cXAUC quote) + +The earlier rule's pool addresses (`0xff8d3b8f…`, `0x6fc60D…`, `0x9f74Be…`) belong to the **parallel** integration `0x5BDc62f1…` (Stack B) and are seeded 10M/10M flat or 0/0 — they are not the live PMM trading set. Source-of-truth corrections to follow in `ADDRESS_MATRIX_AND_STATUS.md` and `PMM_DEX_ROUTING_STATUS.md`. + +**cBTC:** `0xe94260c555ac1d9d3cc9e1632883452ebdf0082e` (8 decimals) — base token of the three cBTC pools above. **cXAUC / cXAUT (XAU):** `0x290E52a8819A4fbD0714E517225429aA2B70EC6b`, `0x94e408E26c6FD8F4ee00b54dF19082FDA07dC96E` (6 decimals). **1 full token = 1 troy ounce Au** — not USD face value; see `EXPLORER_TOKEN_LIST_CROSSCHECK.md` section 5.1. diff --git a/docs/11-references/ADDRESS_MATRIX_AND_STATUS.md b/docs/11-references/ADDRESS_MATRIX_AND_STATUS.md index eb9afd87..6261c9c2 100644 --- a/docs/11-references/ADDRESS_MATRIX_AND_STATUS.md +++ b/docs/11-references/ADDRESS_MATRIX_AND_STATUS.md @@ -1,7 +1,7 @@ # Address Matrix and Status — Correlated Reference -**Last Updated:** 2026-03-26 -**Purpose:** Single correlated matrix of all existing contract, token, and pool addresses with deployment status. **On-chain verification (2026-03-26):** corrected Chain 138 PMM stack verified at `DODOPMMIntegration=0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` and `DODOPMMProvider=0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381`; desired-state inventory is fully reconciled with `104` existing pools and `104` aligned routes. +**Last Updated:** 2026-04-22 +**Purpose:** Single correlated matrix of all existing contract, token, and pool addresses with deployment status. **On-chain verification (2026-04-22):** the **live, traded** Chain 138 PMM stack is `DODOPMMIntegration=0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` + `DODOPMMProvider=0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e`. A second parallel deployment (`DODOPMMIntegration=0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` + `DODOPMMProvider=0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381`) exists with seeded but un-traded pools — do not wire dApps or routers to it. Earlier docs that cited the `0x5BDc62f1…` stack as canonical were superseded by this re-verification. **Sources:** CONTRACT_ADDRESSES_REFERENCE, CHAIN138_TOKEN_ADDRESSES, LIQUIDITY_POOLS_MASTER_MAP, DEPLOYED_COINS_TOKENS_AND_NETWORKS, env examples, PRE_DEPLOYMENT_CHECKLIST. --- @@ -108,12 +108,22 @@ | Contract / pool | Address | Status | Notes | |-----------------|---------|--------|-------| -| DODOPMMIntegration | `0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` | ✅ | Corrected canonical integration; full JSON desired-state reconciled | -| DODOPMMProvider | `0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381` | ✅ | Corrected canonical provider; 104 aligned routes | +| DODOPMMIntegration (Stack A, live) | `0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` | ✅ | Live, traded integration; backs all 8 active PMM pools (2026-04-22 on-chain probe) | +| DODOPMMProvider (Stack A, live) | `0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e` | ✅ | `dodoIntegration() == 0x86ADA6Ef…`, `providerName() == "DODO PMM"`, `isKnownPool` TRUE for all 8 Stack A pools | +| DODOPMMIntegration (Stack B, parallel) | `0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` | ⚠ | Same source, different immutables; pools seeded but un-traded — do not wire dApps/routers to it | +| DODOPMMProvider (Stack B, parallel) | `0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381` | ⚠ | Pairs with the Stack B integration; superseded by Stack A for canonical use | | PrivatePoolRegistry | `0xb27057B27db09e8Df353AF722c299f200519882A` | ✅ | Live private XAU pool registry | -| Pool cUSDT/cUSDC | `0xff8d3b8fDF7B112759F076B69f4271D4209C0849` | ✅ | Funded live | -| Pool cUSDT/USDT (official mirror) | `0x6fc60DEDc92a2047062294488539992710b99D71` | ✅ | Intended funded canonical pool; integration/provider mapping must be repointed if still on older empty pool | -| Pool cUSDC/USDC (official mirror) | `0x9f74Be42725f2Aa072a9E0CdCce0E7203C510263` | ✅ | Canonical corrected-stack pool | +| Pool cUSDT/cUSDC (Stack A, traded) | `0x9e89bAe009adf128782E19e8341996c596ac40dC` | ✅ | Live, asymmetric balances (≈983.9k cUSDT / ≈1.016M cUSDC) — actively traded | +| Pool cUSDT/USDT (Stack A) | `0x866Cb44b59303d8dc5f4F9E3E7A8e8b0bf238d66` | ✅ | Live (≈1M / ≈1M) | +| Pool cUSDC/USDC (Stack A) | `0xc39B7D0F40838cbFb54649d327f49a6DAC964062` | ✅ | Live (≈1M / ≈1M) | +| Pool cBTC/cUSDT (Stack A) | `0x67049e7333481e2cac91af61403ac7bddfab7bcd` | ✅ | Live (10k cBTC / 9M cUSDT) | +| Pool cBTC/cUSDC (Stack A) | `0x72f1a0794153c3b8a1e8a731f1d8e1a52cb10dc5` | ✅ | Live (10k cBTC / 9M cUSDC) | +| Pool WETH/USDC (Stack A) | `0xb53a0508940b1ff90f1aad4f6cb50a7012fe5593` | ✅ | Live (≈10.1M USDC quote) | +| Pool WETH/USDT (Stack A) | `0xe227f6c0520c0c6e8786fe56fa76c4914f861533` | ✅ | Live (≈10.1M USDT quote) | +| Pool cBTC/cXAUC (Stack A) | `0xf3e8a07d419b61f002114e64d79f7cf8f7989433` | ✅ | Live (10k cBTC / 1.74k cXAUC) | +| Pool cUSDT/cUSDC (Stack B, seeded) | `0xff8d3b8fDF7B112759F076B69f4271D4209C0849` | ⚠ | 10M / 10M flat — not traded; superseded by Stack A pool above | +| Pool cUSDT/USDT (Stack B, seeded) | `0x6fc60DEDc92a2047062294488539992710b99D71` | ⚠ | 10M / 10M flat — not traded; superseded by Stack A pool above | +| Pool cUSDC/USDC (Stack B, empty) | `0x9f74Be42725f2Aa072a9E0CdCce0E7203C510263` | ⚠ | 0 / 0 zero liquidity; superseded by Stack A pool above | | Pool cUSDT/cXAUC (public) | `0x1AA55E2001E5651349AfF5A63FD7A7Ae44f0F1b0` | ✅ | Funded live | | Pool cUSDC/cXAUC (public) | `0xEA9Ac6357CaCB42a83b9082B870610363B177cBa` | ✅ | Funded live | | Pool cEURT/cXAUC (public) | `0xbA99bc1eAAC164569d5AcA96C806934DDaF970Cf` | ✅ | Funded live | @@ -121,7 +131,7 @@ | Pool cUSDC/cXAUC (private) | `0x7867D58567948e5b9908F1057055Ee4440de0851` | ✅ | Funded live | | Pool cEURT/cXAUC (private) | `0x505403093826D494983A93b43Aa0B8601078A44e` | ✅ | Funded live | | LiquidityPoolETH (trustless) | — | ❌ | Placeholder 0x0 | -| EnhancedSwapRouter | — | ❌ | Not deployed | +| EnhancedSwapRouter | — | ⏳ | Pending Phase 3 LAN deploy; see `test-plans/phase3-enhancedswaprouter-deploy-command.md` (Stack A wiring) | ### 1.7 TransactionMirror / deployer @@ -193,8 +203,8 @@ Bridges (CCIPWETH9 / CCIPWETH10) and LINK funding per runbook. Addresses in `smo | Env variable (Chain 138) | Canonical address | |--------------------------|-------------------| -| DODO_PMM_INTEGRATION_ADDRESS | `0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` | -| DODO_PMM_PROVIDER_ADDRESS | `0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381` | +| DODO_PMM_INTEGRATION_ADDRESS | `0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` (Stack A, live) | +| DODO_PMM_PROVIDER_ADDRESS | `0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e` (Stack A, live) | | PRIVATE_POOL_REGISTRY | `0xb27057B27db09e8Df353AF722c299f200519882A` | | POOL_CUSDTCUSDC | `0xff8d3b8fDF7B112759F076B69f4271D4209C0849` | | POOL_CUSDTUSDT | `0x6fc60DEDc92a2047062294488539992710b99D71` | diff --git a/docs/11-references/PMM_DEX_ROUTING_STATUS.md b/docs/11-references/PMM_DEX_ROUTING_STATUS.md index 8d9d9d5c..d40c4b09 100644 --- a/docs/11-references/PMM_DEX_ROUTING_STATUS.md +++ b/docs/11-references/PMM_DEX_ROUTING_STATUS.md @@ -1,16 +1,19 @@ # PMM Liquidity Pools & DEX/DeFi Routing — Full System Status -**Last Updated:** 2026-03-26 +**Last Updated:** 2026-04-22 **Purpose:** Single reference for DEX/DeFi and PMM liquidity pool routing — what is designed, deployed, and in use. --- -## Executive summary (updated 2026-03-26) +## Executive summary (updated 2026-04-22) -- **DODOPMMIntegration** is **deployed** on Chain 138 at `0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d`. The corrected canonical stack now has **104 desired-state pools aligned**. -- **DODOPMMProvider** is **deployed** at `0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381` with **104/104 provider routes aligned** to the integration. -- **Live funded public pools** are: cUSDT/cUSDC (`0xff8d3b8fDF7B112759F076B69f4271D4209C0849`), cUSDT/USDT (`0x6fc60DEDc92a2047062294488539992710b99D71`), cUSDC/USDC (`0x9f74Be42725f2Aa072a9E0CdCce0E7203C510263`), cUSDT/cXAUC (`0x94316511621430423a2cff0C036902BAB4aA70c2`), cUSDC/cXAUC (`0x7867D58567948e5b9908F1057055Ee4440de0851`), cEURT/cXAUC (`0x505403093826D494983A93b43Aa0B8601078A44e`). -- **EnhancedSwapRouter** is **not deployed**; multi-provider DEX routing (Uniswap/Balancer/Curve/1inch) is not live. +- **Two parallel DODOPMM deployments exist on Chain 138.** On-chain probe (2026-04-22) shows the **live, traded** stack is **Stack A**: + - **DODOPMMIntegration (Stack A)** `0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` — 8 registered, actively-traded pools. + - **DODOPMMProvider (Stack A)** `0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e` — wired to Stack A integration; `isKnownPool` TRUE for all 8 Stack A pools. + - The **Stack B** stack (`DODOPMMIntegration=0x5BDc62f1…` / `DODOPMMProvider=0x5CAe6Ce1…`) is a parallel deployment with seeded but un-traded pools (10M/10M flat, cUSDC/USDC at 0/0). Do **not** wire dApps or routers to Stack B. Earlier docs that cited Stack B as canonical were superseded by this re-verification. +- **Live funded, traded Stack-A pools (2026-04-22 probe):** cUSDT/cUSDC `0x9e89bAe0…`, cUSDT/USDT `0x866Cb44b…`, cUSDC/USDC `0xc39B7D0F…`, cBTC/cUSDT `0x67049e73…`, cBTC/cUSDC `0x72f1a079…`, WETH/USDC `0xb53a0508…`, WETH/USDT `0xe227f6c0…`, cBTC/cXAUC `0xf3e8a07d…`. The funded XAU pools `0x9431…`/`0x7867…`/`0x5054…` remain live but on the legacy XAU registry, not the Stack A integration. +- **EnhancedSwapRouter** is **not yet deployed**; the Phase 3 LAN deploy command (Stack-A wiring) is staged in `test-plans/phase3-enhancedswaprouter-deploy-command.md` with `DODO_PMM_PROVIDER_ADDRESS=0x3f729632…` + `UNISWAP_V3_ROUTER=0xde9cd8ee…` + `BALANCER_VAULT=0x96423d7c…`. Multi-provider DEX routing (Uniswap V3 + Balancer + DODO via Stack A) goes live with this deploy. +- **Phase 1 / 2 dApp work (2026-04-22):** the atomic-swap dApp at `https://atomic-swap.defi-oracle.io/` was failing because its quote handler ignored 4 of 6 protocols. PR #2 (mobile bridge + max-approve) and PR #4 (routing-honesty + protocol/executor mismatch chip) addressed the UI side; this stack-A canonicalization addresses the on-chain side. - **Token-aggregation** service is implemented and runnable (single-hop quotes; can index DODO pools). **Bridge quote API** (swap+bridge+swap) is implemented. - **Full system status:** PMM liquidity and DODOPMMProvider routing are **deployed and in use** on Chain 138. Remaining: add liquidity to pools as needed; optionally deploy EnhancedSwapRouter when other DEX pools exist on 138. - **Optional items completed (2026-02-27 / 2026-03-01):** DeployCompliantFiatTokens (10 tokens on 138); Blockscout verification run; MCP allowlist-138 (`ai-mcp-pmm-controller/config/allowlist-138.json`); add-liquidity runbook ([ADD_LIQUIDITY_PMM_CHAIN138_RUNBOOK](../03-deployment/ADD_LIQUIDITY_PMM_CHAIN138_RUNBOOK.md)); token-aggregation canonical fallbacks for cEURC/cEURT/cGBP*/cAUDC/cJPYC/cCHFC/cCADC/cXAU*; ENV_EXAMPLE_CONTENT + CREATE2_FACTORY_ADDRESS; E2E routing verification run. @@ -45,10 +48,13 @@ | Component | Status | Address / Notes | |-----------|--------|------------------| -| **DODOPMMIntegration** | Deployed | `0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` — corrected canonical integration. | -| **PMM pools (desired-state)** | **104 aligned** | Full desired-state JSON reconciled; live funded public pools are listed in [LIQUIDITY_POOLS_MASTER_MAP](LIQUIDITY_POOLS_MASTER_MAP.md). | -| **DODOPMMProvider** | **Deployed** | `0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381`; 104/104 routes aligned to the corrected integration. | -| **EnhancedSwapRouter** | Not deployed | Deploy when Uniswap/Balancer pools exist on 138; configure quoter and Balancer poolId. | +| **DODOPMMIntegration (Stack A, live)** | Deployed | `0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` — canonical, actively traded; backs all 8 Stack-A pools. | +| **DODOPMMProvider (Stack A, live)** | Deployed | `0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e`; `isKnownPool` TRUE for all 8 Stack-A pools; use as `dodoLiquidityProvider` for `EnhancedSwapRouter`. | +| **DODOPMMIntegration (Stack B, parallel)** | Deployed | `0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` — same source, different immutables; pools seeded but un-traded; do not wire to it. | +| **DODOPMMProvider (Stack B, parallel)** | Deployed | `0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381` — pairs with Stack B integration; superseded by Stack A. | +| **PMM pools (Stack A, traded)** | Live | 8 pools registered + traded. See [ADDRESS_MATRIX_AND_STATUS](ADDRESS_MATRIX_AND_STATUS.md) §1.6. | +| **PMM pools (Stack B, seeded)** | Live but un-traded | 3 pools at flat 10M/10M (or 0/0). Superseded by Stack A. | +| **EnhancedSwapRouter** | Pending deploy | Phase 3 LAN deploy command staged (`test-plans/phase3-enhancedswaprouter-deploy-command.md`). Deploys with UniV3 + Balancer + DODO Stack A wired; Curve/1inch slots inert. | | **LiquidityPoolETH** (trustless bridge) | Placeholder | Not deployed; config uses `0x0`. | **Doc note:** [LIQUIDITY_POOLS_MASTER_MAP.md](LIQUIDITY_POOLS_MASTER_MAP.md) and [ADDRESS_MATRIX_AND_STATUS.md](ADDRESS_MATRIX_AND_STATUS.md) list pool and DODOPMMProvider addresses. DEX_AND_CROSS_CHAIN_CONTRACTS_NEEDED reflects DODOPMMIntegration deployed and pools created. -- 2.34.1