Common Patterns
The SendParam in the following pattern are based on LayerZero patterns extensions: https://docs.layerzero.network/v2/developers/evm/oft/oft-patterns-extensions
Integration Patterns
Pattern 1: Same-Chain Deposit (Hub Only)
// Direct deposit on hub chain
uint256 usdtAmount = 1000 * 1e6;
uint256 minShares = 990 * 1e18;
IERC20(usdt).approve(depositPipe, usdtAmount);
uint256 shares = IDepositPipe(depositPipe).deposit(
usdtAmount,
msg.sender,
msg.sender,
minShares
);
// Shares minted instantlyPattern 2: Cross-Chain Deposit (Spoke → Hub)
Pattern 3: Cross-Chain Deposit (Spoke → Hub → Different Spoke)
Pattern 4: Same-Chain Instant Redemption
Pattern 5: Cross-Chain Redemption (Spoke → Hub → Spoke)
Pattern 6: Transfer Shares Between Spokes
Pattern 7: Direct Composer Methods (Hub Only)
Pattern 8: Standard Redemption Request (Hub Only)
Developer Guide
1. Reading NAV and Share Prices
2. Handling Different Asset Decimals
3. Slippage Protection Best Practices
4. Gas Estimation for LayerZero Operations
5. Error Handling
6. Monitoring Cross-Chain Transactions
7. Important Limits and Constraints
8. Fee Information
9. Operator Pattern
10. Blacklist Handling
11. Pause Handling
12. Composer Message Structure Reference
13. Helper Functions
Last updated