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