LLM Notice: This documentation site supports content negotiation for AI agents. Request any page with Accept: text/markdown or Accept: text/plain header to receive Markdown instead of HTML. Alternatively, append ?format=md to any URL. All markdown files are available at /md/ prefix paths. For all content in one file, visit /llms-full.txt
Skip to main content

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.


_13
pub 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


_33
sequenceDiagram
_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:


_28
User deposits: 1000 FLOW @ $1.00 = $1,000
_28
_28
Step 1: Deposit to ALP Position
_28
- Collateral: 1000 FLOW
_28
- Collateral Factor: 0.8 (80%)
_28
- Effective Collateral: $1,000 × 0.8 = $800
_28
_28
Step 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
_28
Step 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
_28
Step 4: Deposit to ERC4626 Vault
_28
- AutoBalancer deposits 610 YieldToken
_28
- Receives 610 vault shares
_28
- Historical deposit value: $610 (tracked for rebalancing)
_28
_28
Position 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):


_23
ERC4626 vault generates yield:
_23
- Initial: 610 YieldToken
_23
- After yield: 671 YieldToken (+10%)
_23
- Current value: $671
_23
_23
Rebalancing check:
_23
- Current: $671
_23
- Historical: $610
_23
- Ratio: 671 / 610 = 1.10 = 110%
_23
- Threshold exceeded! (> 105%)
_23
_23
Rebalancing 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
_23
After 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:


_18
pub 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


_25
sequenceDiagram
_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


_22
User deposits: 1000 USDC (Flow native)
_22
_22
Step 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
_22
Step 2: Deposit to EVM Vault
_22
- CadenceOwnedAccount deposits to ERC4626 vault
_22
- Vault address: 0x789... (configured)
_22
- Receive 1000 vault shares
_22
_22
Step 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
_22
Step 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

FeatureTracerStrategymUSDCStrategy
LeverageYes (via ALP borrowing)No (direct deposit)
ChainFlow nativeFlow → EVM bridge
ComplexityHigh (multi-step)Medium (bridge + deposit)
Gas CostsLow (Flow only)Higher (Flow + EVM)
Yield SourceERC4626 on Flow EVMERC4626 on external EVM
CollateralFLOW, stFLOW, etc.USDC
Liquidation RiskYes (borrowed position)No (no borrowing)
Target UsersHigher risk/rewardConservative yield farmers

Creating a Strategy Instance

To use a strategy, create it via the StrategyFactory:


_26
import FlowYieldVaults from 0xFlowYieldVaults
_26
import FungibleToken from 0xFungibleToken
_26
_26
transaction {
_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


Key Takeaway

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.