Skip to content

feat: activate MiamiCoin STX redemption book and sBTC swap vault through Direct Execute - #92

Open
Rapha-btc wants to merge 10 commits into
citycoins:mainfrom
Rapha-btc:review/ccip028-direct-activation
Open

Rapha-btc wants to merge 10 commits into
citycoins:mainfrom
Rapha-btc:review/ccip028-direct-activation

Conversation

@Rapha-btc

@Rapha-btc Rapha-btc commented Nov 5, 2026 •

Copy link
Copy Markdown

MiamiCoin's PoX-5 rewards arrive as sBTC, while redemption offers are denominated
in STX. This change includes the existing CCD015 fair book and CCD016 v2 swap
vault, plus an executable CCIP-028 activation proposal and a reproducible
Clarinet SDK integration suite.

Authorized approvers signal through the existing CCD001 Direct Execute contract.
At its configured threshold, the proposal enables the vault's treasury funding,
sets explicit launch parameters with a zero Pyth fee budget, and initializes the
book's par from the backing/supply formula. It contains no tokenholder ballot
and changes neither the approvers nor their threshold/sunset. Subsequent funding,
conversion and MIA retirement calls are permissionless. The book and vault use
their existing source bytes; their implementations are not rewritten here.

Run npm ci && npm run test:ccip028. The eight integration cases exercise the
complete DAO/Direct Execute/treasury policies and book/vault/proposal against
local market, oracle and token fixtures. They cover authorization, signals,
sunset, duplicate/replayed activation, atomic rollback/retry and a funding-to-burn
cycle. These are local SDK tests; the mainnet-fork runs below cover live state.

Deployment order, source hashes, settings, exact approver call and operational
call sequence are in README-ccip028-activation.md. The existing governance
discussion at citycoins/governance#53 describes an older RFQ implementation;
reviewers should align that specification before authorizing this variant.

No funds are moved by activation, and this PR does not deploy or execute anything.

Verification

Mainnet fork (stxer), final sources, live Jing markets-sbtc-stx-jing-v6-4 / swap-router-sbtc-stx-jing-v5-5. Each run deploys the exact repo bytes (book b3526d4c…, vault ac0c305f…), calls the real Jing, DAO and token contracts, and moves no real funds. Links and saved reports: simulations/README-ccip028-simulations.md.

Scenario Checks
CCIP-028 activation: 3 real approvers, then fund → Jing → sell → book → burn 47/47
Vault coverage 105/105
Vault happy path 59/59
Vault parked on a full book 137/137
Vault batch clock (keyless) 102/102
Vault bounty fixes 97/97
Vault Pyth fee 71/71
Vault emergency, DIA / native price 40/40, 43/43
Vault recovery matrix (10 forks: market/core pause, ladder seats, …) 1,108/1,108
Book par check (2,042.49 STX per 1M MIA vs independent treasury + supply reads) 25/25
Book coverage (offers, par gate, full book, cheapest-first crossing, burn, pause, DAO setters) 270/270

Local (Clarinet SDK): npm run test:ccip028 8/8. Vault runtime suite, book tests and Rendezvous invariants are in tests/vault and tests/rv.

Prior audits: the book and vault went through several paid aibtc audit bounties; every finding and its verdict is in contracts/extensions/README-ccd016-swap-vault-v2.md. An audit bounty on this exact PR is open until 2026-11-19 (aibtc mw4761qx68024266725f).

🤖 Generated with Claude Code

Rapha-btc and others added 10 commits November 5, 2026 18:34
…p vault (ccd016) through Direct Execute

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r spread on v6-4 55/55

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…121 branches) and Rendezvous vault invariants (1000 runs, 0 failed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xer d45fb46d (47/47)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ion and trace-coverage docs, per-contract Clarinet manifests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-5 and final sources, all green

Vault: coverage 105, happy-path 59, parked 137, clock 102, fixes 97, pyth-fee 71,
emergency DIA 40 / native 43, recovery 10 forks 1108. Book (STX par): par-check 25,
coverage 146+124. Live book cleared by real trades per fork; no contract edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, all green

test:vault 387/387, test:book 1/1, rv:ccd016 1000/1000, rv:final invariant 1000/1000,
rv:final test 986/1000 (14 precondition discards), book RV 1000/1000 (self-contained,
npm run rv:ccd015), test:ccip028 8/8. Seed 20261105. No contract edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…final sources

Vault 441/441 body lines, book 167/185 (untraced read-onlys), proposal 23/23; every
partial branch listed with its reason in TRACE-COVERAGE-*.md. Tool: trace-coverage.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
friedger added a commit to Rapha-btc/governance that referenced this pull request Nov 6, 2026
Rewrite the specification to match the reference implementation:
- replace the RFQ desk with the ccd016 keeperless vault (Jing maker-first
  window, then oracle-floored, chunked router liquidation)
- drop the replacement redemption extension; par is a formula-locked
  snapshot in ccd015, refreshed by a Direct Execute proposal
- document the DAO-only buyer, full burn, v2-only offers, book limits and
  the absence of an STX withdrawal from the book
- turn the open questions into decisions, list activation parameters and
  source hashes, and point to the reference implementation
- update the disclosure to the Jing venue (author to confirm details)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant