AFI Vaults

AFI Vaults are the foundational layer for generating and distributing yield across the protocol. Each vault adheres to the ERC-4626 standard and includes advanced features such as yield vesting, withdrawal cooldowns, and global cross-chain coordination. These vaults form the asset layer backing AFI’s index products such as afiUSD.

afiusd Vault

The afiUSD Vault is the primary implementation of the AFI yield infrastructure on supported chains. It is a fully compliant ERC-4626 vault with protocol-specific enhancements.

Key Features -

  • ERC-4626 Compliance Implements the full ERC-4626 tokenized vault interface, allowing seamless interoperability with other DeFi protocols.

  • Withdrawal Cooldown Introduces a 24-hour cooldown period post-withdrawal request to allow strategy unwinding and ensure liquidity availability.

  • Yield Vesting Yield generated by AFI Agents is incorporated into the vault's exchange rate gradually, smoothing accrual and preventing front-running or deposit-timing arbitrage.

  • Fee Management Fee Management supports configurable deposit and withdrawal fees, programmable at the vault or strategy level. Currently, both fees are set to 0.

  • Virtual Asset Accounting Tracks total assets under management, including vested and unvested yield, to provide accurate NAV computation.

Cross-Chain Yield Distribution

AFI operates vaults across multiple chains - each independently collecting deposits and generating yield. However, yield distribution is coordinated globally to ensure fairness and consistency in afiUSD value across all deployments.

Objectives -

  • Maintain one unified global exchange rate for afiUSD

  • Ensure users on all chains receive proportional yield

  • Prevent liquidity fragmentation across deployments

How Yield Distribution Works

Step 1: Collect Chain-Level Data

  • Vault Deposits: Track total deposits per chain (e.g., Ethereum: 500K USDC, Arbitrum: 300K USDC)

  • Vault Yields: Track yield generated by agents on each chain (e.g., Ethereum: 10K USDC, Arbitrum: 3K USDC)

Step 2: Aggregate Global Totals

totalDeposit = ethDeposit + arbDeposit  
             = 500,000 + 300,000  
             = 800,000 USDC

totalYield = ethYield + arbYield  
           = 10,000 + 3,000  
           = 13,000 USDC

Step 3: Calculate Global Exchange Rate

The exchange rate is updated globally using:

newExchangeRate = ((totalDeposit + totalYield) * 1e6) / totalDeposit
                = ((800,000 + 13,000) * 1,000,000) / 800,000
                = 1,016,250 (scaled by 1e6 for USDC precision)

This exchange rate reflects the updated value of 1 vault share across all chains.

Step 4: Compute Chain-Specific Yield Distribution

vaultYield = (newExchangeRate * vaultDeposit) / 1e6 - vaultDeposit

For each vault:

  • Ethereum Vault:

    ethVaultYield = (1,016,250 * 500,000) / 1,000,000 - 500,000  
                  = 8,125 USDC
  • Arbitrum Vault:

    arbVaultYield = (1,016,250 * 300,000) / 1,000,000 - 300,000  
                     = 4,875 USDC

Total Distributed Yield:

8,125 + 4,875 = 13,000 USDC (matches total global yield)
Vault
Deposits
Yield Generated
Yield Distributed

ETH

500,000 USDC

10,000 USDC

8,125 USDC

Arbitrum

300,000 USDC

3,000 USDC

4,875 USDC

Total

800,000

13,000

13,000

Distribution Process -

  1. Off-chain Calculation:

    • Our off-chain Engine collects deposit and yield data from all chains.

    • It computes the new global exchange rate and the yield to distribute to each vault.

  2. On-chain Distribution:

    • The yield rebalancer (authorized address) calls the distributeYield function on each vault’s Yield contract, passing the calculated yield for that vault.

    • The vault contract updates its internal accounting and distributes the yield to users (usually with vesting).

Last updated