StabiFi

Stablecoins-as-a-Service: deploy custom pegged tokens with shared risk & collateral

StabiFi

Created At

HackMoney 2026

Project Description

Our project is a Stablecoins-as-a-Service (SCaaS) protocol, designed to enable developers and apps to launch fully customizable stablecoins without building their own risk and collateral infrastructure from scratch. Every app can deploy its own branded ERC20 stablecoin, configure which collateral tokens are allowed, and define user permissions, while leveraging a shared, protocol-level risk and security framework.

The protocol supports three distinct peg models, each tailored to different app needs:

-> Hard Peg: Designed for maximum simplicity and predictability. Stablecoins are minted 1:1 against a basket of collateral with no liquidations or external price oracles. Redemption drives the peg, making this model safe and stable, ideal for apps seeking a fully backed, low-risk token.

-> Medium Peg: Adds yield generation to the collateral layer. Users deposit into ERC4626 yield-bearing vaults, which allow their collateral to compound over time. Minting remains 1:1 against principal, keeping the stablecoin predictable while generating passive yield. Ideal for apps that want yield without introducing the complexity of full CDP mechanisms.

-> Soft Peg: A fully-featured collateralized debt position (CDP) system, supporting multiple collateral types, liquidations, and dynamic health factor calculations. Oracles provide redundant pricing feeds, staleness checks, and collateral LTV thresholds, ensuring high safety even under volatile conditions. Soft peg is designed for apps that want full flexibility and advanced financial operations.

Across all models, apps retain full branding control, users are whitelisted and permissioned as needed, and the protocol handles risk pooling, debt limits, and security. The protocol also integrates ERC20 permits, allowing cheaper gasless approvals for minting and redemption, and enforces timelocks on sensitive protocol functions to prevent unauthorized or instant changes.

How it's Made

The protocol is a modular, inheritance-driven Solidity system with a shared architecture that allows multiple peg types to coexist while sharing risk, security, and access controls.

  1. Core Architecture: Shared Logic : -AccessManager: Manages app ownership, whitelists, and permissions for sensitive actions. Every action requiring elevated privileges (like adding collateral types or changing app config) is checked against this module. -CollateralManager: Tracks supported collateral types, their LTVs, scales, and allowed assets per app. Handles conversions between raw token amounts and internal “value units” for precise accounting. -Security: Implements global protocol-level safeguards like mint caps per transaction, total debt caps, and checks for minimum and maximum allowed operations. -AppManager: Manages app registration, app-specific ERC20 token mapping, and ensures each app operates within its own namespace while sharing protocol-wide controls.

This shared layer allows Hard, Medium, and Soft peg contracts to focus on their peg-specific logic while inheriting consistent security, access, and collateral management features.

  1. Hard Peg Features: -Stablecoin minting 1:1 against the basket of allowed collateral. -Collateral and minting tracked in “value units” internally, abstracting different token decimals and scales. -No liquidations or price oracles; users redeem based on actual collateral. -Supports pro-rata withdrawals of basket collateral, distributing all supported tokens proportionally.

  2. Medium Peg Features -Users deposit into ERC4626 yield-bearing vaults, allowing collateral to grow passively. -Minting is 1:1 against principal, ignoring accrued yield to maintain stable pricing. -Tracks per-user positions with principals and shares. -Supports both direct asset deposits and pre-deposited shares into vaults. -Allows app-level vault configuration, giving apps control over which yield-bearing vault to use. -Integrates mint caps and global debt limits, like hard peg, ensuring protocol-wide safety. -Users can withdraw unused collateral if they have no outstanding debt.

  3. Soft Peg Features -Fully-fledged CDP system with multi-collateral support, liquidation mechanisms, and health factor calculations. -Users mint stablecoins against collateral shares with LTV limits, maintaining system stability. -Liquidation is dynamic based on health factor, with bonuses applied to incentivize liquidators. -Collateral vaults track total assets and total shares to enable precise share-to-value conversions. -Implements oracle redundancy and staleness checks for safe, reliable pricing. -Supports repayment, redemption, and collateral withdrawal, with dust thresholds and minimum debt enforcement to prevent rounding errors.

Other Architecture Highlights -Mint and liquidation caps: Enforced globally and per transaction to avoid systemic risk. -ERC20 Permit: Allows cheaper approvals for minting and redeeming, improving UX. -Timelock: Protocol-level time-sensitive controls on global parameters and sensitive functions to ensure safe governance. -Cross-chain UX: Frontend integrates LiFi for deposits and transfers across chains. -ENS integration: Makes user addresses readable, improving frontend usability. -Testnet deployments: Hard peg deployed on Arbitrum testnet to leverage USDC-native gas flows. -Composable architecture: Shared logic base enables easy addition of new peg models in the future without duplicating code.

This design balances flexibility and safety: apps can innovate with their own stablecoin and collateral configurations, while the protocol centralizes risk management, access control, and security features. By abstracting shared logic, we ensure consistency, auditability, and maintainability across all peg types, enabling a robust and modular stablecoin ecosystem.

background image mobile

Join the mailing list

Get the latest news and updates

StabiFi | ETHGlobal