Stablecoins
Fiat-backed (USDT, USDC), crypto-backed (DAI), algorithmic stablecoins, seigniorage, stability mechanisms, and regulatory concerns.
Overview
Stablecoins are cryptocurrencies designed to maintain a stable value relative to a reference asset, typically the US dollar.
Stablecoin Categories
Fiat-Backed Stablecoins
USDT (Tether)
// Simplified USDT contract
contract TetherUSD is ERC20 {
address public owner;
mapping(address => bool) public blacklisted;
mapping(address => bool) public roles; // 0=owner, 1=pauser, 2=blacklister
constructor() ERC20("Tether USD", "USDT") {
owner = msg.sender;
}
function mint(address to, uint256 amount) external {
require(roles[msg.sender], "Not authorized");
_mint(to, amount);
}
function burn(uint256 amount) external {
require(roles[msg.sender], "Not authorized");
_burn(msg.sender, amount);
}
function blacklist(address account) external {
require(roles[msg.sender] && roles[msg.sender] == 2, "Not blacklister");
blacklisted[account] = true;
}
// Freeze, unfreeze, pause capabilities
}
USDC (Circle)
| Feature | USDT | USDC |
|---|---|---|
| Issuer | Tether Limited | Circle |
| Reserves | Mixed (bills, bonds, crypto) | Cash + US Treasuries |
| Transparency | Quarterly reports | Monthly attestation |
| Chains | 15+ | 15+ |
| Regulation | Minimal | Strong compliance |
| Depeg Risk | Higher | Lower |
Reserve Composition
USDC Reserves (2024):
- 80% US Treasury Bills
- 20% Cash at banks
- Monthly attestation by Deloitte
USDT Reserves (2024):
- 65% US Treasury Bills
- 15% Commercial Paper
- 10% Money Market Funds
- 10% Other (crypto, secured loans)
Crypto-Backed Stablecoins
DAI (MakerDAO)
MakerDAO Vault System
// Simplified Vault logic
contract Vault {
address public owner;
uint256 public collateralDeposited;
uint256 public daiDebt;
uint256 public liquidationRatio = 150; // 150%
function openVault(uint256 collateralAmount, uint256 daiAmount) external {
require(
(collateralAmount * 1e18 * 100) / daiAmount >= liquidationRatio,
"Insufficient collateral"
);
collateralDeposited = collateralAmount;
daiDebt = daiAmount;
}
function isLiquidatable() public view returns (bool) {
uint256 collateralValue = collateralDeposited * getCollateralPrice();
return (collateralValue * 100) / daiDebt < liquidationRatio;
}
function liquidate() external {
require(isLiquidatable(), "Not liquidatable");
// Transfer collateral to liquidator minus 13% penalty
// Burn DAI debt
}
}
DAI vs USDC
| Aspect | DAI | USDC |
|---|---|---|
| Collateral | Crypto (volatile) | Fiat (stable) |
| Decentralization | High | Low |
| Censorship Resistant | Yes | No |
| Capital Efficiency | 150%+ | 100% |
| Yield | Stability fee | None |
| Risk | Liquidation risk | Counterparty risk |
Algorithmic Stablecoins
Seigniorage Model
UST Death Spiral Analysis
When UST depegged:
- Users burned UTV for LUNA â LUNA supply inflated
- LUNA price dropped â More LUNA needed per UST
- More selling pressure â More depegging
- Death spiral completed in 3 days
Algorithmic Stablecoin Comparison
| Project | Mechanism | Status | Failure Mode |
|---|---|---|---|
| UST | seigniorage + LUNA | Failed | Death spiral |
| USDN | Waves collateral | Struggling | Depeg risk |
| USDD | Over-collateralized | Active | Better collateral |
| FRAX | Partial collateral | Active | Hybrid model |
| MIM | Crypto-backed | Active | MakerDAO-like |
Stability Mechanisms
Peg Stability Module (PSM)
// PSM: Swap between stablecoins at $1
contract PSM {
IERC20 public usdc;
IERC20 public dai;
function swapUSDCForDAI(uint256 amount) external {
usdc.transferFrom(msg.sender, address(this), amount);
dai.transfer(msg.sender, amount);
// 1:1 swap, no slippage
}
function swapDAIForUSDC(uint256 amount) external {
dai.transferFrom(msg.sender, address(this), amount);
usdc.transfer(msg.sender, amount);
}
}
Stability Comparison
| Mechanism | How It Works | Risk |
|---|---|---|
| Reserve Backing | 1:1 asset backing | Counterparty risk |
| Collateralized Debt | Over-collateralized loans | Liquidation risk |
| Seigniorage | Supply expansion/contraction | Death spiral |
| Algorithmic | Smart contract rebasing | Depeg risk |
| Hybrid | Multiple mechanisms | Complexity |
Real-World Examples
Stablecoin Market Share (2024)
| Stablecoin | Market Cap | Chain | Collateral |
|---|---|---|---|
| USDT | $120B | Tron, ETH | Fiat |
| USDC | $32B | ETH, Solana | Fiat |
| DAI | $5B | ETH | Crypto |
| FDUSD | $4B | ETH, BSC | Fiat |
| FRAX | $1B | ETH, Arb | Hybrid |
| TUSD | $2B | ETH, BSC | Fiat |
Stablecoin Use Cases
| Use Case | Volume | Dominant Coin |
|---|---|---|
| Trading Pairs | $50B/day | USDT |
| Remittances | $10B/day | USDT, USDC |
| DeFi Collateral | $20B TVL | DAI, USDC |
| Payments | $5B/day | USDC, BUSD |
| Savings Yield | $5B TVL | DAI, FRAX |
Trade-offs
Centralization vs Decentralization
| Aspect | Centralized (USDC) | Decentralized (DAI) |
|---|---|---|
| Regulatory Compliance | High | Low |
| Censorship Risk | High | Low |
| Capital Efficiency | 100% | 150%+ |
| Transparency | Audits | On-chain |
| Counterparty Risk | Yes | No |
| Complexity | Low | High |
Collateral Efficiency
| Protocol | Ratio | Capital Efficiency |
|---|---|---|
| USDC | 100% | Highest |
| DAI | 150% | Medium |
| Liquity | 110% | High (crypto) |
| RAI | 150% | Medium |
Interview Questions
-
How does DAI maintain its peg without fiat reserves?
- Answer: Through over-collateralized vaults, liquidation mechanisms, stability fees, and the Peg Stability Module (PSM) that allows 1:1 swaps with USDC.
-
What caused the UST/LUNA collapse and how could it have been prevented?
- Answer: Insufficient collateral, reflexive minting mechanism, and lack of circuit breakers. Better collateralization and pause mechanisms could have limited damage.
-
Why do regulators prefer fiat-backed stablecoins over algorithmic ones?
- Answer: Clear reserve requirements, identifiable issuers, audit trails, and lower risk of catastrophic failure that could destabilize markets.
Quiz Questions
-
What is the minimum collateralization ratio for a DAI vault?
- A) 100%
- B) 130%
- C) 150% â
- D) 200%
-
Which stablecoin uses a dual-token (seigniorage) model?
- A) USDT
- B) USDC
- C) UST â
- D) DAI
-
What is the Peg Stability Module (PSM)?
- A) A liquidation engine
- B) A 1:1 swap mechanism â
- C) A collateral vault
- D) A governance system
Practice
- Build a simple collateralized stablecoin with liquidation
- Implement a PSM that swaps between two stablecoins
- Create an algorithmic rebasing token
- Analyze historical depeg events and their causes