Contract b742a5cced1bae977021e12e8ca36eccef6d56e2211be320af776f4e8ac21e34

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.89.0

Instances

  • CABHBBHFVDHYQKDTIBK5FCL4BX2QFJWOI5OL5HLYMWZJK3D6QQDIJVSC

Interface

Initializes admin (withdraw/pause/upgrade/set_receiver), submitter (the only address allowed to call execute), and the Blend-pool allow-list. The receiver is wired separately post-deploy via set_receiver (circular dep).

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    submitter: soroban_sdk::Address,
    allowed_pools: soroban_sdk::Vec,
)
fn get_config(env: soroban_sdk::Env) -> ExecutorConfig
fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
fn set_submitter(env: soroban_sdk::Env, new_submitter: soroban_sdk::Address)
fn set_allowed_pools(
    env: soroban_sdk::Env,
    pools: soroban_sdk::Vec,
)

Admin-only: wire the deployed receiver. Required before execute works.

fn set_receiver(env: soroban_sdk::Env, receiver: soroban_sdk::Address)
fn pause(env: soroban_sdk::Env)
fn unpause(env: soroban_sdk::Env)

Admin-only profit sweep. The contract accumulates profit (spec: no auto-sweep).

fn withdraw(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    amount: i128,
    to: soroban_sdk::Address,
)
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

Runs one flash-loan-financed arb route atomically. Only the configured submitter may call. Returns realized profit in loan_asset raw units.

Two-contract flow (avoids Soroban's re-entry prohibition): arm the receiver (sub-call returns → receiver off-stack) → approve the pool → flash_loan (pool calls the now-off-stack receiver's exec_op, a fresh invocation) → disarm (proves the callback ran) → assert profit on the real balance delta.

fn execute(
    env: soroban_sdk::Env,
    blend_pool: soroban_sdk::Address,
    loan_asset: soroban_sdk::Address,
    loan_amount: i128,
    legs: soroban_sdk::Vec,
    min_profit: i128,
    deadline_ledger: u32,
) -> i128

Runs one arb cycle financed from this contract's own asset balance (operator deposits are plain transfers to this address; the admin's withdraw doubles as the rescue path). Same gates as execute minus the Blend allow-list — no pool is involved. Returns realized profit.

fn execute_owned(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    amount: i128,
    legs: soroban_sdk::Vec,
    min_profit: i128,
    deadline_ledger: u32,
) -> i128

Runs one flash-loan-financed liquidation fill atomically. Only the configured submitter may call. Returns realized profit in loan_asset raw units. Same two-contract shape as execute (see that doc comment); the difference is WHAT runs inside exec_op: a full Blend liquidation (pre-swaps -> submit_with_allowance -> post-swaps) instead of a swap chain. min_profit is the final on-chain safety net — a stale quote, moved price, or sandwich reverts the whole transaction here.

fn execute_fill(
    env: soroban_sdk::Env,
    source_pool: soroban_sdk::Address,
    loan_asset: soroban_sdk::Address,
    loan_amount: i128,
    plan: FillPlan,
    min_profit: i128,
    deadline_ledger: u32,
) -> i128

Imports

WebAssembly Text (WAT) ▶