From 2acb6ed877639171a6edbb4677a1931863332170 Mon Sep 17 00:00:00 2001 From: defiQUG Date: Tue, 14 Apr 2026 17:42:25 -0700 Subject: [PATCH] Add mainnet cW micro-support operator helper --- ...EV_CHAIN138_ALL_MAINNET_ROLLOUT_TRACKER.md | 3 + scripts/README.md | 8 ++ .../run-mainnet-cw-micro-support-round.sh | 76 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 scripts/deployment/run-mainnet-cw-micro-support-round.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 index ba587b7e..2c05cc49 100644 --- a/docs/04-configuration/MEV_CHAIN138_ALL_MAINNET_ROLLOUT_TRACKER.md +++ b/docs/04-configuration/MEV_CHAIN138_ALL_MAINNET_ROLLOUT_TRACKER.md @@ -75,6 +75,9 @@ though large parts of the deployment inventory exist. - `bash scripts/deployment/run-mainnet-public-dodo-cw-swap.sh --pair=cwusdc-usdc --direction=base-to-quote --amount=575113 --dry-run` - `bash scripts/deployment/run-mainnet-public-dodo-cw-swap.sh --pair=cwusdt-usdc --direction=base-to-quote --amount=7541 --dry-run` - `bash scripts/deployment/run-mainnet-public-dodo-cw-swap.sh --pair=cwusdc-usdt --direction=base-to-quote --amount=5478 --dry-run` +- One-command wrapper for the same sequence: + - `bash scripts/deployment/run-mainnet-cw-micro-support-round.sh --dry-run` + - re-run with `--apply` only when you intentionally want to broadcast all four support swaps - `2026-04-14` dry-run outputs for those exact support sizes: - `cwusdt-usdt` `8131` raw → `estimatedOut=4038`, `minOut=3997` - `cwusdc-usdc` `575113` raw → `estimatedOut=159283`, `minOut=157690` diff --git a/scripts/README.md b/scripts/README.md index 800f36ff..eddfefe8 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -269,6 +269,14 @@ bash scripts/verify/check-mainnet-public-dodo-cw-bootstrap-pools.sh ``` This checks that the eleven recorded Mainnet DODO cW bootstrap pools (USD rails + non-USD Wave 1 + `cWUSDT/cWUSDC`) are still mapped by the integration, have non-zero reserves, and remain dry-run routable through the repeatable swap helper. +**Current micro-support sweep (default dry-run):** +```bash +bash scripts/deployment/run-mainnet-cw-micro-support-round.sh --dry-run +``` +This runs the currently validated tiny support swaps for `cwusdt-usdt`, `cwusdc-usdc`, `cwusdt-usdc`, and `cwusdc-usdt` in sequence, then points back to `check-mainnet-pmm-peg-bot-readiness.sh`. + +Re-run with `--apply` only when you intentionally want to broadcast the full four-leg support round. + ### 15. Mainnet DODO Wave 1 pool deploy helper Repeatable helper for creating and seeding a first-tier Mainnet DODO PMM Wave 1 `cW* / USDC` pair. diff --git a/scripts/deployment/run-mainnet-cw-micro-support-round.sh b/scripts/deployment/run-mainnet-cw-micro-support-round.sh new file mode 100644 index 00000000..6bb13c56 --- /dev/null +++ b/scripts/deployment/run-mainnet-cw-micro-support-round.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Deterministic micro-support sweep for the four current Mainnet cW/USD public PMM rails. +# +# Purpose: +# - run the current validated tiny support swaps in one sequence +# - default to dry-run for safe operator review +# - preserve explicit pair/direction/amount choices in one place +# +# Usage: +# bash scripts/deployment/run-mainnet-cw-micro-support-round.sh --dry-run +# bash scripts/deployment/run-mainnet-cw-micro-support-round.sh --apply + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROXMOX_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" +SWAP_HELPER="${PROXMOX_ROOT}/scripts/deployment/run-mainnet-public-dodo-cw-swap.sh" + +DRY_RUN=1 + +for arg in "$@"; do + case "$arg" in + --dry-run) + DRY_RUN=1 + ;; + --apply) + DRY_RUN=0 + ;; + -h|--help) + sed -n '1,20p' "$0" + exit 0 + ;; + *) + echo "[fail] unknown arg: $arg" >&2 + exit 2 + ;; + esac +done + +DRY_FLAG=() +if (( DRY_RUN == 1 )); then + DRY_FLAG=(--dry-run) +else + echo "[warn] --apply will broadcast four Mainnet PMM support swaps in sequence." >&2 +fi + +run_leg() { + local pair="$1" + local direction="$2" + local amount="$3" + + echo + echo "=== $pair $direction amount=$amount dryRun=$DRY_RUN ===" + bash "$SWAP_HELPER" \ + --pair="$pair" \ + --direction="$direction" \ + --amount="$amount" \ + "${DRY_FLAG[@]}" +} + +echo "=== Mainnet cW micro-support round ===" +echo "Validated support amounts:" +echo "- cwusdt-usdt base-to-quote 8131" +echo "- cwusdc-usdc base-to-quote 575113" +echo "- cwusdt-usdc base-to-quote 7541" +echo "- cwusdc-usdt base-to-quote 5478" + +run_leg "cwusdt-usdt" "base-to-quote" "8131" +run_leg "cwusdc-usdc" "base-to-quote" "575113" +run_leg "cwusdt-usdc" "base-to-quote" "7541" +run_leg "cwusdc-usdt" "base-to-quote" "5478" + +echo +echo "=== post-check ===" +echo "bash scripts/verify/check-mainnet-pmm-peg-bot-readiness.sh" +