Contract ae37f6605ebe97eaad0699c61a4a69bf582b5d30b6e460bb4256f38cfc1c03f1

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.97.1

Instances

  • CDZWRA73MM4UNWYZ5FOYFQEZ5PLIZMSRHTBLS2PORBHXWOJOV7AFTUT3

Interface

Execute one atomic cyclic arbitrage.

  • profit_token - the anchor asset that opens and closes the cycle (normally native XLM's SAC). Principal is pulled from the admin and the full closing balance is returned to the admin.
  • amount_in - principal to pull from the admin.
  • min_profit - required surplus; the tx reverts unless the closing balance >= amount_in + min_profit.
  • hops - ordered venue swaps; each pulls its input from this contract and leaves its output here for the next hop.
fn run(
    env: soroban_sdk::Env,
    profit_token: soroban_sdk::Address,
    amount_in: i128,
    min_profit: i128,
    hops: soroban_sdk::Vec,
) -> Result

One-time: set the admin (the bot's Stellar account).

fn init(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
fn admin(env: soroban_sdk::Env) -> Result

Recover stranded dust (drift surplus of any token) to the admin.

fn sweep(
    env: soroban_sdk::Env,
    token_addr: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶