Contract 92142bb4577cf321f87081e168a082b0e5a83ba9e4cb5a552fb3dbbcc1b0d981

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.95.0

Instances

  • CDBLV5OXNEQ3XBGFH25ZZAEDOUVGDC3EIBTKXK42BINK3QHS3WWI3W5R

Interface

One Aquarius swap through the router's swap_chained.

pool_tokens — the pool's ordered token vector (canonical, by contract-id). For USDC/AQUA: [AQUA_SAC, USDC_SAC]. pool_index — the pool hash (BytesN<32>) from get_pools. pool — the pool contract address (the router pulls token_in into it; used for the auth subtree). token_in/out — SAC contract ids.

swap_chained(user, swaps_chain, token_in, in_amount, out_min): swaps_chain = [ (pool_tokens, pool_index, token_out) ] (single hop)

Returns the amount of token_out delivered (u128 -> i128).

fn swap_aqua(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    aqua_router: soroban_sdk::Address,
    pool: soroban_sdk::Address,
    pool_tokens: soroban_sdk::Vec,
    pool_index: soroban_sdk::BytesN<32>,
    token_in: soroban_sdk::Address,
    token_out: soroban_sdk::Address,
    amount_in: i128,
    amount_out_min: i128,
) -> i128

One Soroswap swap along path. (S1 — proven on mainnet.)

fn swap_soroswap(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    soroswap_router: soroban_sdk::Address,
    pool: soroban_sdk::Address,
    token_in: soroban_sdk::Address,
    token_out: soroban_sdk::Address,
    amount_in: i128,
    amount_out_min: i128,
    path: soroban_sdk::Vec,
    deadline: u64,
) -> i128

Imports

WebAssembly Text (WAT) ▶