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.
User sends wETH
Apply weights
Split to adapters
Earn yield
User sends wETH
Apply weights
Split to adapters
Earn yield
Architecture
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 | Weight (bps) | Percentage | Description |
|---|---|---|---|
| Aave | 4000 | 40% | Stable lending yields |
| Lido | 3500 | 35% | ETH staking rewards |
| Compound | 2500 | 25% | 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:
Current vs target
From over-allocated
To under-allocated
AllocationUpdated
Current vs target
From over-allocated
To under-allocated
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
// ...
}Current Strategies
Aave Strategy
MockSimulates Aave V3 lending. Deposits wETH and earns interest based on utilization.
Lido Strategy
MockSimulates Lido staking. Deposits wETH and earns staking rewards minus Lido fee.
Compound Strategy
MockSimulates Compound V3 lending. Lower yields but stable and battle-tested.
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
);