Contract 9677074ae7fce0e8c41747377da02ebf4e1cf06902c60c4fe64ea0ee6aab4545

← Back to Index 📥 Download WASM

Meta

rssdkver 23.0.2#a97daf8b07cdf24e9bd45e344db51a21b9ea77d3
rsver 1.88.0

Instances

  • CAUF4DFYSX52L2KJ4J7OFW3WDQMEUDVXNB7PG5VIC4VVOA3BCLWXDO2E

Interface

Initialize the router with factory and XLM addresses Following Uniswap V3's permissionless design

fn init_router(
    env: soroban_sdk::Env,
    factory: soroban_sdk::Address,
    xlm: soroban_sdk::Address,
) -> Result<(), SwapRouterError>

Swap exact amount of input tokens for as many output tokens as possible Single hop version

Uses Soroban's authorization framework - no pre-approval needed! The user's signature authorizes both the router call and the pool's token transfers.

fn swap_exact_input_single(
    env: soroban_sdk::Env,
    params: ExactInputSingleParams,
) -> Result

Swap exact amount of input tokens for as many output tokens as possible Multi-hop version (e.g., Token A → B → C in single transaction)

Uses Soroban's authorization framework for atomic multi-hop swaps. First hop: Pool pulls from user. Subsequent hops: Pools use prefunded tokens.

fn swap_exact_input(
    env: soroban_sdk::Env,
    params: ExactInputParams,
) -> Result

Swap as few input tokens as possible for exact amount of output tokens Not implemented (requires reverse-path coordination and token custody).

fn swap_exact_output_single(
    env: soroban_sdk::Env,
    params: ExactOutputSingleParams,
) -> Result
fn swap_exact_output(
    env: soroban_sdk::Env,
    params: ExactOutputParams,
) -> Result

Quote exact input multi-hop swap without execution Returns the expected output amount

fn quote_exact_input(
    env: soroban_sdk::Env,
    params: ExactInputParams,
) -> Result

Quote exact output multi-hop swap without execution Returns the required input amount

fn quote_exact_output(
    env: soroban_sdk::Env,
    params: ExactOutputParams,
) -> Result

Quote single exact input swap without execution

fn quote_exact_input_single(
    env: soroban_sdk::Env,
    params: ExactInputSingleParams,
) -> Result

Quote single exact output swap without execution NOTE: Not supported in this implementation

fn quote_exact_output_single(
    env: soroban_sdk::Env,
    params: ExactOutputSingleParams,
) -> Result

Imports

WebAssembly Text (WAT) ▶