Developers

Loop Strategy Vaults are built on ERC-4626 vault standards with a modular design that integrates:

  • Flash Loans for atomic looping and unlooping execution

  • Universal DEX Module for swaps

  • Withdraw Manager for queued withdrawals

  • Accountant Module for NAV calculation and fee handling

  • Rebalancing Engine that optimizes vault parameters to maintain healthy leverage and maximize yield for depositors.

The system is deployed behind a TransparentUpgradeableProxy and initialized with DataTypes.VaultInitData.


Core Components

  • SuperloopVault: ERC-4626 base + supply caps, performance fees.

  • SuperloopActions: Executes modular strategies.

  • SuperloopBase: Role and admin management.

  • Aave V3 Modules: Supply, Borrow, Withdraw, Repay, E-mode.

  • Flashloan Module: Uses AaveV3FlashloanModule with callback handler.

  • Universal DEX Module: Handles token swaps internally or externally.

  • AccountantAaveV3: Calculates total assets and fees.

  • WithdrawManager: Queues/resolves withdrawals.

  • VaultRouter: Allows deposits in non-base tokens via swaps.


Initialization

  1. Deploy SuperLoop implementation and proxy.

  2. Initialize with:

    • asset, name, symbol

    • supplyCap

    • superloopModuleRegistry

    • Strategy modules

    • accountantModule

    • withdrawManagerModule

    • Admin addresses (vaultAdmin, treasury)

  3. Register modules and callback handlers.

  4. Set accountant and withdraw manager via admin setters.


Roles

  • Vault Admin: Adjust supply cap, registry, module settings, and treasury.

  • Privileged Addresses: Can transfer shares (guarded).

  • Modules: Execution restricted to valid execution context.

  • WithdrawManager: Only callable by the vault for resolution.


Module Execution

  • Superloop.operate(DataTypes.ModuleExecutionData[]):

    • Starts execution context.

    • Executes each module action (CALL/DELEGATECALL).

    • Ends execution context.

  • operateSelf: Internal-only calls during execution context (e.g., flashloan callbacks).


Flashloan Flow

  • Flashloan module triggers flashLoanSimple.

  • Callback routed to registered handler via (msg.sender, msg.sig) key.

  • Handler processes repayment, approvals, and optional re-entry to operateSelf.


Withdrawals

  • Instant: Uses instantWithdrawModule if set; redeems shares directly.

  • Scheduled: Requests queued in WithdrawManager; resolved by vault unlooping assets.


VaultRouter (Token-Agnostic Deposits)

  • Direct deposit if tokenIn == vault.asset().

  • Otherwise:

    • Swap via UniversalDexModule.

    • Approve and deposit resulting base token.


Integration Patterns

  • Initial Looping: Flashloan → supply → borrow → swap → repay.

  • Adjust Leverage: Combine repay/withdraw/swap in a flashloan to reach target exposure.

  • Queued Withdrawals: Approve → request → vault resolves → user claims.

Additional Resource

Loop Vaults Core Contracts

Last updated