Yield Strategies
Strategies in FYV define how yield is generated from deposited collateral. Each strategy implements a specific approach to converting collateral into yield-bearing positions, managing those positions, and handling withdrawals. This document explains the available strategies and how they work.
Strategy Interface
All strategies implement the Strategy interface, which provides a consistent API regardless of the underlying yield mechanism.
_13pub resource interface Strategy {_13 // Initialize position with collateral deposit_13 pub fun deposit(collateralVault: @FungibleToken.Vault)_13_13 // Withdraw specified amount of value_13 pub fun withdraw(amount: UFix64): @FungibleToken.Vault_13_13 // Close position and return all accumulated value_13 pub fun liquidate(): @FungibleToken.Vault_13_13 // Get current position value_13 pub fun getBalance(): UFix64_13}
This interface enables YieldVaults to remain strategy-agnostic, allowing users to switch strategies or compose multiple strategies without changing vault logic.
TracerStrategy
TracerStrategy is the flagship strategy that implements automated leveraged yield farming by bridging ALP lending positions with external DeFi yield opportunities.
How It Works
TracerStrategy combines three components to create leveraged yield:
ALP Position (Collateral & Borrowing): Deposits collateral (FLOW, stFLOW, etc.) to ALP, borrows MOET against collateral up to 80% of value, and maintains health factor at target of 1.3.
Swap Connectors (Token Conversion): Converts MOET to yield-bearing tokens (LP tokens, farm tokens), converts yield tokens back to FLOW for rebalancing, and provides slippage protection on all swaps.
AutoBalancer (Yield Management): Deposits yield tokens to ERC4626 vaults, monitors value and triggers rebalancing at 95%-105% thresholds, and automatically manages position health.
Capital Flow Diagram
_33sequenceDiagram_33 participant User_33 participant Strategy as TracerStrategy_33 participant Position as ALP Position_33 participant Swap as SwapConnectors_33 participant AB as AutoBalancer_33 participant Vault as ERC4626 Vault_33_33 User->>Strategy: deposit(1000 FLOW)_33 Strategy->>Position: deposit(1000 FLOW)_33 Position->>Position: Calculate borrowing capacity_33 Note over Position: EC = 1000 × $1 × 0.8 = $800<br/>Max borrow = 800 / 1.3 = $615.38_33 Position->>Position: borrow(615.38 MOET)_33 Position-->>Strategy: 615.38 MOET_33_33 Strategy->>Swap: swap(615.38 MOET → YieldToken)_33 Swap-->>Strategy: ~610 YieldToken (slippage)_33_33 Strategy->>AB: deposit(610 YieldToken)_33 AB->>Vault: deposit(610 YieldToken)_33 Vault-->>AB: 610 shares_33_33 Note over AB,Vault: Yield accrues over time_33_33 AB->>AB: Monitor ratio<br/>(Current / Historical)_33_33 alt Ratio > 105%_33 AB->>Vault: withdraw(excess)_33 Vault-->>AB: YieldToken_33 AB->>Swap: swap(YieldToken → FLOW)_33 Swap-->>AB: FLOW_33 AB->>Position: deposit(FLOW)_33 end
Example: Leveraged Farming with 1000 FLOW
Let's walk through a complete TracerStrategy lifecycle:
Initial Deposit:
_28User deposits: 1000 FLOW @ $1.00 = $1,000_28_28Step 1: Deposit to ALP Position_28 - Collateral: 1000 FLOW_28 - Collateral Factor: 0.8 (80%)_28 - Effective Collateral: $1,000 × 0.8 = $800_28_28Step 2: Calculate borrowing at target HF = 1.3_28 - Target Debt = EC / Target HF = $800 / 1.3 = $615.38_28 - Position borrows: 615.38 MOET_28_28Step 3: Swap MOET → YieldToken_28 - Swap 615.38 MOET via Uniswap V3_28 - Receive ~610 YieldToken (assuming 1% slippage)_28 - Slippage protection: min 608.92 YieldToken (1% tolerance)_28_28Step 4: Deposit to ERC4626 Vault_28 - AutoBalancer deposits 610 YieldToken_28 - Receives 610 vault shares_28 - Historical deposit value: $610 (tracked for rebalancing)_28_28Position Summary:_28 - Collateral: 1000 FLOW ($1,000)_28 - Debt: 615.38 MOET ($615.38)_28 - Yield Tokens: 610 ($610 equivalent)_28 - Health Factor: 800 / 615.38 = 1.30 ✓_28 - Effective Exposure: $1,000 collateral + $610 yield = $1,610_28 - Leverage: 1.61x
After Yield Accrues (10% APY over time):
_23ERC4626 vault generates yield:_23 - Initial: 610 YieldToken_23 - After yield: 671 YieldToken (+10%)_23 - Current value: $671_23_23Rebalancing check:_23 - Current: $671_23 - Historical: $610_23 - Ratio: 671 / 610 = 1.10 = 110%_23 - Threshold exceeded! (> 105%)_23_23Rebalancing action:_23 - Excess: $671 - $610 = $61_23 - Withdraw 61 YieldToken from vault_23 - Swap 61 YieldToken → ~60.4 FLOW_23 - Deposit 60.4 FLOW to position as additional collateral_23_23After rebalancing:_23 - Collateral: 1060.4 FLOW ($1,060.40)_23 - Debt: 615.38 MOET (unchanged)_23 - Yield Tokens: 610 (back to historical baseline)_23 - Health Factor: (1060.4 × 0.8) / 615.38 = 1.38_23 - Result: Profits locked in as additional collateral
Configuration Parameters
TracerStrategy accepts the following configuration:
_18pub struct TracerStrategyConfig {_18 // ALP position parameters_18 pub let targetHealthFactor: UFix64 // Default: 1.3_18 pub let collateralFactor: UFix64 // Token-specific (0.8 for FLOW)_18_18 // AutoBalancer thresholds_18 pub let upperRebalanceThreshold: UFix64 // Default: 1.05 (105%)_18 pub let lowerRebalanceThreshold: UFix64 // Default: 0.95 (95%)_18_18 // Swap connector configuration_18 pub let swapSlippageTolerance: UFix64 // Default: 0.01 (1%)_18_18 // ERC4626 vault address_18 pub let vaultAddress: Address // Target yield vault_18_18 // Rebalancing frequency_18 pub let rebalanceIntervalSeconds: UInt64 // Default: 60_18}
Risk Considerations
Liquidation Risk: If FLOW price drops significantly, health factor could fall below 1.0, triggering liquidation. The target HF of 1.3 provides a 30% buffer.
Smart Contract Risk: Relies on ERC4626 vault security and ALP lending pool security.
Slippage Risk: Large swaps may experience higher slippage than configured tolerance, causing transaction revert.
Yield Volatility: ERC4626 vault yields fluctuate based on market conditions. Negative yield would trigger deficit rebalancing.
Impermanent Loss (if using LP tokens): LP token strategies may experience impermanent loss relative to holding underlying assets.
mUSDCStrategy
mUSDCStrategy enables cross-chain yield farming by bridging USDC from Flow to EVM-compatible chains and depositing into ERC4626 vaults.
How It Works
mUSDCStrategy uses Flow's EVM bridge to access Ethereum-based yield opportunities:
Bridge Locking: Locks USDC in Flow bridge escrow, mints bridged USDC on EVM side, and maintains 1:1 backing.
EVM Deployment: CadenceOwnedAccount controls EVM address, deposits bridged USDC to ERC4626 vault, and accrues yield in EVM vault.
Yield Management: AutoBalancer monitors EVM vault balance, triggers rebalancing at thresholds, and bridges tokens back to Flow when needed.
Capital Flow
_25sequenceDiagram_25 participant User_25 participant Strategy as mUSDCStrategy_25 participant Bridge as FlowEVMBridge_25 participant EVM as EVM Side_25 participant Vault as ERC4626 (EVM)_25_25 User->>Strategy: deposit(1000 USDC)_25 Strategy->>Bridge: bridge(1000 USDC)_25 Bridge->>Bridge: Lock USDC in escrow_25 Bridge->>EVM: Mint 1000 bridged USDC_25_25 Strategy->>EVM: deposit(1000 USDC)_25 EVM->>Vault: deposit(1000 USDC)_25 Vault-->>EVM: 1000 shares_25_25 Note over Vault: Yield accrues_25_25 alt Rebalancing needed_25 Strategy->>Vault: withdraw(amount)_25 Vault-->>EVM: USDC_25 EVM->>Bridge: Burn bridged USDC_25 Bridge->>Bridge: Unlock USDC_25 Bridge-->>Strategy: USDC on Flow_25 end
Example: Cross-Chain Yield
_22User deposits: 1000 USDC (Flow native)_22_22Step 1: Bridge to EVM_22 - Lock 1000 USDC in Flow bridge contract_22 - Mint 1000 bridged USDC on EVM side_22 - Transaction hash: 0x123... (tracked for verification)_22_22Step 2: Deposit to EVM Vault_22 - CadenceOwnedAccount deposits to ERC4626 vault_22 - Vault address: 0x789... (configured)_22 - Receive 1000 vault shares_22_22Step 3: Yield Accrual (8% APY on EVM side)_22 - After time: 1080 shares value_22 - Ratio: 1080 / 1000 = 1.08 = 108%_22 - Exceeds 105% threshold_22_22Step 4: Rebalancing_22 - Withdraw 80 USDC from EVM vault_22 - Burn 80 bridged USDC on EVM_22 - Unlock 80 USDC on Flow_22 - User can claim or compound
Cross-Chain Considerations
Bridge Security: Relies on Flow-EVM bridge security and escrow mechanisms.
Gas Costs: EVM transactions require gas fees paid in bridged FLOW.
Bridge Latency: Cross-chain operations take longer than native Flow transactions (typically 1-2 minutes).
EVM Vault Risk: Subject to risks of the specific EVM vault implementation.
Exchange Rate Peg: Bridged USDC maintains 1:1 peg with Flow USDC through bridge mechanics.
Strategy Comparison
| Feature | TracerStrategy | mUSDCStrategy |
|---|---|---|
| Leverage | Yes (via ALP borrowing) | No (direct deposit) |
| Chain | Flow native | Flow → EVM bridge |
| Complexity | High (multi-step) | Medium (bridge + deposit) |
| Gas Costs | Low (Flow only) | Higher (Flow + EVM) |
| Yield Source | ERC4626 on Flow EVM | ERC4626 on external EVM |
| Collateral | FLOW, stFLOW, etc. | USDC |
| Liquidation Risk | Yes (borrowed position) | No (no borrowing) |
| Target Users | Higher risk/reward | Conservative yield farmers |
Creating a Strategy Instance
To use a strategy, create it via the StrategyFactory:
_26import FlowYieldVaults from 0xFlowYieldVaults_26import FungibleToken from 0xFungibleToken_26_26transaction {_26 prepare(signer: AuthAccount) {_26 // Get strategy factory_26 let factory = FlowYieldVaults.getStrategyFactory()_26_26 // Check available strategies_26 let strategies = factory.getStrategyNames()_26 // Returns: ["TracerStrategy", "mUSDCStrategy"]_26_26 // Create TracerStrategy instance_26 let strategy <- factory.createStrategy(_26 strategyName: "TracerStrategy",_26 collateralType: Type<@FlowToken.Vault>()_26 )_26_26 // Create vault with strategy_26 let manager = signer.borrow<&FlowYieldVaults.YieldVaultManager>(_26 from: FlowYieldVaults.YieldVaultManagerStoragePath_26 ) ?? panic("Manager not found")_26_26 manager.createVault(strategy: <-strategy)_26 }_26}
Strategy Lifecycle
All strategies follow a consistent lifecycle:
1. Initialization: Strategy created via StrategyFactory with configured connectors, AutoBalancer created and linked, ALP Position created (for leveraged strategies), and strategy registered in SchedulerRegistry.
2. Deposit Phase: User deposits collateral, strategy converts to yield-bearing position, AutoBalancer tracks initial value, and first rebalance scheduled.
3. Active Phase: Yield accrues in target vaults, AutoBalancer monitors continuously (every 60 seconds), rebalancing triggers at thresholds, and profits are locked or deficits recovered.
4. Withdrawal: User requests withdrawal, strategy converts yield tokens back to collateral (via swaps), AutoBalancer withdraws from vaults as needed, and user receives collateral tokens.
5. Liquidation: User closes vault, strategy liquidates all positions (closes ALP position for leveraged strategies), converts all value to collateral, and returns final value to user.
Best Practices
Start Conservative: Begin with smaller amounts to understand strategy behavior before committing large capital.
Monitor Health Factor (TracerStrategy): Keep health factor well above 1.1 to avoid liquidation risk. The default 1.3 target provides good buffer.
Understand Rebalancing: Rebalancing frequency and thresholds impact gas costs vs. optimization. Default 60-second interval with 95%-105% thresholds balance efficiency.
Consider Gas Costs (mUSDCStrategy): EVM transactions cost more than Flow native operations. Factor gas into yield calculations.
Diversify Strategies: Use multiple vaults with different strategies to spread risk across yield sources.
Track Performance: Monitor actual yields vs. expectations. ERC4626 vault yields vary with market conditions.
Advanced: Custom Strategies
Developers can create custom strategies by implementing the Strategy interface and registering a StrategyComposer with the factory. Custom strategies can leverage unique yield sources, implement different risk profiles, use alternative rebalancing logic, or combine multiple yield mechanisms.
See DeFi Actions for details on composing custom strategies.
Summary
FYV strategies transform collateral into yield through different approaches: TracerStrategy uses leveraged borrowing and yield farming for amplified returns, while mUSDCStrategy provides cross-chain access to EVM yield opportunities. Both strategies leverage AutoBalancer for continuous optimization and maintain consistent interfaces through the Strategy pattern.
Key concepts:
- All strategies implement the same interface for consistency
- TracerStrategy achieves 1.6x+ leverage through ALP integration
- mUSDCStrategy bridges to EVM for broader yield access
- AutoBalancer handles continuous optimization for all strategies
- Configuration parameters control risk/reward tradeoffs
Next Steps
- Understand rebalancing: Read AutoBalancer
- Learn leverage mechanics: Explore Leveraged Farming
- Create your first vault: Follow Vault Lifecycle
- Cross-chain details: See Cross-Chain Integration
TracerStrategy amplifies returns through leverage (1.6x+ exposure) but carries liquidation risk. mUSDCStrategy provides conservative cross-chain yield without leverage. Choose based on your risk tolerance and yield goals.