Insomnia Architecture

Architecture Overview

The diagram illustrates the modular design of Insomnia Protocol, showing how its components interact to deliver vault-based yield aggregation and point farming on the Somnia Network.

1. Factory Pattern

  • VaultFactory is responsible for deploying new vault ecosystems.

  • It ensures standardized deployment of the InsomniaVault, PointsController, and StrategyRouter, while also handling role assignments and permissions.

2. Core Components

  • InsomniaVault: The main contract where users deposit SOM tokens. It issues vault shares, manages lockups, and integrates directly with the PointsController and StrategyRouter.

  • PointsController: Tracks and aggregates airdrop points across different Somnia ecosystem protocols. It integrates with vault shares to calculate user-specific point accrual.

  • StrategyRouter: Orchestrates allocation of deposited funds into different strategies. It distributes based on weights, manages liquidity for withdrawals, and connects the vault to the strategy layer.

3. Strategy Layer

  • SimpleHoldingAdapter: A baseline strategy that securely holds SOM tokens without deploying them elsewhere. This ensures stability and a fallback strategy.

  • IStrategyAdapter Interface: A standard interface all strategies must follow. It defines functions for depositing, withdrawing, harvesting, and reporting managed funds. This modular approach makes it easy to add new strategies in the future.

4. External Participants

  • User: Deposits SOM into the InsomniaVault, receives vault shares, earns yield, and accumulates points.

  • Treasury: Collects fees such as early exit penalties and supports long-term protocol sustainability.

Last updated