Integration Guide
Overview
Getting Started
Step 1: Register an Executor
import {IFluxVaultFactory} from "flux-v1-contracts/interfaces/IFluxVaultFactory.sol";
contract ManagerSetup {
IFluxVaultFactory public factory;
function deployExecutor() external returns (address executor) {
// Deploy a Weiroll executor owned by you
executor = factory.deployWeirollExecutor();
// Automatically registered to msg.sender
// Can now borrow from any vault
}
}Step 2: Choose a Vault
Understanding the Unlock Pattern
Borrowing Capital
Initial Borrow
Check Borrowing Capacity
Trading Assets
Register Asset Wrapper
Execute Trade (Swap + Deposit)
Complex Multi-Protocol Strategy
Managing Collateral
Add Collateral (Improve Health)
Remove Collateral (If Health Allows)
Repaying Debt
Partial Repayment
Full Exit
Monitoring Position Health
Check Health Ratio
Set Up Alerts
Calculate Interest Owed
Advanced Patterns
Leveraged Yield Farming
Cross-Protocol Arbitrage
Best Practices
1. Always Monitor Health
2. Use Slippage Protection
3. Handle Callback Failures Gracefully
4. Test with Small Amounts First
5. Maintain Health Buffer
Risk Management
Interest Cost Tracking
Position Sizing
Complete Manager Integration Example
Learn More
Last updated