Withdraw tokens from the contract (admin only)
fn withdraw(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
token: soroban_sdk::Address,
amount: i128,
to: soroban_sdk::Address,
)
Get the admin address
fn get_admin(env: soroban_sdk::Env) -> soroban_sdk::Address
Initialize the contract with the admin address
fn initialize(env: soroban_sdk::Env, admin: soroban_sdk::Address)
Execute a cyclic arbitrage atomically
The entire transaction reverts if the final balance is less than initial balance + min_profit. This ensures atomic safety.
initiator - The caller who initiated the arbitragebase_asset - The asset we start and end with (e.g., USDC)legs - Vector of swap instructionsmin_profit - Minimum profit required (reverts if not met)ArbResult - Profit, fees, and legs executedfn execute_cycle(
env: soroban_sdk::Env,
initiator: soroban_sdk::Address,
base_asset: soroban_sdk::Address,
legs: soroban_sdk::Vec,
min_profit: i128,
) -> Result
Receive a flash loan callback Implements the FlashLoanReceiver trait for xycLoans/Blend integration
fn receive_flash_loan(
env: soroban_sdk::Env,
initiator: soroban_sdk::Address,
token: soroban_sdk::Address,
amount: i128,
fee: i128,
data: soroban_sdk::Bytes,
) -> Result<(), soroban_sdk::Error>