Stablecoin-Fi is a decentralized, overcollateralized stablecoin protocol inspired by MakerDAO. Users deposit WETH or WBTC as collateral to mint DSC, a USD-pegged stablecoin.
The protocol maintains its peg through overcollateralization (150% minimum), real-time price feeds from Chainlink, and automated liquidations of undercollateralized positions.
Tech Stack: Solidity, Foundry, Chainlink, OpenZeppelin
| Contract | Purpose |
|---|---|
| DSCEngine.sol | Core protocol logic - handles deposits, minting, liquidations, health factors |
| DecentralisedStableCoin.sol | DSC token contract - ERC20 implementation |
For Users:
- Deposit WETH/WBTC as collateral
- Mint DSC tokens against deposited collateral
- Maintain health factor above 1.0 to avoid liquidation
- Repay DSC to redeem collateral
For Liquidators:
- When a user's health factor drops below 1.0, liquidators can repay the user's debt
- Liquidators receive the user's collateral with a 10% bonus
- This incentive ensures the protocol remains fully collateralized
- Unit Tests: Individual function correctness
- Fuzzing: Random input edge cases
- Stateful Invariants: Protocol properties always hold
Key Invariant: Total collateral value always exceeds total DSC supply.
This project was built to demonstrate deep understanding of DeFi primitives, stablecoin mechanisms, and secure smart contract development practices.