Strategy Router

Strategy Router and Adapter Architecture

The diagram illustrates how the StrategyRouter interacts with different yield strategies through the standardized IStrategyAdapter interface. This modular approach allows Insomnia Protocol to easily expand its strategy set while maintaining a unified control layer.

Core Components

  • StrategyRouter

    • The central manager that allocates funds from the vault into strategies.

    • Decides how much SOM is sent to each adapter based on governance-defined weights.

    • Handles rebalancing, harvesting, and liquidity withdrawals.

  • IStrategyAdapter (Interface)

    • Defines a common standard that all strategies must implement.

    • Ensures the StrategyRouter can interact with any strategy in the same way.

    • Provides functions for deposits, withdrawals, harvesting, and reporting.

  • SimpleHoldingAdapter

    • A baseline strategy that simply holds SOM securely.

    • Provides a safe, low-risk option while enabling point accrual.

  • Other Future Adapters

    • Placeholder for new strategies that can be added later (e.g., lending, liquidity pools, staking).

    • As long as they follow the IStrategyAdapter interface, they can be plugged in without modifying the router.

IStrategyAdapter Interface Functions

  1. depositNative()

    • Called by the router to send SOM into a strategy.

    • Example: allocating user deposits into the SimpleHoldingAdapter.

  2. withdrawNative(amount, receiver)

    • Returns SOM from a strategy back to the router/vault.

    • Used during withdrawals or rebalancing.

  3. harvest()harvestedNative

    • Collects any yield or rewards generated by the strategy.

    • The router aggregates these harvests and updates the vault’s total assets.

  4. totalManagedNative() (view)

    • Reports the total SOM managed by the strategy.

    • Allows the router and vault to track allocations and TVL accurately.

Benefits of This Design

  • Modularity – Strategies can be added, removed, or upgraded without altering core contracts.

  • Flexibility – Supports a wide range of strategies (simple holding, yield farming, lending, LPing).

  • Transparency – Standardized reporting ensures governance and users can see exactly how funds are managed.

  • Security – Role-based access and interface enforcement reduce risks of mismanagement.

Last updated