Deploying Wrappers
Learn how to deploy asset wrappers for integrating new asset types with Flux Protocol.
Deploying a Wrapper
For Standard ERC20 Tokens
Most ERC20 tokens can use the standard wrapper:
// Deploy ERC20 wrapper for USDT
IAssetFactory factory = IAssetFactory(ASSET_FACTORY_ADDRESS);
address usdtWrapper = factory.deployERC20Wrapper(
USDT_ADDRESS, // Underlying token
ORACLE_ADDRESS, // Price oracle
"Wrapped USDT", // Wrapper name
"wUSDT" // Wrapper symbol
);For LP Tokens
Deploy LP wrapper for Uniswap V2/V3 positions:
// Deploy Uniswap V2 LP wrapper
address lpWrapper = factory.deployUniswapV2Wrapper(
UNI_V2_PAIR_ADDRESS, // LP token address
ORACLE_REGISTRY, // Oracle for pricing
"Wrapped UNI-V2",
"wUNI-V2"
);For Yield-Bearing Tokens
Deploy wrappers for assets that accrue value:
Wrapper Factory
The wrapper factory simplifies deployment:
Verification
After deployment, verify the wrapper:
Adding to Strategy
After deploying, add wrapper to strategy's allowed assets:
Best Practices
Verify oracle - Ensure reliable price feed
Test thoroughly - Test deposit/withdraw flows
Check decimals - Handle decimal conversions correctly
Audit custom wrappers - Get security review
Document clearly - Explain wrapper behavior
Example: Custom Wrapper
Related Documentation
Custom Wrapper Development - Build custom wrappers
Asset Wrappers Concept - Understanding wrappers
Oracle Integration - Setting up oracles
Last updated