Contract 15eeef673aa30936462faac39a8c27506d756750d2e663809122edb124d38017

← Back to Index 📥 Download WASM

Meta

rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.91.1

Interface

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

Execute a cyclic arbitrage atomically

The entire transaction reverts if the final balance is less than initial balance + min_profit. This ensures atomic safety.

Arguments

  • initiator - The caller who initiated the arbitrage
  • base_asset - The asset we start and end with (e.g., USDC)
  • legs - Vector of swap instructions
  • min_profit - Minimum profit required (reverts if not met)

Returns

  • ArbResult - Profit, fees, and legs executed
fn execute_cycle(
    env: soroban_sdk::Env,
    initiator: soroban_sdk::Address,
    base_asset: soroban_sdk::Address,
    legs: soroban_sdk::Vec,
    min_profit: i128,
) -> Result

Constructor (CAP-0058) replaces initialize Atomically sets the admin during deployment

fn __constructor(env: soroban_sdk::Env, admin: soroban_sdk::Address)

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>

Imports

WebAssembly Text (WAT) ▶