Skip to content

CR8-USD <-> MUSD parity swap router for cross-vertical settlement #83

@abhicris

Description

@abhicris

Problem

Two stables ship on Create Protocol L1: CR8-USD (cross-vertical settlement, gas) and MUSD (music-vertical settlement, DSP payouts). Agents that span verticals — e.g. an IPTO query that returns a Muzix-indexed catalog and triggers a royalty payout — need to settle one leg in CR8-USD and the other in MUSD without round-tripping through an external DEX.

We need an in-protocol parity swap router that gives 1:1 conversion (modulo a small protocol fee) so settlement is atomic and the agent does not eat slippage on a single-block flow.

Proposed Approach

  1. contracts/StableSwapRouter.sol holds reserves of both stables and mints/burns at parity:
    • swapCR8USDtoMUSD(uint256 amount, address to) — burns CR8-USD, mints MUSD, takes a protocol fee in bps (default 5 bps, configurable by Council vote).
    • swapMUSDtoCR8USD(uint256 amount, address to) — inverse.
  2. Reserve invariant: total CR8-USD + MUSD supply across both is preserved (no inflation). Router holds no excess; mints/burns one-for-one.
  3. Fee accrual: protocol fee accrues to a treasury contract per the standard waterfall (60/30/10 validator / treasury / public-goods split).
  4. Anti-griefing: rate-limit per address (e.g. $100K notional per epoch by default; raised by Council vote for known integrators).
  5. switchboard/swap.py thin client wrapper so AgentEscrow can call the router inline as part of the settle flow.

Acceptance Criteria

  • Router contract deployed and audited (auditor TBD)
  • Parity invariant verified on every swap (no rounding leak)
  • Per-address rate limit enforced
  • AgentEscrow integration: a single settle call can swap legs and release in the target stable
  • Fee accrual visible in treasury balance after a representative test workload

References

  • internal: see Create Protocol PQ L1 architecture RFC section 4 (tokens) and stress-test 2026-06-01 section 2.1
  • Muzix MUSD design doc

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions