# Stablecoin Bridges
Simple contracts that allow swapping other Dollar stablecoins into JuiceDollar and back.
# Overview
The swap page allows you to swap other recognized Dollar stablecoins against JuiceDollars and back. Moving back into other stablecoins is only possible as long as there is some of the other stablecoin left in the bridge contract. Essentially, this pegs JuiceDollar 1:1 to other stablecoins and helps stabilizing its value. In order to protect JuiceDollar from a crash of the connected stablecoins, the bridge contract is limited in time and volume. After a year the latest, it needs to be replaced with a new contract.
System participants should closely watch the amount of other stablecoins flowing in and out. Having a lot of outflow could be an indication that it is too cheap to mint JuiceDollars, i.e. implied interest rates being too low. Having large inflows could be an indication that going into JuiceDollars is too attractive and interest rates too high.
# How Bridges Work
Stablecoin bridges enable 1:1 conversion between trusted external stablecoins and JUSD:
Source Stablecoin (e.g., USDC) ←→ JuiceDollar (JUSD)
1:1 exchange rate
# Minting JUSD
When you deposit a source stablecoin:
- Your stablecoin is transferred to the bridge contract
- An equal amount of JUSD is minted to your address
- The bridge's
mintedcounter increases
// Mint to yourself
function mint(uint256 amount) external
// Mint to another address
function mintTo(address target, uint256 amount) external
# Burning JUSD
When you want your stablecoin back:
- Your JUSD is burned
- An equal amount of source stablecoin is sent to you
- The bridge's
mintedcounter decreases
// Burn and receive to yourself
function burn(uint256 amount) external
// Burn and send to another address
function burnAndSend(address target, uint256 amount) external
# Bridge Limitations
Each bridge has built-in limitations to protect the JuiceDollar system:
# Volume Limit
uint256 public immutable limit;
uint256 public minted;
The limit caps the maximum amount of JUSD that can be minted through this bridge. This prevents over-reliance on any single external stablecoin.
Example: A bridge with a 10M JUSD limit can never have more than 10M JUSD outstanding.
# Time Horizon
uint256 public immutable horizon;
Every bridge has an expiration date (horizon). After this time:
- No new minting is allowed
- Users can still burn JUSD to retrieve their stablecoins
- A new bridge must be deployed to continue operations
Typical duration: 52 weeks (1 year)
Why expire bridges?
- Forces periodic review of connected stablecoins
- Allows governance to adjust limits based on market conditions
- Provides opportunity to switch to better alternatives
# Decimal Handling
Bridges automatically handle different decimal places between tokens:
function _convertAmount(
uint256 amount,
uint8 fromDecimals,
uint8 toDecimals
) internal pure returns (uint256)
Example: USDC (6 decimals) ↔ JUSD (18 decimals)
- Deposit 1,000,000 USDC (1 USDC) → Receive 1,000,000,000,000,000,000 JUSD (1 JUSD)
# Emergency Stop
Bridges include an emergency mechanism that allows qualified JUICE holders to permanently stop a bridge if the underlying stablecoin is compromised.
# How Emergency Stop Works
function emergencyStop(
address[] calldata _helpers,
string calldata _message
) external
Requirements:
- Caller needs 10% of total voting power (higher than normal 2% quorum)
- Helpers array must be sorted and valid
- Once stopped, the bridge cannot be reactivated
# When to Use Emergency Stop
- The source stablecoin loses its peg
- Security vulnerability discovered in source stablecoin
- Regulatory action against source stablecoin issuer
- Evidence of fractional reserve or fraud
# After Emergency Stop
bool public stopped;
When stopped = true:
mint()andmintTo()are permanently disabledburn()andburnAndSend()still work- Users can always retrieve their deposited stablecoins
# Emergency Stop Quorum
| Parameter | Value |
|---|---|
| Required voting power | 10% of total votes |
| Effect | Permanent - cannot be reversed |
| Burn functionality | Still available |
The higher quorum (10% vs 2%) prevents abuse while still allowing rapid response to genuine emergencies.
# Bridge Monitoring
# Checking Bridge Status
// Source stablecoin address
function usd() external view returns (IERC20)
// JUSD contract
function JUSD() external view returns (IJuiceDollar)
// Expiration timestamp
function horizon() external view returns (uint256)
// Maximum mintable amount
function limit() external view returns (uint256)
// Currently minted amount
function minted() external view returns (uint256)
// Whether bridge is stopped
function stopped() external view returns (bool)
# Health Indicators
| Metric | Healthy | Warning |
|---|---|---|
minted / limit | < 80% | > 90% |
| Time to horizon | > 30 days | < 7 days |
| stopped | false | true |
# Monitoring Flows
Watch the balance changes to understand market dynamics:
| Flow Direction | Interpretation |
|---|---|
| Inflow (minting) | JUSD is attractive, possibly interest rates too high |
| Outflow (burning) | JUSD is less attractive, possibly rates too low |
| Balanced | Market in equilibrium |
# StartUSD Bridge (Historical)
During the initial launch of JuiceDollar, a bootstrap token called StartUSD (SUSD) was used to initialize the system. StartUSD was a simple ERC-20 token with no intrinsic value, created solely to enable the first JUSD minting and governance setup during a time-limited 6-week bootstrap phase.
The StartUSD bridge has since expired. SUSD is no longer part of the system and all JUSD in circulation is now backed by real collateral and audited stablecoins.
# Bridge Contracts (Expired)
| Network | Address |
|---|---|
| Mainnet | 0x51ff8141D731676Fb21aE1E5D5A88c04511994dD (opens new window) |
| Testnet | 0x9ba2264bE7695044f59B9ca863E69aC38B3c913d (opens new window) |
| Property | Value |
|---|---|
| Source Token | StartUSD |
| Limit | Configured at deployment |
| Horizon | 6 weeks (bootstrap period) |
# Adding New Bridges
New stablecoin bridges can be added through the governance process:
# Requirements for New Bridges
- Trusted stablecoin: The source must be a reputable, audited stablecoin
- Sufficient liquidity: Enough market depth for meaningful volume
- Governance approval: Pass the 14-day minter application period without veto
# Deployment Process
Deploy
StablecoinBridgecontract with parameters:- Source stablecoin address
- JUSD address
- Volume limit
- Duration in weeks
Propose as new minter via
suggestMinter()Wait for application period (minimum 14 days)
If no veto, bridge becomes active
# Example Bridge Deployment
// Deploy new USDC bridge
StablecoinBridge usdcBridge = new StablecoinBridge(
USDC_ADDRESS, // Source stablecoin
JUSD_ADDRESS, // JUSD contract
10_000_000 * 10**18, // 10M JUSD limit
52 // 52 weeks duration
);
// Propose to governance
jusd.suggestMinter(
address(usdcBridge),
14 days, // Application period
1000 * 10**18, // 1000 JUSD fee
"USDC Bridge - https://docs.example.com/usdc-bridge"
);
# Security Considerations
# Bridge Risks
| Risk | Mitigation |
|---|---|
| Source stablecoin failure | Volume limits, emergency stop |
| Bridge contract exploit | Immutable code, audits |
| Governance attack | 10% quorum for emergency |
| Expiration oversight | Time limits force review |
# Best Practices for Users
- Check bridge status before large transactions
- Monitor horizon - don't deposit near expiration
- Verify addresses - use only official bridge contracts
- Diversify - don't rely on a single bridge for large amounts
# Events
// Emitted when bridge is permanently stopped
event EmergencyStopped(address indexed caller, string message)
# Current Bridges
# Mainnet (Chain ID: 4114)
| Bridge | Source | Address | Status |
|---|---|---|---|
| USDC | USDC | 0x920D...20F (opens new window) | Active |
| USDT | USDT | 0x5CC0...614 (opens new window) | Active |
| CTUSD | CTUSD | 0x8D11...0bd (opens new window) | Active |
| StartUSD | SUSD | 0x51ff...4dD (opens new window) | Expired |
# Testnet (Chain ID: 5115)
| Bridge | Source | Address | Status |
|---|---|---|---|
| StartUSD | SUSD | 0x9ba2...3d (opens new window) | Expired |
Additional bridges may be added through governance.