Multi-Strategy Routing

The StrategyRouter distributes pool funds across multiple DeFi protocols based on AI-recommended allocations and DAO-defined constraints.

How It Works

When funds are deposited into the pool, they do not sit idle. The StrategyRouter automatically deploys them to yield-generating protocols based on the current allocation weights.

Deposit

User sends wETH

Calculate

Apply weights

Route

Split to adapters

Deploy

Earn yield

Architecture

Layer 1: Pool Controller
deposit()
Receives user funds
withdraw()
Returns user funds
allocate()
Triggers deployment
Layer 2: Strategy Router
setWeights()
Update allocation
rebalance()
Move funds
getBreakdown()
Current state
Layer 3: Strategy Adapters
AaveAdapter
Lending
LidoAdapter
Staking
CompoundAdapter
Lending

Strategy Adapter Interface

Each adapter implements a standard interface for depositing, withdrawing, and querying yield:

interface IStrategyAdapter {
    function deposit(uint256 amount) external;
    function withdraw(uint256 amount) external returns (uint256);
    function getBalance() external view returns (uint256);
    function getCurrentAPY() external view returns (uint256);
}

Allocation Weights

Weights are stored in basis points (10000 = 100%) and must sum to 10000:

Protocol
Aave
Weight (bps)
4000
Percentage
40%
Description
Stable lending yields
Protocol
Lido
Weight (bps)
3500
Percentage
35%
Description
ETH staking rewards
Protocol
Compound
Weight (bps)
2500
Percentage
25%
Description
Diversified lending

Updating Weights

Weights can be updated through two mechanisms:

Manual Update

Owner/DAO calls updateAllocationWeights() directly.

poolController.updateAllocationWeights(
  4000, 3500, 2500
);

AI-Verified Update

AI commits recommendation, then executes with verification.

poolController.updateAllocationWeightsWithAI(
  4000, 3500, 2500,
  commitmentHash
);

Rebalancing

When allocation weights change, funds need to be moved between protocols. The rebalancing process:

Calculate Delta

Current vs target

Withdraw Excess

From over-allocated

Deposit Deficit

To under-allocated

Emit Event

AllocationUpdated

// Rebalancing logic (simplified)
function rebalance() internal {
    uint256 total = getTotalDeployed();

    // Calculate targets
    uint256 aaveTarget = total * aaveWeight / 10000;
    uint256 lidoTarget = total * lidoWeight / 10000;
    uint256 compoundTarget = total * compoundWeight / 10000;

    // Withdraw from over-allocated
    if (aaveAdapter.getBalance() > aaveTarget) {
        aaveAdapter.withdraw(aaveAdapter.getBalance() - aaveTarget);
    }
    // ... repeat for other protocols

    // Deposit to under-allocated
    // ...
}
ℹ️
Gas Optimization
Rebalancing can be expensive if moving large amounts. The system batches small changes and only rebalances when the drift exceeds a threshold (typically 5%).

Current Strategies

Aave Strategy

Mock

Simulates Aave V3 lending. Deposits wETH and earns interest based on utilization.

APY Range:
2.0% - 5.0%
Risk Score:
25-35
Volatility:
Low

Lido Strategy

Mock

Simulates Lido staking. Deposits wETH and earns staking rewards minus Lido fee.

APY Range:
2.5% - 4.5%
Risk Score:
30-45
Volatility:
Medium

Compound Strategy

Mock

Simulates Compound V3 lending. Lower yields but stable and battle-tested.

APY Range:
2.0% - 3.5%
Risk Score:
25-40
Volatility:
Low
⚠️
Mock Adapters
The current strategy adapters are mocks that simulate DeFi protocol behavior with dynamic APY calculations. On mainnet, these would be replaced with real integrations that interact with actual protocol contracts.

Events

The StrategyRouter emits events for all allocation changes:

event AllocationUpdated(
    uint256 aaveAmount,
    uint256 lidoAmount,
    uint256 compoundAmount,
    uint256 timestamp
);

event AllocationWeightsUpdated(
    uint256 aaveWeight,
    uint256 lidoWeight,
    uint256 compoundWeight
);