Contract 1711b7c790a978c7382584e121cee7883a557a11cd91177fdbeee4320a96f9c0

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.94.1

Instances

  • CBJBQMSBXYBOSRK6WLBAEVGF2GXQVPTYVVMVDGZF7ZBJHHFT2IGJNDMN

Interface

Get swap quote from Aquarius (for view functions)

Arguments

  • from_token - Token to swap from
  • to_token - Token to swap to
  • amount_in - Amount to get quote for

Returns

  • Expected output amount
fn get_quote(
    env: soroban_sdk::Env,
    from_token: soroban_sdk::Address,
    to_token: soroban_sdk::Address,
    amount_in: u128,
) -> Result

Get current Aquarius router address

fn get_router(
    env: soroban_sdk::Env,
) -> Result

Initialize adapter with Aquarius router address

Arguments

  • admin - Admin address (can update router)
  • aquarius_router - Aquarius router contract address
fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    aquarius_router: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Update Aquarius router address (admin only)

fn set_router(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    aquarius_router: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Execute swap via Aquarius (K2 standard interface)

This is called by K2 contracts. It translates K2's simple interface to Aquarius's specific requirements (sorted tokens, pool_index, etc.)

Arguments

  • from_token - Token to swap from
  • to_token - Token to swap to
  • amount_in - Amount to swap
  • min_amount_out - Minimum acceptable output (slippage protection)
  • recipient - Address to receive output tokens

Returns

  • Actual amount of tokens received
fn execute_swap(
    env: soroban_sdk::Env,
    from_token: soroban_sdk::Address,
    to_token: soroban_sdk::Address,
    amount_in: u128,
    min_amount_out: u128,
    recipient: soroban_sdk::Address,
) -> Result

Register a pool for a token pair (admin only)

Arguments

  • caller - Must be admin
  • token_a - First token
  • token_b - Second token
  • pool_address - Pool contract address from Aquarius
fn register_pool(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    token_a: soroban_sdk::Address,
    token_b: soroban_sdk::Address,
    pool_address: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Get the contract address allowed to execute swaps.

fn get_trusted_caller(
    env: soroban_sdk::Env,
) -> Result

Update the contract address allowed to execute swaps (admin only).

fn set_trusted_caller(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    trusted_caller: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶