USC Protocol
System Documentation

A revenue-generating, dual-collateral stablecoin system spanning a dedicated Cosmos EVM chain and Ethereum — with an internal credit module, bond market, AMM, and automated cross-chain revenue engine.

⚠ Testnet Version ● v2 Live — Cosmos 9000 + Sepolia 10 contracts Deployed July 11, 2026

01What USC Protocol Is

USC is a $1 stablecoin backed by a dual-collateral basket — 80% mETH (synthetic ETH, 1:1 backed by real ETH locked on Ethereum) and 20% WCAPE (the wrapped native token of the protocol's own chain). Every part of the system feeds one loop: real fee revenue is harvested, converted to backing, and paid out as yield to USC holders who lock their coins.

Fully collateralised

Every USC is minted against mETH + WCAPE at live oracle prices. Redeemable at any time for the underlying basket.

Revenue from day one

Bridge fees (0.1% in / 0.2% out), mint & redeem fees (0.1%), AMM swap fees (0.3%), and staking yield on bridged ETH (3.5% APR, simulated on testnet).

Internal credit market

The Treasury Credit Module (TCM) pays 4–7% APR on 90-day locked USC — the rate tracks the support ratio, is fixed the day you deposit (grandfathered), and is funded entirely by the protocol's own fees.

Dual-chain

Real ETH lives on Ethereum (Sepolia). All protocol logic runs on a dedicated Cosmos EVM chain (ID 9000, native token CAPE) with 1-second blocks.

CAPE demand engine

The 20% WCAPE backing requirement means every USC minted creates structural buy pressure for CAPE — absorbing supply distributed by the LPBonder's emissions budget.

Self-defending peg

An autonomous liquidity loop borrows against staked ETH when support falls below 1.02 and repays automatically above 1.30 — sized smoothly by the live deficit, no human trigger.

Testnet status This is the testnet build. ETH staking yield is simulated (3.5% APR accounting, no real staking), the bridge is operated by a single relayer, prices come from CoinGecko/Chainlink via one updater, and the chain runs a single validator. The production roadmap (audits, decentralised relaying, real staking via Lido/EigenLayer) is in §9 Roadmap.

02Architecture

Two chains, one relayer, ten contracts. Ethereum holds the real ETH; the Cosmos EVM chain runs everything else.

ETHEREUM SEPOLIA Chain 11155111 · real ETH Merchant.sol Locks real ETH · bridge fees 30% reserve / 70% staked Chainlink ETH/USD price source RELAYER watches events both ways pushes prices every 60 s triggers revenue harvest 24 h COSMOS EVM CHAIN Chain 9000 · native CAPE · 1 s blocks MerchantBridge mints / burns mETH PriceOracle ETH + CAPE USD Treasury mints/redeems USC · 80% mETH / 20% WCAPE · harvests fees CapePool mETH/WCAPE AMM TCM 90 d · 4–7% grandfathered LPBonder bond CLP · 5% disc · 5 d Tokens USC · mETH · WCAPE
High-level topology — the relayer is the only component that spans both chains.

Infrastructure

ComponentDetail
Cosmos EVM nodeEvmos v19, chain ID 9000 (usc_9000-1), native denom acape, 1 s blocks. Runs as evmosd systemd service with auto-recovery wrapper (height-mismatch auto-reset + auto-redeploy + auto-funding).
Ethereum sideReal Sepolia via Alchemy RPC. Merchant contract holds bridged ETH.
RelayerNode.js service (usc-relayer). Watches ETHDeposited (Sepolia → mint mETH), RedemptionRequested (Cosmos → release ETH), ProtocolRevenueReady (Sepolia → mint revenue mETH). Pushes ETH/USD + CAPE/USD to PriceOracle every 60 s.
DeterminismContract addresses are deterministic (deployer + nonce) — chain resets always redeploy to identical addresses.

03The Four Tokens

TokenTypeWhat it isSupply mechanics
USCERC-20The $1 stablecoin. The product.Minted/burned only by Treasury against the 80/20 basket at oracle prices.
mETHERC-20Synthetic ETH on the Cosmos chain. Always 1:1 with real ETH locked in Merchant on Sepolia.Minted by MerchantBridge on deposit, burned on redemption. Also minted for verified protocol revenue.
CAPENativeGas token of the Cosmos chain. The protocol's equity-like asset.Fixed genesis supply. Distributed via the LPBonder's emissions budget; demanded via the 20% backing rule.
WCAPEERC-20Wrapped CAPE (WETH9 pattern). What contracts actually hold.1:1 wrap/unwrap of native CAPE — no privileged minting; total supply always equals CAPE locked in the wrapper.
CLPERC-20CapePool LP share (mETH/WCAPE). The bondable asset — and, once bonded, permanent Treasury backing.Minted/burned by permissionless add/removeLiquidity (Uniswap-V2 share math). Appreciates from the 0.3% swap fee.
Why the 20% WCAPE leg exists It is a deliberate demand engine, not just diversification. Every USC minted forces the minter to acquire CAPE worth 20% of the mint — structural buy pressure that absorbs the CAPE distributed through bonding. The Treasury becomes the largest CAPE holder over time, and rising USC demand mechanically bids CAPE.

04Contract Reference

Nine contracts on the Cosmos chain, one on Sepolia. All verified line-by-line against the deployed source.

Treasury — the mint

Issues and redeems USC against the 80/20 basket, accumulates protocol revenue as mETH, and harvests it into TCM rewards. Roles: DEFAULT_ADMIN_ROLE (deployer), OPERATOR_ROLE (deployer + MerchantBridge).

FunctionAccessBehaviour
buyUSC(meth, cape, applyFee)publicPulls mETH + WCAPE (must be 80/20 by USD value ±2%), mints USC = deposit value. 0.1% fee on the mETH side when applyFee (fee → protocolMethBalance). The bonder route passes false.
sellUSC(usc)publicBurns USC, returns mETH (80%) + WCAPE (20%) at current prices. 0.1% fee: mETH-equivalent moves to revenue pool; the CAPE share of the fee stays as excess backing.
harvestToTCM()public (permissionless)Swaps 20% of protocolMethBalance for WCAPE via CapePool, adds all to backing, mints USC of equal value straight into TCM's rewards pool.
receiveBacking(meth, cape)OPERATORInjects collateral without minting USC — used by the emergency liquidity loop.
receiveProtocolRevenue(meth)OPERATORAccepts bridged revenue mETH into protocolMethBalance.
calcUscSupport()viewBacking USD ÷ active supply (TCM-held USC excluded). Backing = mETH + WCAPE + CLP at fair value. Returns uint256.max when active supply is zero.
registerLpAndMint(lp) v2OPERATOR (LPBonder)Pulls CLP as permanent backing, mints equal-value USC straight into the TCM rewards pool. Fair pricing: P_lp = 2·√(methUsd·capeUsd)/S — manipulation-resistant (uses oracle prices + pool invariant, not raw reserves).
harvestLpFees() v2public (relayer, daily)Converts swap-fee growth on Treasury-held CLP into USC → TCM. Fee isolation via √k-per-share: grows only from fees, immune to price moves and proportional add/remove. Support-neutral by construction.
releaseBacking(meth, cape) v2OPERATOR (bridge)Controlled outflow for loop repayment. Hard guard: reverts unless post-release support ≥ 1.20.
previewBuy / previewSell / fairLpPrice / activeUscSupplyviewQuote + metric helpers for frontends and the loop controller.

TreasuryCreditModule (TCM) v2 — the savings bank

Lock USC for 90 days at a grandfathered APR: the rate in force the day you deposit is written into your deposit and never changes for its duration. The rate offered to new deposits is a smooth linear function of the support ratio — 7% at support ≤ 1.00, 4% at ≥ 1.50 (rate = 7% − 3%·(s−1.0)/0.5). Weak peg → higher rate → more locking → active supply shrinks → peg recovers: the deposit rate is itself a peg-defense instrument. Interest remains capped by the rewards pool (solvency), and locked USC is excluded from the support denominator.

FunctionBehaviour
deposit(amount)Locks USC; snapshots aprAtDeposit = rateFromSupport(now) into the deposit.
withdraw(id)After 90 days: principal + amount × aprAtDeposit × elapsed/year, capped by rewards pool.
allocateRewards(amount)Open — Treasury feeds the rewards pool (harvests, LP registrations, LP fees).
currentAPR() / currentDepositAPR()The rate NEW deposits would lock in right now.
setTreasury(addr)One-time wiring (owner) — lets the rate curve read the live support ratio.

LPBonder v2 — the CAPE distributor (replaced CapeBonder)

Bond CLP tokens (not the raw basket) at a 5% discount, fixed on the deposit day — CAPE price moves during the 5-day lock change nothing. The CLP flows to the Treasury as permanent backing; equal-value USC is minted into TCM rewards. Because the deposited liquidity stays inside the pool, every bond deepens the market that must later absorb its own payout — and keeps earning the 0.3% swap fee for the protocol forever.

Payouts come from a 1,000,000 WCAPE emissions budget endowed at deploy (contracts cannot mint native CAPE — it's the gas token; the hard-capped genesis endowment is the on-chain equivalent of thin-air emissions, with the cap visible as capeReserve). Owed CAPE is reserved at purchase time, so the bonder can never over-promise.

// payout for lpAmount of CLP at CAPE = $P (both frozen at deposit block) usdValue = lpAmount × fairLpPrice capeOwed = usdValue / (P × 0.95) // ≈ +5.26% bonus, fixed forever
FunctionBehaviour
buyBond(lpAmount)Pulls CLP, freezes capeOwed, routes CLP → Treasury.registerLpAndMint() → USC → TCM.
claimBond(id)After 5 days: transfers the reserved WCAPE (unwrap to native anytime).
previewBond(lp)Quote: USD value + CAPE owed right now.
topUpReserve(amount)Anyone can extend the emissions budget.

CapePool v2 — the AMM, now with LP tokens

Constant-product (x·y=k) pool for mETH/WCAPE with a 0.30% fee that stays in reserves (k grows → CLP appreciates). Now issues ERC-20 LP shares ("CLP") with Uniswap-V2 share math, and liquidity is permissionless. Triple duty: price discovery, harvest venue, open market — plus it now mints the asset the LPBonder runs on.

FunctionBehaviour
addLiquidity(meth, cape) v2Permissionless; mints CLP (first mint: √(m·c) − 1000 locked; later: proportional). Use quoteAddLiquidity() to size the WCAPE side.
removeLiquidity(lp) v2Burns CLP for proportional reserves.
swapMethForCape / swapCapeForMethStandard x·y=k swaps, 0.30% fee.
getCapePrice / getCapeOut / getMethOutPrice + quotes (unchanged interfaces).
sqrtKPerShare() v2√k per CLP (grows only from fees) — the Treasury's fee-isolation metric.

MerchantBridge (Cosmos) & Merchant (Sepolia) — the bridge pair

Merchant (Sepolia) locks real ETH: depositETH() takes 0.1% in-fee, splits net 30% reserve / 70% staked (simulated 3.5% APR), and emits ETHDeposited. releaseETH() (relayer-only) pays out redemptions minus 0.2% out-fee. harvestRevenue() (permissionless) bundles accrued fees + simulated yield and emits ProtocolRevenueReady.

MerchantBridge v2 (Cosmos) is the mirror: mintBridge() (relayer-only) mints mETH 1:1 on deposits; redeemBridge() burns user mETH and signals the relayer; mintProtocolRevenue() (relayer-only) mints revenue mETH into the Treasury. The liquidity loop is now a fully autonomous, permissionless controller: executeLiquidityLoop() fires only when support < 1.02, sized smoothly to lift it to exactly 1.05 (over-collateralised model: debt ≤ 70% of pledged staked ETH — a fixed constant, like real lending terms; loan proceeds re-join staking so staged capacity converges to ~2.33× real staked); repayLiquidityLoop() fires when support > 1.30 and retires debt down to a 1.20 floor, hard-guarded by Treasury.releaseBacking(). Both have 1-hour cooldowns; the relayer checks every 5 minutes. Loop mETH is never added to totalLocked — synthetic supply can never enlarge the bridge-out allowance. The pool-seed mETH is also minted directly (not via the bridge), so bridge counters reflect only real Sepolia deposits.

Supporting contracts

ContractPurpose
USCTokenERC-20, mint/burn restricted to Treasury via roles.
MerchantETHERC-20 mETH, mint/burn restricted to MerchantBridge via roles. No rebase, no yield — staking yield flows to TCM as USC instead.
WCAPEWETH9-style wrapper for native CAPE. deposit() / withdraw(), always 1:1 backed.
PriceOracleStores ETH/USD and CAPE/USD (18-decimal). Only the relayer (updater) or owner can push. Exposes isStale() (2 h threshold) — advisory, does not revert reads.

05System Flows

① Bridge in: ETH → mETH

User calls Merchant.depositETH() on Sepolia with real ETH.
0.1% bridge fee is retained; net amount is split 30% reserve / 70% staked (accounting). ETHDeposited(user, net) fires.
Relayer sees the event (3 confirmations) and calls MerchantBridge.mintBridge(user, net) on Cosmos.
User receives mETH 1:1 on the Cosmos chain — usually within a couple of minutes.

② Mint USC

User holds mETH and WCAPE (wrap native CAPE, or buy WCAPE from CapePool with mETH — this purchase is the CAPE demand mechanism).
User approves both tokens and calls Treasury.buyUSC(meth, cape, true). Value ratio must be 80/20 (±2%).
0.1% fee (mETH side) accrues to the revenue pool. USC equal to the net deposit value is minted to the user.

③ The revenue loop (automatic, ~24 h)

harvestRevenue() fees + 3.5% yield · Sepolia Relayer ProtocolRevenueReady mintProtocolRevenue mETH minted → protocolMethBalance harvestToTCM() 20% → WCAPE swap mint USC vs backing TCM rewards depositor yield
Real fees become depositor yield — no external capital involved. Mint/redeem fees and bond flushes feed the same pool.

④ Bond LP tokens

User adds mETH + WCAPE to CapePool (permissionless) → receives CLP shares.
User calls LPBonder.buyBond(lpAmount). Value and CAPE owed are frozen at this block: value ÷ (CAPE price × 0.95) — a 5.26% bonus, immune to later price moves. Reserved from the emissions budget immediately.
CLP flows to the Treasury as permanent backing; equal-value USC is minted straight into TCM rewards — bonds fund depositor yield and deepen the pool at once.
After 5 days, claimBond(id) pays out the WCAPE (unwrap to native CAPE anytime).

⑤ Autonomous liquidity loop (v2)

The relayer checks support every 5 minutes. Below 1.02, executeLiquidityLoop() fires (permissionless — anyone may call).
Loan size = exactly the deficit to reach 1.05 support, capped by stage capacity (debt ≤ 70% of pledged staked ETH). mETH is minted as over-collateralised loan proceeds.
80% goes to Treasury backing; 20% buys WCAPE from CapePool (supporting CAPE in stress); both enter via receiveBacking()no new USC minted. Fresh loan ETH re-joins staking, raising next-stage capacity while the deficit persists.
Recovery: above 1.30 support, repayLiquidityLoop() automatically pulls backing (guarded ≥ 1.20 post-release), converts the WCAPE leg back, and burns the recovered mETH — the loan is repaid, collateral freed.

⑥ Bridge out: mETH → ETH

User calls MerchantBridge.redeemBridge(amount) — mETH is burned, RedemptionRequested fires.
Relayer calls Merchant.releaseETH(user, amount) on Sepolia; 0.2% out-fee retained; net real ETH sent to the user.

06Economic Design

The support ratio

activeSupply = totalEmittedUsc − usc.balanceOf(TCM) backing = totalMeth × ETH_price + totalCape × CAPE_price + totalLp × fairLpPrice // v2: CLP counts as backing supportRatio = backing / activeSupply // loop bands: < 1.02 borrow → 1.05 · idle · > 1.30 repay → 1.20 floor

USC locked in the TCM (deposits + rewards pool) is off the market — it cannot create redemption pressure — so it is excluded from the denominator. This has an elegant consequence: USC minted by harvestToTCM() goes straight into the TCM, so harvests raise backing while leaving active supply flat. Every harvest strictly improves the ratio.

Revenue sources

SourceRateDestination
Bridge deposit fee0.1% (inflow — cheap on purpose)All accumulate as mETH in protocolMethBalanceharvestToTCM() → TCM depositor yield
Bridge redemption fee0.2% (outflow — costlier)
Mint / redeem fee0.1% each side
ETH staking yield3.5% APR on 70% of bridged ETH (simulated on testnet)
AMM swap fee0.3%Accrues into CLP value; the Treasury's CLP share is converted to USC → TCM rewards by the daily harvestLpFees()
Bond (LP route)100% of bonded CLP valueCLP → permanent Treasury backing; USC minted → directly to TCM rewards

Cost of capital

The protocol "borrows" from its own TCM depositors at ≤6% APR, funded entirely by internal fee revenue — no dependency on external capital markets. This is the foundation of the Phase 2 credit facility: lend TCM capacity at 9–12% against a 6% internal cost, keeping a 3–6% spread.

CAPE flywheel — design intent and current gap

Intent: the LPBonder distributes CAPE into the market; the 20% backing rule makes every USC mint buy it back. More USC demand → more CAPE locked in Treasury → scarcer float. The v2 LP design also helps structurally: bonded liquidity deepens the very pool that must absorb bond-exit sells.

Known gap (testnet finding) Per $100 bonded, the bonder locks $20 of CAPE but releases ~$105 of reserve CAPE after 5 days — net +$85 circulating CAPE per bond, and bond buyers are natural sellers of the 5% arb. Mint demand must outpace bond emission or CAPE price sags, which thins the 20% backing leg. Candidate fixes on the roadmap: vested/auto-staked bond payouts, veCAPE utility (APR boost, fee rebates, credit priority), revenue share to CAPE stakers, revenue-funded buyback-and-lock, and a dynamic bond discount that throttles when CAPE weakens.

Locked design decisions

DecisionRationale
TCM-held USC excluded from support denominatorLocked USC cannot run on the Treasury.
Fee only on the mETH side of buyUSCWCAPE enters untouched — avoids double-penalising the CAPE leg.
Credit USC = regular USC (no separate cUSC)Accounting-only separation; credit-line protocols are blocked from sellUSC(), ordinary holders always redeemable.
No flash loans; no external yield on TCM fundsExternal smart-contract risk not worth it at this stage.
One bonder type active at a timePrevents stacked WCAPE sell pressure.
Governance tokens as credit-line conditionAccumulate influence in borrower protocols without a separate bonder.

07Parameter Sheet

ParameterValueWhere
Collateral ratio80% mETH / 20% WCAPE (±2% tolerance)Treasury
Mint / redeem fee0.10%Treasury FEE_BPS
Bridge fees0.10% deposit · 0.20% redeemMerchant
Staking APR (simulated)3.50% on staked ETHMerchant
Bridge ETH split30% reserved / 70% stakedMerchant + MerchantBridge
TCM lock / APR90 days / 4–7% (support-linked, grandfathered per deposit)TCM v2
Bond discount / lock5% fixed at deposit day / 5 daysLPBonder
LPBonder emissions budget1,000,000 WCAPE (genesis endowment, hard-capped)LPBonder
Loop bandsborrow < 1.02 → target 1.05 · repay > 1.30 → floor 1.20MerchantBridge v2
Loop borrow LTV / cooldown70% of pledged stakedEth (fixed constant) / 1 hMerchantBridge v2
AMM swap fee0.30%CapePool
Oracle push cadence / staleness~60 s / 2 h advisoryRelayer + PriceOracle
Harvest cadence~24 h (relayer timer)Relayer

08Current Deployment (Testnet)

Cosmos EVM — chain 9000

ContractAddress
WCAPE0xC5dfeab583C6bD8A5E536b17Fc35E6D1ED6680F1
MerchantETH (mETH)0x208293e3D6720FDE6b8367463C4773b98C5707DD
USCToken0xcC4f9d2C7Db111bF3ac915440508E57e9c66E09e
PriceOracle0x5073C4C6FE8a53c93cEBD5eE9Ddc821464C65e58
CapePool0x61b716980210717A5c0ea5B9DA6A6Be0671e1Cba
Treasury0x9551871cA9e60fB0C28c831F1E87E1ae37f3a584
TreasuryCreditModule0xc82dD71f4132a701f1c1919C41cD463E6A633D63
LPBonder0x0d6A28655e4c042aD2CD8B280A940442231C0978
MerchantBridge0x04646a987c535B5aA40A75AAF014E91b0fCfa66A

Ethereum Sepolia — chain 11155111

ContractAddress
Merchant (bridge entry)0x1F44B649c247E7ED743BABA62F4b9722d8eEF0Ba
Address permanence Cosmos addresses are deterministic (deployer + nonce). Chain resets redeploy to identical addresses — frontends and relayer configs never need updating.
Resilience (Sessions 6–9) The node self-heals: evmosd-wrapper.sh auto-detects height mismatches after ungraceful reboots and resets the chain; usc-autosetup redeploys contracts and refunds wallets automatically; the relayer retries on connection loss, persists processed bridge events (no double-mints/double-releases across restarts), and runs the loop manager + daily harvests. The ETH leg was migrated from local Anvil to real Sepolia (July 2026).
Manual deploy rule (Session 9 lesson) Never run a manual deploy while usc-autosetup can fire — it races the deploy with the same key and scrambles the deterministic addresses. systemctl disable does NOT prevent it (evmosd's hook starts it explicitly) and mask fails (unit lives in /etc). Working method: sudo sed -i '1a exit 0 # TEMP-DISABLED-FOR-DEPLOY' /home/micha/usc-autosetup.sh before, remove the line after, and verify the deployer nonce is 0x0 before deploying. Full runbook in UPGRADE_NOTES.md.

09Roadmap — The DeFi Central Bank

The stablecoin is the foundation. The endgame is a full-stack monetary system: currency, savings rate, credit facility, deposit insurance, and settlement.

Phase 2a — LPBonder ✅ SHIPPED (v2, July 2026)

LP tokens as Treasury backing — live. Three revenue streams per bond: discount, USC to TCM, perpetual swap fees harvested daily. Deeper pool → less harvest slippage → better yields.

Phase 2 — CreditFacility + CreditAdapter

Lend TCM capacity to whitelisted protocols at 9–12% (6% internal cost). Enforcement stack: algorithmic credit score, destination whitelisting, RevenueInterceptor (auto-repayment from borrower fee income), governance-token deposits, quarterly maintenance fee.

Phase 3 — InsurancePool (DeFi FDIC)

Protocols pay 0.5–2% annual premiums on TVL → "USC Insured" badge. Depositors covered up to 80% (max 10,000 USC). Claims paid from accumulated reserves — never from new USC. TCM backstops catastrophic events.

Endgame — Settlement layer

USC liquidity on mainnet (Curve/Uniswap), sUSC as a composable yield token, USC as the unit of account for inter-protocol credit and insurance.

Production hardening checklist

ItemReplaces
Real ETH staking (Lido / EigenLayer)Simulated 3.5% APR
Multi-source oracle + deviation circuit breakersSingle relayer pushing CoinGecko prices
Threshold-signature / multi-relayer bridge, mint caps, on-chain proof-of-reservesSingle relayer key
Multisig + timelock on all admin rolesDeployer EOA
Keeper-automated liquidity loopManual owner trigger
Validator set / shared securitySingle validator
Audits + bug bounty