Leverage
Core Structures for Leveraging
LeverageAction
struct LeverageAction {
IBorrowableCToken borrowToken; // The cToken you want to borrow from.
uint256 borrowAssets; // Amount of underlying tokens to borrow.
ICToken cToken; // cToken that will receive the swapped assets.
SwapperLib.Swap swapData; // Instructions for swapping borrowed tokens.
bytes auxData; // Optional protocol-specific data.
}DeleverageAction
struct DeleverageAction {
ICToken cToken; // The cToken you're unwinding
uint256 collateralAmount; // Amount of cTokens to redeem
IBorrowableCToken borrowToken; // The cToken debt to repay
SwapperLib.Swap[] swapData; // Array of swaps to execute
uint256 repayAmount; // Amount of debt to repay
bytes auxData; // Optional protocol-specific data
}SwapperLib.Swap
Pre, Post, and Auxiliary Swap Operations
Setting Up Your Environment
Monitoring Position Health
Last updated
Was this helpful?