OPUSD is a Liquity-inspired CDP (Collateralized Debt Position) stablecoin protocol built natively on Bitcoin L1 via OPNet.
Users deposit OP20 collateral tokens, mint OPUSD stablecoins at a minimum 150% collateral ratio, and face automated liquidations when undercollateralized. The protocol uses a pull-oracle model with ML-DSA signed price feeds.
Live demo: http://46.225.141.46
Smart Contracts (AssemblyScript → WASM, deployed on OPNet testnet)
├── TestBTC — OP20 test collateral token
├── OPUSD — Stablecoin token (mint/burn controlled by VaultManager)
├── PriceFeed — Pull oracle with ML-DSA signature verification
└── VaultManager — Core protocol: vaults, liquidation, redemption
Off-Chain Services
├── Price Signer — Fetches BTC/USD from Binance/CoinGecko/Coinbase, signs with ML-DSA
└── Liquidator Bot — Monitors vault health, flags and liquidates undercollateralized positions
Frontend (React + Vite)
└── Dashboard, Vault Management, Liquidations, Redemptions
| Contract | Address |
|---|---|
| TestBTC | opt1sqrke7nyr4n80w5mmzj9jnp5jfk4cpyappudkd95q |
| OPUSD | opt1sqrfm9yvlx5euseap7ks3686mchzsudgnvudk7qfe |
| PriceFeed | opt1sqrnlmcwxa3hsyy6gvkpergcyyldemp5pxgphhhrd |
| VaultManager | opt1sqr3gjs3ys2l73nsq27uju7dyngmtn73lkczunhmr |
- Deposit collateral — Lock OP20 tokens in a vault
- Mint OPUSD — Borrow stablecoins against your collateral (min 150% ratio)
- Oracle prices — Frontend fetches signed BTC/USD price from the price signer API and includes it in transaction calldata
- Liquidation — If a vault drops below 110% collateral ratio, it can be flagged. After a 3-block grace period (~30 min), a Dutch auction liquidation begins
- Redemption — OPUSD can be redeemed for $1 worth of collateral from the lowest-ratio vault (hard peg mechanism)
| Parameter | Value |
|---|---|
| Min Collateral Ratio | 150% |
| Liquidation Threshold | 110% |
| Liquidation Grace Period | 3 blocks (~30 min) |
| Auction Duration | 6 blocks (~1 hour) |
| Max Liquidation Discount | 10% |
| Origination Fee | 0.5% |
| Redemption Fee | 0.5% |
| Min Debt | 100 OPUSD |
| Oracle Staleness | 12 blocks (~2 hours) |
| Price Precision | 6 decimals |
opusd-protocol/
├── contracts/ # AssemblyScript smart contracts
│ └── src/
│ ├── testbtc/ # Test collateral token
│ ├── opusd/ # Stablecoin token
│ ├── pricefeed/ # Pull oracle
│ └── vaultmanager/ # Core protocol logic
├── services/
│ ├── price-signer/ # Off-chain price signing service
│ └── liquidator-bot/ # Off-chain liquidation bot
├── frontend/ # React frontend
├── deploy/ # Deployment scripts
└── PLAN.md # Full technical specification
cd contracts && npm install && npm run buildcd services/price-signer && npm install
MNEMONIC="your mnemonic here" npm startcd frontend && npm install && npm run dev- Pull oracle — Users submit signed prices with transactions (zero ongoing oracle cost)
- ML-DSA signatures — Post-quantum secure price attestations
- Slow liquidation — Grace period + Dutch auction embraces Bitcoin's 10-min blocks
- Liquity-style redemption — Hard peg mechanism targeting lowest-ratio vaults
- Single collateral v1 — Designed for multi-collateral upgrade path
- Smart contracts: AssemblyScript (compiled to WASM) on OPNet
- Cryptography: ML-DSA (post-quantum) via
@btc-vision/transaction - Frontend: React 19 + Vite +
@btc-vision/walletconnect - Price feeds: Binance, CoinGecko, Coinbase (median price)
- Network: OPNet Testnet (
networks.opnetTestnet)
- All arithmetic uses u256 SafeMath (no floating point)
- Checks-Effects-Interactions pattern on all state mutations
- ML-DSA signature verification with staleness and deviation bounds
- Reentrancy guards on VaultManager
- Domain-separated price hashing (prevents cross-contract replay)
Built for the vibecode.finance Week 3 hackathon — #opnetvibecode