Architecture
Overview
Unbound consists of two main smart contracts that work together to provide leveraged vault functionality:Contract Details
UnboundVault
Purpose: User-facing contract for deposits and withdrawals. Implements ERC-4626 tokenized vault standard. Key Responsibilities:- Accept user deposits
- Mint/burn vault shares
- Track user positions
- Coordinate with Executor for leverage operations
- Collect performance fees
FlashLoanExecutor
Purpose: Handles the flash loan callback and executes the leverage/deleverage operations. Key Responsibilities:- Receive flash loans from Vesu
- Execute swaps via AVNU
- Manage Vesu position (deposit collateral, borrow debt)
- Ensure atomicity of operations
on_flash_loan.
External Integrations
Vesu V2
Vesu is Starknet’s lending protocol used for:| Function | Usage |
|---|---|
flash_loan | Get USDC without collateral |
modify_position | Add collateral / borrow debt |
position | Query current position state |
price | Get asset oracle prices |
- Max LTV: 86%
- Liquidation Factor: 90%
- Borrow APR: Variable (~1.8%)
- BTCFi Rewards: ~1.4% (reduces net cost)
AVNU
AVNU is a DEX aggregator for optimal swap execution:| Function | Usage |
|---|---|
multi_route_swap | Execute USDC ↔ wBTC swaps |
- Best execution across multiple DEXs
- Single transaction for complex routes
- Built-in slippage protection
Data Flow
Position Creation
Position Closure
Trust Model
| Entity | Trust Level | Why |
|---|---|---|
| Vault Owner | High | Can pause, set fees |
| Executor | Medium | Only vault can trigger operations |
| Vesu | Critical | Holds all collateral and debt |
| AVNU | Medium | Swap execution only |
| User | None needed | Permission-less interaction |
Upgrade Path
Current contracts are not upgradeable. To upgrade:- Deploy new vault with updated logic
- Users withdraw from old vault
- Users deposit to new vault
