Decentralized Offered Rate Protocol on Mantle Network A production-ready structured DeFi product implementing waterfall distribution for risk-adjusted yield generation.
For a comprehensive overview of our vision, market opportunity, and roadmap, please refer to our One-Pager Pitch.
DOOR Protocol is a sophisticated dual-tranche vault system deployed on Mantle Network that provides:
- Senior Vault (sDOOR): Fixed-rate returns (5-8% APY) with priority claim on yields
- Junior Vault (jDOOR): Leveraged returns (15-30% APY) with first-loss protection for seniors
- Waterfall Distribution: Automated yield allocation following strict priority ordering
- Dynamic Safety Module: Real-time risk management with configurable thresholds
- Oracle-Based Rates: Decentralized rate calculation from multiple sources
DOOR Protocol implements a risk-tranching mechanism that allows investors to choose their risk/return profile while maintaining capital efficiency through a unified yield strategy. Junior capital acts as a buffer to protect senior investors, while receiving amplified returns in exchange.
This monorepo contains all components of the DOOR Protocol ecosystem:
production/
├── contract/ # Smart contracts (Solidity)
│ ├── src/ # Contract source code
│ │ ├── core/ # CoreVault - central coordinator
│ │ ├── tranches/ # SeniorVault & JuniorVault (ERC-4626)
│ │ ├── epoch/ # EpochManager - withdrawal windows
│ │ ├── safety/ # SafetyModule - risk management
│ │ ├── oracle/ # DOORRateOracle - rate calculation
│ │ ├── strategy/ # VaultStrategy - yield generation
│ │ └── libraries/ # Math and utility libraries
│ ├── test/ # Foundry tests (142 tests, 100% pass)
│ ├── scripts/ # Deployment and utility scripts
│ └── README.md # Contract-specific documentation
│
├── frontend/ # Next.js web application
│ ├── src/
│ │ ├── app/ # Next.js app router pages
│ │ ├── components/ # React components
│ │ ├── lib/ # Utilities and configurations
│ │ └── hooks/ # Custom React hooks
│ └── README.md # Frontend-specific documentation
│
├── .github/ # Project-wide documentation
│ ├── docs/ # Comprehensive technical documentation
│ │ ├── README.md # Product overview
│ │ ├── ARCHITECTURE.md # System design & technical details
│ │ ├── API_REFERENCE.md # Contract interfaces & integration
│ │ └── DEPLOYMENT_GUIDE.md # Deployment instructions
│ └── README.md # This file - project navigation
│
└── md/ # Development documentation
├── hackathon/ # Hackathon submission materials
└── dev/ # Development notes
Web Application: https://door-protocol-frontend.vercel.app
- Connect your wallet (MetaMask, WalletConnect, etc.)
- Switch to Mantle Sepolia Testnet (Chain ID: 5003)
- Choose your vault:
- Senior Vault: Low risk, fixed returns (~8% APY)
- Junior Vault: High risk, leveraged returns (~25% APY)
- Deposit USDC and start earning
# Navigate to contracts directory
cd contract/
# Install dependencies
npm install
forge install
# Run tests
forge test
# Deploy to testnet
npm run deploy:testnet
# See full documentation
cat README.mdKey Contract Addresses (Mantle Sepolia):
- CoreVault:
0x1601Aa4aE97b999cEd4bbaCF0D4B52f29554846F - SeniorVault:
0x34BC889a143870bBd8538EAe6421cA4c62e84bc3 - JuniorVault:
0x8E1A6A3Ba7c5cb4d416Da7Fd376b2BC75227022e
# Navigate to frontend directory
cd frontend/
# Install dependencies
npm install
# Set up environment variables
cp .env.local.example .env.local
# Edit .env.local with your configuration
# Run development server
npm run dev
# Open http://localhost:3000
# See full documentation
cat README.mdLocated in .github/docs/:
| Document | Description | Audience |
|---|---|---|
| README.md | Product overview, features, and use cases | Everyone |
| ARCHITECTURE.md | System design, contract interactions, technical specifications | Developers |
| API_REFERENCE.md | Contract interfaces, integration examples, event reference | Integrators |
| DEPLOYMENT_GUIDE.md | Deployment instructions, network configs, troubleshooting | DevOps |
-
Smart Contracts:
/contract/README.md- Contract architecture
- Testing guide
- Development workflow
- Security considerations
-
Frontend:
/frontend/README.md- Application structure
- Component library
- State management
- Deployment on Vercel
┌─────────────────────────────────────────────────────────────┐
│ DOOR Protocol Flow │
└─────────────────────────────────────────────────────────────┘
Users
│
├─► SeniorVault (Fixed Rate)
│ └─► deposit() → registerSeniorDeposit()
│
└─► JuniorVault (Leveraged)
└─► deposit() → registerJuniorDeposit()
│
▼
CoreVault (Coordinator)
│
├─► depositToStrategy()
│ │
│ ▼
│ VaultStrategy (mETH Staking)
│ │
│ └─► Mantle Network Yield
│
├─► harvest() [Every 24h]
│ │
│ └─► Waterfall Distribution:
│ 1. Protocol Fee (2%)
│ 2. Senior Obligation (Fixed Rate)
│ 3. Remaining → Junior
│
└─► SafetyModule.performHealthCheck()
└─► Enforce minimum junior ratio
Total Yield (12% APY on $100k)
│
├─► Protocol Fee (2%)
│ └─► $2,400 → Treasury
│
├─► Senior Yield (8% on $80k)
│ └─► $6,400 → SeniorVault
│
└─► Junior Yield (Remainder)
└─► $3,200 → JuniorVault
(16% APY on $20k Junior Capital)
Learn more about architecture →
- ✅ Internal Review: Completed
- ⏳ External Audit: Pending (recommended before mainnet)
- 📋 Bug Bounty: To be announced
- Access Control: OpenZeppelin role-based permissions
- Reentrancy Guards: All external calls protected
- Rate Limiting: Max 2% rate changes, 24h challenge period
- Emergency Controls: Pause mechanisms and emergency withdrawals
- Testing: 142 tests, 100% pass rate, comprehensive coverage
- Protocol has not undergone external security audit
- Experimental software - use at your own risk
- Strategy risk: mETH staking carries smart contract and market risks
- Testnet only - not production ready
cd contract/
# Run all tests
forge test
# Run with verbosity
forge test -vvv
# Run specific test
forge test --match-test testWaterfallDistribution
# Generate coverage report
forge coverageTest Results:
Test result: ok. 142 passed; 0 failed; 0 skipped; finished in 2.31s
Ran 8 test suites: 142 tests passed, 0 failed, 0 skipped
cd frontend/
# Run type checking
npm run type-check
# Run linting
npm run lint
# Build for production
npm run build| Network | Status | Chain ID | RPC URL |
|---|---|---|---|
| Mantle Sepolia | ✅ Deployed | 5003 | https://rpc.sepolia.mantle.xyz |
| Mantle Mainnet | ⏳ Planned | 5000 | https://rpc.mantle.xyz |
See full deployment addresses in DEPLOYMENT_GUIDE.md
- Production: https://door-protocol-frontend.vercel.app
- Status: ✅ Live on Mantle Sepolia Testnet
- Language: Solidity 0.8.26
- Framework: Foundry + Hardhat
- Standards: ERC-4626 (Tokenized Vaults)
- Libraries: OpenZeppelin Contracts v5.0.0
- Network: Mantle Network (L2 Ethereum)
- Framework: Next.js 15 (App Router)
- Blockchain: Viem + Wagmi v2
- Styling: Tailwind CSS + shadcn/ui
- State: React Context + Hooks
- Deployment: Vercel
- Lead Developer: andy3638@naver.com
- GitHub: @door-protocol
- Website: https://door-protocol-frontend.vercel.app
- Twitter/X: @door_protocol
- GitHub: github.com/door-protocol
- Issues: GitHub Issues
- Email: andy3638@naver.com
- ✅ Dual-tranche vault system
- ✅ Waterfall distribution mechanism
- ✅ Dynamic safety module
- ✅ Oracle-based rate system
- ✅ Epoch management
- ✅ Comprehensive testing (142 tests)
- ✅ Frontend application
- ✅ Testnet deployment
- 🔄 External security audit
- 🔄 Mainnet deployment on Mantle
- 🔄 Initial liquidity bootstrap
- 🔄 Marketing and user acquisition
- 📋 Multi-asset support (WETH, wMNT)
- 📋 Additional yield strategies (Curve, Aave)
- 📋 Cross-protocol yield aggregation
- 📋 Automated rebalancing
- 📋 Governance token launch
- 📋 DAO transition
- 📋 Liquidity mining programs
- 📋 Third-party integrations
Profile: Risk-averse investors seeking stable returns
Features:
- Fixed APY (5-8%, based on DOR + 1%)
- Priority claim on yields
- Protected by Junior capital buffer
- Suitable for: Long-term holders, institutions, DAOs
Example:
Deposit: 10,000 USDC
APY: 8%
Annual Yield: 800 USDC
Risk: Low (Junior buffer protection)
Profile: Risk-seeking investors pursuing high returns
Features:
- Leveraged APY (15-30%, depends on strategy yield)
- Receives all excess yield
- First-loss position
- Suitable for: Active traders, yield farmers
Example:
Scenario: $100k total, $20k junior (20% ratio)
Strategy Yield: 12% APY ($12k/year)
Senior Obligation: 8% on $80k = $6.4k
Junior Gets: $12k - $6.4k = $5.6k
Junior APY: 28%
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Write tests for your changes
- Ensure all tests pass (
forge test) - Submit a pull request
- Fork the repository
- Create a feature branch
- Test your changes locally
- Run linting (
npm run lint) - Submit a pull request
Found a typo or want to improve documentation?
- Edit the relevant
.mdfile - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
IMPORTANT: DOOR Protocol is experimental software currently deployed on testnet only. While thoroughly tested, smart contracts carry inherent risks. The protocol has not yet undergone external security audits.
Use at your own risk. This is not financial advice.
- Smart contracts are immutable once deployed
- Strategy risks include smart contract vulnerabilities and market volatility
- Loss of funds is possible, especially for Junior vault depositors
- Always start with small amounts to test the system
- Never invest more than you can afford to lose
- Start with Product Overview
- Understand Waterfall Distribution
- Explore Use Cases
- Try the Web App
- Read Architecture Documentation
- Study API Reference
- Follow Deployment Guide
- Review Contract Code
- Check API Reference
- Review Integration Examples
- Test on Mantle Sepolia Testnet
Built with:
- Mantle Network: L2 infrastructure and mETH integration
- OpenZeppelin: Secure smart contract libraries
- Foundry: Development and testing framework
- Vercel: Frontend hosting
- Viem & Wagmi: Web3 frontend libraries
Special thanks to the Mantle Network team for their support and the amazing L2 infrastructure.
For the latest updates, follow us on X (Twitter) or visit our GitHub.