Contract 6b6df6a300d9bb17fa68a2d66a7f64de01048dc5bfc6b6aa2c4e61544408a166

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.91.1

Instances

  • CBS5UXK7LLPD3HG2RK5ITNCGXUZW6YOT5UT36VEMFINIU36TQFP5OIED
  • CC5XM4A2DZTI6JXRPV2W5RPY5LDZCK4NHQL2R5CMNHB4DSPZMOLCK2TP
  • CCHMWSXWBMOCT7N5NV2LDHMBNQQOEDZZ556RXMZNYJNYJ72RAQXYVG32
  • CCZZEWE2YROBYYCNMICHFIIWOMXSU72BMTSR2FAF4NFEZMH63WCXZ4NP
  • CDT3YD75ZISUM3KXJPM7DBSANR3ESXMZLOYVPMN2A3YVAV67N2IMHBPQ

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) ▶