Integration Guide
This guide provides everything you need to integrate Flux vaults as a liquidity provider, whether you're building a DeFi aggregator, a wallet, or simply depositing directly.
Overview
As an LP in Flux, you:
Deposit base assets (USDC, WETH, etc.) into ERC4626-compliant vaults
Receive vault shares representing your claim on vault assets
Earn yield from manager interest and fees
Can withdraw anytime (subject to vault liquidity)
Key Difference from "Trust-Me" Yield Models: Every Flux vault shows you exactly where your capital goes, what managers can do with it, and how you're protected.
Understanding Vault Safety
Before depositing, verify these safety mechanisms:
1. Collateralization Requirements
Check the vault's strategy to see minimum bond ratio:
IStrategy strategy = vault.STRATEGY();
uint256 minBondRatio = strategy.minBondRatio();
// Example: 0.2e18 = 20% bond required
// This means managers must post $20K bond to borrow $100K
// Bonds ensure managers have skin in the gameHigher bond ratio = More manager collateral = Safer for LPs.
2. Whitelisted Assets
See exactly what assets managers can hold:
No surprise exposure to risky assets. Everything is transparent.
3. Liquidation Parameters
Understand when positions get liquidated:
Lower liquidation threshold = Earlier liquidations = Less LP risk.
4. Strategy Immutability
Check if strategy parameters can change:
Immutable = No governance risk. Mutable = Flexibility with timelock protection.
Depositing to a Vault
Standard Deposit (ERC4626)
Preview Deposit (Check Share Price)
Deposit with Slippage Protection
Mint Specific Shares
See also: Depositing & Withdrawing.
Monitoring Your Position
Check Your Balance
Track Yield Growth
Monitor Vault Health
Withdrawing from a Vault
Standard Withdrawal (When Liquidity Available)
Redeem Shares
Redeem All (Exit Completely)
Preview Withdrawal
See also: Depositing & Withdrawing.
When Withdrawals Fail (High Utilization)
When vault has high utilization, withdrawals may fail due to insufficient liquidity. See Emergency Withdrawals for details on:
Waiting for natural repayments
ADL (Auto-Deleveraging) protection
Selling shares OTC
Emergency Withdrawal (Force Liquidate Manager)
Note: Flux does not have a traditional "emergency withdrawal" mechanism. If withdrawals fail due to insufficient liquidity, you must wait for:
Manager repayments (natural deleveraging)
ADL (Auto-Deleveraging) to free up liquidity
Or sell your shares OTC
See Emergency Withdrawals for complete details on handling withdrawal failures.
Integration Best Practices
1. Always Check Vault Safety Before Depositing
2. Monitor for Parameter Changes (Mutable Strategies)
3. Diversify Across Vaults
4. Set Up Automated Monitoring
Understanding Risks
1. Manager Default Risk
What: Manager's positions lose value faster than they can be liquidated.
Protection:
Manager bonds provide collateral buffer
Automated liquidations minimize lag
Strategy-aware risk engine catches issues early
Your Risk: Only if manager's bond is insufficient AND liquidation is delayed.
2. Oracle Failure Risk
What: Oracle provides incorrect prices, preventing accurate liquidations.
Protection:
Vaults use reputable oracles (Chainlink, etc.)
Multiple oracle sources where possible
Oracle staleness checks
Your Risk: If oracle fails completely, positions may not liquidate properly.
3. Smart Contract Risk
What: Bug in vault, strategy, or wrapper contracts.
Protection:
Audited contracts
Immutable core logic
Battle-tested on testnet
Your Risk: Always present in DeFi. Mitigate by checking audits and starting small.
4. Liquidity Risk
What: Cannot withdraw immediately when vault is fully utilized.
Protection:
Queued withdrawals
Emergency withdrawal option (with penalty)
Vault utilization monitoring
Your Risk: May need to wait for liquidity or pay penalty for emergency exit.
Vault Selection Criteria
When choosing a vault, consider:
Conservative (Low Risk, Lower Yield)
Immutable strategy
High bond ratio (25-30%)
High liquidation buffer (15-20%)
Well-known assets only (WETH, WBTC, USDC)
Low utilization (<70%)
Established vault with track record
Moderate (Balanced Risk/Yield)
Mutable or immutable strategy
Medium bond ratio (20-25%)
Medium liquidation buffer (10-15%)
Mix of established and newer assets
Medium utilization (70-85%)
Some track record
Aggressive (Higher Risk, Higher Yield)
Mutable strategy
Low bond ratio (15-20%)
Low liquidation buffer (5-10%)
Includes newer/riskier assets
High utilization (85-95%)
Newer vault
Sample Integration
Here's a complete LP integration example:
Next Steps
Learn More:
Last updated