Contract 39d3311d358c9074ea834788ed95f3099425d460b1d834769e3a35be41a1e4ac

← Back to Index 📥 Download WASM

Meta

Description Flash loan arb receiver for Blend Protocol v2
Version 0.5.0
rssdkver 25.3.0#dcbea44513feb7734af6b6c4aced2c4a7a2715d0
rsver 1.92.0

Instances

  • CDUL7TYTGUNPVHM24SYCZOIG756PZ6J74KAAEFWJUDFMF7RX44GAV4GQ

Interface

fn admin(env: soroban_sdk::Env) -> Result
fn balance(env: soroban_sdk::Env, token: soroban_sdk::Address) -> i128

ModERC3156 callback (used by Blend Protocol v2). Called with: exec_op(caller=from/G-address, token, amount, fee=0)

Blend has already transferred amount tokens to this contract. After exec_op returns, Blend pulls repayment from caller (from) via transfer_from. So we must transfer the borrowed amount back to caller before returning.

fn exec_op(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    token: soroban_sdk::Address,
    amount: i128,
    fee: i128,
) -> Result<(), ArbError>
fn withdraw(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    amount: i128,
) -> Result<(), ArbError>
fn set_admin(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
) -> Result<(), ArbError>
fn blend_pool(env: soroban_sdk::Env) -> Result

Store arb parameters for the next exec_op call. Call this THEN call blend_pool.flash_loan(from, flash_loan, requests) in a follow-up tx. Params expire after ~100 ledgers (~8 min) if unused.

fn prepare_arb(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    params: ArbParams,
) -> Result<(), ArbError>
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    blend_pool: soroban_sdk::Address,
)
fn set_blend_pool(
    env: soroban_sdk::Env,
    pool: soroban_sdk::Address,
) -> Result<(), ArbError>
fn has_pending_arb(env: soroban_sdk::Env) -> bool
fn self_funded_arb(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    token_in: soroban_sdk::Address,
    amount_in: i128,
    min_profit: i128,
    legs: soroban_sdk::Vec,
) -> Result

Imports

WebAssembly Text (WAT) ▶