DeFi Composer
Overview
function executeStrategy(uint256 amount) external {
// 1. Swap 50% USDC to SOL via Jupiter
IJupiter(JUPITER).swap(USDC, SOL, amount / 2, minSolOut);
// 2. Deposit SOL as collateral on Kamino
IKamino(KAMINO).deposit(SOL, solAmount);
// 3. Borrow USDC against SOL collateral
IKamino(KAMINO).borrow(USDC, borrowAmount);
// 4. Open SOL-PERP short on Drift (delta hedge)
IDrift(DRIFT).placeOrder(SOL_PERP, SHORT, size, leverage);
// All atomic. One Solidity function. Four CPI hops.
}Why Solidity for DeFi Composition?
Reference Strategies (Planned)
Strategy
Protocols
Description
Status
What's Next
Last updated
Was this helpful?