Skip to content

M0 Extensions: Custom Stablecoins Built on $M

What Are M0 Extensions?

M0 Extensions are the application layer of the M0 Protocol. They are custom ERC-20 stablecoins that developers build by wrapping the foundational $M token, inheriting its security and yield properties while adding their own unique features, branding, and business logic.

Think of $M as the secure, collateralized foundation—like digital infrastructure. Extensions are the applications, products, and user experiences built on top of this foundation.

The Extension Architecture

Your Custom Stablecoin (Extension)
        ↓ wraps/unwraps
    $M Token (Foundation)
        ↓ backed by
    US Treasury Collateral

Key Relationship: Extensions wrap $M tokens 1:1, meaning:

  • 1 Extension Token ↔ 1 $M Token (always redeemable)
  • Extensions inherit $M's stability and regulatory clarity
  • Extension contracts can earn yield on their held $M (if approved by governance)
  • Developers control how that yield flows to users, treasuries, or other destinations

SwapFacility: The Conversion Engine

SwapFacility is the central hub enabling seamless 1:1 conversions between M0 Extensions and the foundational $M token. It acts as the exclusive gateway for wrapping/unwrapping operations, ensuring perfect value preservation across the entire M0 ecosystem.

All extensions must be governance-approved earners to participate, while permissioned extensions require additional authorized swapper roles. The contract implements advanced reentrancy protection and supports gasless transactions through permit functions. By concentrating all conversion logic in a single contract, SwapFacility creates implicit liquidity between all M0 Extensions without requiring separate trading pairs, making it the backbone of the M0 Extension ecosystem's interoperability.

Why Build an Extension?

Full Customization

  • Yield Distribution: Route yield to users, treasury, or split however you want
  • Access Controls: Implement KYC, geographic restrictions, or institutional-only access
  • Fee Mechanisms: Add transaction fees, management fees, or revenue sharing
  • Branding: Create a fully branded stablecoin (YourAppUSD) or keep it generic

Inherited Benefits

  • Regulatory Clarity: Built on M0's compliant, audited infrastructure
  • Shared Liquidity: Tap into the M0 ecosystem's liquidity pools via unwrapping to $M
  • Cross-Chain Ready: Deploy on any chain where M0 operates
  • Battle-Tested Security: Leverage M0's proven collateral and governance systems

Business Value

  • Control: Unlike integrating someone else's stablecoin, you own the user relationship
  • Revenue: Capture value through yield management and optional fees
  • Flexibility: Evolve your stablecoin's features as your needs change

Common Extension Types

Treasury Extensions

Route 100% of yield to a single treasury address while providing users with a stable, non-rebasing token experience.

Use Cases: Protocol treasuries, ecosystem development funds, corporate reserves

User Yield Extensions

Share yield with token holders while taking a small protocol fee for sustainability.

Use Cases: DeFi protocols, consumer apps, yield savings accounts

Institutional Extensions

Provide granular, per-account control with custom fee arrangements and whitelisting.

Use Cases: Prime brokerages, fintech platforms, institutional treasury management

Who Should Build Extensions?

Recommended for:
  • Application Developers: Games, payments, DeFi protocols wanting branded stablecoins
  • Ecosystem Builders: L1/L2 chains needing native stablecoins for their ecosystems
  • Fintech Companies: Businesses requiring custom compliance or yield distribution
  • Treasury Managers: Organizations needing yield-bearing accounts with specific controls
Consider Wrapped $M instead if:
  • You just need standard DeFi integration (AMM pools, lending markets)
  • You prefer using an existing, established token rather than deploying your own

Real-World Examples

  • Wrapped $M: The "reference implementation" showing standard DeFi compatibility
  • Noble USD: Cross-chain stablecoin serving the Cosmos ecosystem

Technical Overview

Extensions are smart contracts that:

  1. Inherit from MExtension.sol: A base contract providing core wrap/unwrap functionality
  2. Implement Custom Logic: Add your unique features, access controls, and yield distribution
  3. Gain Earner Approval: Get governance approval to earn yield on held $M
  4. Deploy Anywhere: Launch on Ethereum, L2s, or any supported chain
Key Functions Every Extension Must Implement:
  • wrap(recipient, amount): Convert $M to your extension token
  • unwrap(recipient, amount): Convert your extension token back to $M
  • Custom yield claiming/distribution logic (your choice how this works)

Getting Started

Ready to build your own stablecoin? The Build section provides everything you need:

  • Model Selection Guide: Choose the right template for your use case
  • Step-by-Step Deployment: Deploy and configure your extension
  • Earner Approval Process: Get governance approval for yield earning
  • Integration Examples: Real code examples and best practices