From ceb852a2f14f109e1dcbebf7cbf59c0136c2460c Mon Sep 17 00:00:00 2001 From: defiQUG Date: Tue, 14 Apr 2026 17:02:09 -0700 Subject: [PATCH] Add MEV external rollout tracker and deploy helper --- ...EV_CHAIN138_ALL_MAINNET_ROLLOUT_TRACKER.md | 97 +++++++++++ .../deploy-mev-backend-ct2421-latest.sh | 152 ++++++++++++++++++ 2 files changed, 249 insertions(+) create mode 100644 docs/04-configuration/MEV_CHAIN138_ALL_MAINNET_ROLLOUT_TRACKER.md create mode 100755 scripts/deployment/deploy-mev-backend-ct2421-latest.sh diff --git a/docs/04-configuration/MEV_CHAIN138_ALL_MAINNET_ROLLOUT_TRACKER.md b/docs/04-configuration/MEV_CHAIN138_ALL_MAINNET_ROLLOUT_TRACKER.md new file mode 100644 index 00000000..71e5b8ec --- /dev/null +++ b/docs/04-configuration/MEV_CHAIN138_ALL_MAINNET_ROLLOUT_TRACKER.md @@ -0,0 +1,97 @@ +# MEV Chain 138 And ALL Mainnet Rollout Tracker + +This tracker is the current authoritative checklist for finishing the automatable +deployment and MEV-integration work for: + +- Chain `138` +- ALL Mainnet `651940` + +It is intentionally split into: + +- repo-side work that can be completed here +- external rollout work that requires live deployments, funding, or chain-side + acceptance + +## Status Legend + +- `done` — completed and verified +- `in_progress` — partially advanced and should continue +- `blocked_external` — requires live contracts, liquidity, or rollout decisions +- `not_started` — no reliable completion evidence yet + +## Shared Platform + +| Area | Status | Notes | +|---|---|---| +| Admin control plane (`/api/health`, `/api/infra`, `/api/stats/freshness`) | `done` | Recovered and validated in earlier MEV slices. | +| Native DODO Chain 138 ingestion | `done` | Recovery and parity work landed. | +| Operator metrics, ops summary, worker metrics, metrics-surfaces | `done` | Repo-side and pushed. | +| Mixed native route validation | `done` | Candidate-route validation and mixed-venue smoke landed. | +| DODO directional fallback quoting | `done` | Shared math and simulation callers updated. | +| Exact protocol-grade math for every required-now protocol | `in_progress` | Improved, but not complete across V3, Curve variants, GMX, dYdX, and full DODO exactness. | +| Full execution adapter parity across all required-now protocols | `in_progress` | Stronger for DODO/native spot flows; broader protocol set still needs completion. | + +## Chain 138 + +### Canonical GRU V2 rollout + +| Task | Status | Notes | +|---|---|---| +| `cUSDT V2` live primary venue deployment | `blocked_external` | Needs final live venue confirmation and seeded liquidity. | +| `cUSDC V2` live primary venue deployment | `blocked_external` | Same as above. | +| Remaining GRU V2 promoted families activated | `blocked_external` | Needs chain-side live venue creation, funding, and acceptance. | +| V1 to V2 route preference cutover | `blocked_external` | Requires seeded V2 depth and rollback window. | + +### Required-now protocol integration on 138 + +| Protocol | Discovery / Inventory | Ingestion / Math | Execution / Settlement | Live Rollout | +|---|---|---|---|---| +| Uniswap v2 | `not_started` | `in_progress` | `not_started` | `blocked_external` | +| Uniswap v3 | `in_progress` | `in_progress` | `not_started` | `blocked_external` | +| Curve | `in_progress` | `in_progress` | `not_started` | `blocked_external` | +| DODO PMM | `done` | `done` | `in_progress` | `in_progress` | +| DODO D3MM | `done` | `in_progress` | `in_progress` | `in_progress` | +| Balancer | `not_started` | `not_started` | `not_started` | `blocked_external` | +| SushiSwap | `not_started` | `not_started` | `not_started` | `blocked_external` | +| 1Inch | `not_started` | `not_started` | `not_started` | `blocked_external` | +| Aave | `not_started` | `not_started` | `not_started` | `blocked_external` | +| GMX | `not_started` | `not_started` | `not_started` | `blocked_external` | +| dYdX | `not_started` | `not_started` | `not_started` | `blocked_external` | + +### Chain 138 external completion checklist + +- register or deploy final live venue addresses +- seed funded liquidity with execution-grade depth +- publish final addresses into canonical deployment inventory +- surface promoted venues in MEV config and admin coverage endpoints +- validate at least one live execution path per promoted protocol family + +## ALL Mainnet `651940` + +| Task | Status | Notes | +|---|---|---| +| Canonical protocol scope confirmed chain-by-chain | `blocked_external` | Scope is documented, but chain-side live venue matrix still needs final publication. | +| Live native venue addresses published | `blocked_external` | No complete acceptance proof in current repo state. | +| Liquidity seeded for promoted families | `blocked_external` | Requires funded live venues. | +| MEV discovery wired for final live venues | `not_started` | Can proceed once final live addresses are available. | +| MEV ingestion validated on live state | `not_started` | Depends on real live venues. | +| Route generation / simulation / execution validated | `not_started` | Depends on above. | +| Settlement and operator acceptance complete | `not_started` | Depends on above. | + +## Fastest Next External Actions + +1. Run the CT deploy helper once SSH to the backend path is responsive: + `bash scripts/deployment/deploy-mev-backend-ct2421-latest.sh --dry-run` +2. Confirm final Chain `138` GRU V2 live venue addresses for: + - `cUSDT V2` + - `cUSDC V2` +3. Seed those venues and verify they appear in inventory and MEV coverage. +4. Publish the final ALL Mainnet native venue matrix before trying to wire full MEV discovery there. + +## Truthful Completion Condition + +This rollout is complete only when: + +1. the repo-side protocol and control-plane work is landed and deployed, and +2. the external venue deployment, seeding, and acceptance work is finished for + both Chain `138` and ALL Mainnet. diff --git a/scripts/deployment/deploy-mev-backend-ct2421-latest.sh b/scripts/deployment/deploy-mev-backend-ct2421-latest.sh new file mode 100755 index 00000000..6a8867e8 --- /dev/null +++ b/scripts/deployment/deploy-mev-backend-ct2421-latest.sh @@ -0,0 +1,152 @@ +#!/usr/bin/env bash +set -euo pipefail + +PVE_HOST="${MEV_BACKEND_PVE_HOST:-192.168.11.14}" +CT_VMID="${MEV_BACKEND_CT_VMID:-2421}" +CT_ROOT="${MEV_BACKEND_CT_ROOT:-/opt/proxmox/MEV_Bot}" +MEV_DIR="${MEV_BACKEND_MEV_DIR:-$CT_ROOT/mev-platform}" +MEV_BRANCH="${MEV_BACKEND_BRANCH:-master}" +PARENT_BRANCH="${MEV_BACKEND_PARENT_BRANCH:-master}" +API_KEY="${MEV_API_KEY:-}" +APPLY=0 + +usage() { + cat <<'EOF' +Usage: deploy-mev-backend-ct2421-latest.sh [options] + +Fast-forward the MEV backend checkout inside CT 2421, rebuild the backend +services in-place, restart the control plane, and run local verification. + +Defaults to dry-run. Re-run with --apply to execute. + +Options: + --pve-host HOST Proxmox host running the MEV backend CT (default: 192.168.11.14) + --ct-vmid VMID MEV backend CT VMID (default: 2421) + --ct-root PATH Parent repo path inside the CT (default: /opt/proxmox/MEV_Bot) + --mev-dir PATH MEV submodule path inside the CT (default: /opt/proxmox/MEV_Bot/mev-platform) + --branch NAME mev-platform branch to fast-forward (default: master) + --parent-branch NAME MEV_Bot branch to fast-forward (default: master) + --api-key KEY Optional API key for protected verification routes + --apply Execute the deployment + -h, --help Show this help +EOF +} + +while [[ $# -gt 0 ]]; do + case "$1" in + --pve-host) + PVE_HOST="$2" + shift 2 + ;; + --ct-vmid) + CT_VMID="$2" + shift 2 + ;; + --ct-root) + CT_ROOT="$2" + shift 2 + ;; + --mev-dir) + MEV_DIR="$2" + shift 2 + ;; + --branch) + MEV_BRANCH="$2" + shift 2 + ;; + --parent-branch) + PARENT_BRANCH="$2" + shift 2 + ;; + --api-key) + API_KEY="$2" + shift 2 + ;; + --apply) + APPLY=1 + shift + ;; + -h|--help) + usage + exit 0 + ;; + *) + echo "Unknown argument: $1" >&2 + usage >&2 + exit 2 + ;; + esac +done + +require_cmd() { + command -v "$1" >/dev/null 2>&1 || { + echo "Required command missing: $1" >&2 + exit 2 + } +} + +require_cmd ssh +require_cmd bash + +REMOTE_CMD=$(cat <