Contract b25f50442fa2074322dd9bfe707588887bcd23f33b74f9fbc3e679ea7d615b84

← Back to Index 📥 Download WASM

Meta

rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.94.1

Instances

  • CCJX6PSAV5PGVF32RCOSHJMUYH7P4VZ4GOQXCYQPOKEJ2QVU6HELCGBK

Interface

Atomic arb cycle. Caller specifies the route; contract just executes.

Returns the final amount of principal_token received (must be >= min_amount_out or the transaction reverts).

fn cycle_swap(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    principal_token: soroban_sdk::Address,
    amount_in: i128,
    min_amount_out: i128,
    hops: soroban_sdk::Vec,
) -> i128

Read-only: simulate the cycle without state changes. Returns the expected final amount given current pool state, OR errors if a hop would fail. Off-chain caller should use this to pre-validate before firing cycle_swap.

NOTE: This is a placeholder; actual implementation requires read-only venue interfaces (e.g., Aqua's estimate_swap). Will be filled in v0.2.

fn estimate_cycle(
    env: soroban_sdk::Env,
    _principal_token: soroban_sdk::Address,
    _amount_in: i128,
    _hops: soroban_sdk::Vec,
) -> i128

Imports

WebAssembly Text (WAT) ▶