This project focuses on studying the internal mechanics of stablecoins, from both technical and economic perspectives. It analyzes key mechanisms such as collateralization, minting, liquidation, and price stability across different types of stablecoins.
To explore and understand how stablecoins operate at the smart contract level β especially under stress conditions such as price drops, liquidations, and collateral volatility.
- Smart contract implementation to simulate collateral-backed stablecoin systems
- Calculation of critical metrics such as:
healthFactorliquidationBonuscollateralToDebtRatio
- Simulation of extreme volatility and risk scenarios
- Case studies: ETH, WLD, and highly volatile tokens (e.g. shitcoins)
- Integration with utilities like
FixedPointMathLibfrom Solady
- Solidity 0.8.27
- Foundry
- Solady (
FixedPointMathLib) - Markdown documentation
contracts/
βββ StablecoinManager.sol
scripts/
βββ scenarios/
test/
βββ liquidation.t.sol
README.md
- Moderate price drops (~25%β45%)
- Black swan events (~>40% drops)
- Comparisons between ETH and highly volatile tokens
This is not a production-grade stablecoin implementation.
The goal is to analyze and document how stablecoins work, the risks they face, and the key thresholds that govern their solvency and liquidation logic.