Skip to content

How It Works ​

Deployed Addresses ​

USDC Vault ​

  • KanaVault: 0x1B85248a30C0A61DD52933C17c989d1B9aFDf98e
  • USDCStrategy: 0xdD02a58a3515e78691260Ee3ed0ca87a540A8Dc2
  • USDC: 0xe15fC38F6D8c56aF07bbCBe3BAf5708A2Bf42392
  • Network: SEI mainnet (chain ID 1329)

WSEI Vault ​

  • SEIVault: TBD
  • SEIStrategy: TBD
  • WSEI: TBD
  • Network: SEI mainnet (chain ID 1329)

Deposit Flow ​

The deposit flow is identical for both vaults. The vault mints shares proportional to the deposit, then forwards assets to the strategy for deployment.

  1. User deposits USDC (or WSEI) into the vault
  2. Vault mints shares proportional to the deposit relative to total vault assets
  3. Vault transfers asset to the strategy and calls deposit()
  4. Strategy splits according to configured allocation weights and supplies to enabled yield sources

Share calculation:

shares = deposit_amount × total_shares / total_assets

As yield accrues, totalAssets() increases while total shares stays constant, making each share worth more over time.

Yield Generation ​

Each protocol generates yield differently:

  • Yei Finance (Aave V3 fork) — aToken balances grow automatically via interest accrual (both vaults)
  • Takara (Compound fork) — cToken exchange rate increases + COMP reward tokens (both vaults)
  • Morpho — P2P optimized lending rates, often higher than pool rates (USDC vault only)
  • Feather — MetaMorpho ERC-4626 vault, auto-compounds WSEI across underlying pools (WSEI vault only)
  • Other protocols — can be added dynamically by the strategy owner

The strategy's balanceOf() function aggregates the total value across all enabled yield sources, which is how the vault calculates share prices.

Harvesting & Compounding ​

The harvest flow is identical for both vaults. Rewards are claimed, swapped to the vault's underlying asset, and redeployed.

The keeper bot periodically (every 4 hours) calls harvest(uint256[] calldata minAmountsOut) on the vault:

  1. Checks pending rewards for each yield source to determine if harvest is worthwhile (> $10 threshold)
  2. Calculates fair prices for reward swaps using DEX quotes
  3. Applies 1% slippage tolerance to determine minimum output amounts for each source
  4. Calls harvest with the minAmountsOut array (length must match yield source count)
  5. Vault forwards call to strategy
  6. Strategy claims accrued rewards from all enabled protocols
  7. Strategy swaps non-native rewards to the vault's underlying asset with slippage protection
  8. Strategy reports profit to vault
  9. Vault takes 10% performance fee (transfers to fee recipient)
  10. Strategy redeposits the remaining assets back into lending protocols per current allocation

Slippage protection: If a sandwich bot or MEV attacker manipulates prices, the actual swap output will be less than minAmountOut for at least one source, causing the transaction to revert.

Withdrawal Flow ​

Withdrawals pull funds proportionally from all enabled protocols. This avoids concentration risk and ensures no single protocol is drained first.

Withdrawal calculation per protocol:

withdrawal_from_source = amount × source_balance / total_balance

Rounding Handling ​

Both the strategy and vault handle protocol rounding gracefully:

Strategy level:

solidity
// After withdrawing from protocols
uint256 actual = asset.balanceOf(address(this));
if (actual < amount) amount = actual;
asset.safeTransfer(vault, amount);

Vault level:

solidity
// After requesting withdrawal from strategy
uint256 actualBalance = IERC20(asset()).balanceOf(address(this));
if (actualBalance < assets) {
    assets = actualBalance;
}

Why this matters: Some protocols (especially Compound-based like Takara) may return slightly less than requested due to internal rounding. Instead of reverting, we transfer the actual amount available. This prevents withdrawal failures while ensuring users always receive their fair share of the vault.

Rebalancing ​

When APYs shift significantly, the keeper bot rebalances. The logic runs identically for each vault independently.

Rebalance flow:

  1. Keeper monitors APYs across all protocols
  2. Calculates optimal allocation based on current yields
  3. Compares current allocation vs optimal allocation
  4. If deviation exceeds threshold (e.g., 1%) AND cooldown has passed:
    • Updates splits for each yield source (subject to splits cooldown)
    • Calls rebalance() to withdraw and redeploy funds
    • Sends Telegram alert with old → new allocations

Cooldowns:

  • Rebalance cooldown: 1 hour (3600 seconds) between rebalances
  • Splits cooldown: 1 hour (3600 seconds) between split changes

Dynamic Yield Sources ​

The strategy supports up to 10 yield sources that can be:

  • Added dynamically by owner
  • Removed without redeploying
  • Enabled/disabled individually
  • Rebalanced independently

Example allocation — USDC Vault:

Source 0 (Yei):    4000 bps = 40%
Source 1 (Takara): 3500 bps = 35%
Source 2 (Morpho): 2500 bps = 25%
Total:             10000 bps = 100%

Example allocation — WSEI Vault:

Source 0 (Yei):     4000 bps = 40%
Source 1 (Takara):  3500 bps = 35%
Source 2 (Feather): 2500 bps = 25%
Total:              10000 bps = 100%

Benefits:

  • Flexibility to add new protocols as they launch
  • Easy to disable underperforming or risky protocols
  • No contract upgrades needed to adapt to market changes

Share Value Growth ​

Share value grows identically in both vaults — each share represents a growing claim on the vault's underlying asset.

-- USDC Vault --
Initial: 1 kUSDC = 1 USDC
After harvest #1: 1 kUSDC = 1.02 USDC (+2% yield, 10% fee taken)
After 1 year: 1 kUSDC = 1.10 USDC (~10% net APY)

-- WSEI Vault --
Initial: 1 kSEI = 1 WSEI
After harvest #1: 1 kSEI = 1.02 WSEI (+2% yield, 10% fee taken)
After 1 year: 1 kSEI = 1.10 WSEI (~10% net APY)

Users can:

  • Hold vault shares and watch them appreciate
  • Use vault shares in other DeFi protocols (if supported)
  • Burn vault shares anytime to withdraw the underlying asset

Built on SEI