AegisMint is a production-grade, decentralized Collateralized Debt Position (CDP) engine and synthetic dollar protocol implemented in Vyper 0.4.3 with formal verification harnesses via Foundry. It enables users to deposit digital assets (such as WETH) to mint an algorithmic synthetic stablecoin (AEGIS) at low minimum collateralization ratios (110% MCR), safeguarded by an
flowchart TD
User([Borrower / Depositor]) -->|Deposit Collateral / Mint AEGIS| TM[TroveManager]
TM -->|Mint / Burn AEGIS| Token[AegisToken]
TM -->|Fetch Asset Price| Oracle[PriceFeedOracle]
SP_User([Stability Depositor]) -->|Provide AEGIS Liquidity| SP[StabilityPool]
SP -->|Absorb Bad Debt & Seize Collateral| TM
SP -->|Claim Pro-Rata Collateral Gains| SP_User
Arbitrageur([Arbitrageur / Redeemer]) -->|Redeem AEGIS for 1:1 Collateral| RE[RedemptionEngine]
RE -->|Execute Redemption| TM
TM -->|Seize Collateral from Lowest ICR Trove| Arbitrageur
TM -->|Borrowing & Redemption Fees| Treasury([Protocol Treasury])
For each borrower position (Trove) holding collateral
The system enforces strict solvency constraints:
-
Minimum Collateral Ratio (
$\text{MCR}$ ):$11000\text{ bps} \ (110%)$ . If$\text{ICR}_i < \text{MCR}$ , the Trove is immediately liquidatable. -
Critical Collateral Ratio (
$\text{CCR}$ ):$15000\text{ bps} \ (150%)$ . -
Total Collateral Ratio (
$\text{TCR}$ ):
Rather than iterating over depositors during liquidations, the Stability Pool maintains running product
When an insolvent debt
For any depositor
- Compounded Deposit:
- Accrued Collateral Reward:
To protect against sandwich attacks and run-on-the-bank cascades during heavy redemption periods, the Redemption Engine dynamically increases base fees
Upon redemption of fraction
All contracts are written in native Vyper 0.4.3, benefiting from strict Pythonic syntax, complete absence of inheritance ambiguity, bounded loops, and zero reentrancy hazards:
| Contract | Runtime Size (B) | Initcode Size (B) | Size Limit (B) | Margin (B) |
|---|---|---|---|---|
AegisToken.vy |
3,468 B | 3,710 B | 24,576 B | 21,108 B |
PriceFeedOracle.vy |
2,253 B | 2,375 B | 24,576 B | 22,323 B |
RedemptionEngine.vy |
3,110 B | 3,387 B | 24,576 B | 21,466 B |
StabilityPool.vy |
4,340 B | 4,967 B | 24,576 B | 20,236 B |
TroveManager.vy |
11,225 B | 12,145 B | 24,576 B | 13,351 B |
Evaluated via Foundry on EVM Cancun target:
| Function | Min Gas | Avg Gas | Max Gas | Description |
|---|---|---|---|---|
open_trove |
24,278 | 289,347 | 291,134 | Deposit collateral, calculate fee & mint AEGIS |
add_collateral |
45,800 | 58,200 | 62,100 | Transfer additional collateral into Trove |
withdraw_collateral |
44,606 | 57,773 | 70,940 | Health factor checked collateral withdrawal |
mint_more_debt |
65,100 | 86,526 | 92,300 | Mint supplementary debt against collateral |
repay_debt |
42,100 | 58,640 | 61,200 | Burn AEGIS debt to boost ICR |
liquidate |
121,838 | 154,811 | 187,785 | Liquidate underwater position into Stability Pool |
provide_to_sp |
48,200 | 64,800 | 72,100 | Provide AEGIS to Stability Pool with accumulator update |
redeem_collateral |
98,200 | 124,500 | 146,189 | 1:1 arbitrage redemption against lowest ICR trove |
- Python 3.10+ with
vyper==0.4.3(pip install vyper==0.4.3) - Foundry suite (
curl -L https://foundry.paradigm.xyz | bash && foundryup)
# Compile Vyper smart contracts via Foundry
forge build --sizes# Execute unit, integration, and fuzz invariant tests forge test -vvv --fuzz-runs 256
# Execute local deployment script simulation
forge script script/DeployAegisMint.s.sol-
Global Solvency Invariant: For every active Trove
$i$ ,$\text{ICR}_i \ge \text{MCR}$ unless marked underwater and awaiting liquidation. -
Conservation of Debt: System total debt strictly matches the sum of individual Trove debts (
$\sum D_i = D_{\text{total}}$ ). -
Non-Inflationary Redemption: Redemption burns
$100%$ of redeemed AEGIS tokens before transferring collateral out. -
$O(1)$ Stability Pool Conservation: Compounded depositor balances plus total debt offsets equal cumulative historical deposits.
MIT License. Copyright (c) 2026 AegisMint Contributors.