fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
fn pause(env: soroban_sdk::Env)
fn unpause(env: soroban_sdk::Env)
Upgrade the contract WASM. Only callable by admin.
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
Returns price of sXLM in XLM (scaled by 1e7).
fn get_price(env: soroban_sdk::Env) -> i128
fn is_paused(env: soroban_sdk::Env) -> bool
fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
Initialize the LP pool.
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
sxlm_token: soroban_sdk::Address,
native_token: soroban_sdk::Address,
fee_bps: u32,
)
fn get_fee_bps(env: soroban_sdk::Env) -> i128
Returns (reserve_xlm, reserve_sxlm).
fn get_reserves(env: soroban_sdk::Env) -> (i128, i128)
Add liquidity to the pool. Returns LP tokens minted. Only transfers the proportional amounts needed; excess stays with the user.
fn add_liquidity(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
xlm_amount: i128,
sxlm_amount: i128,
) -> i128
Bump instance TTL — can be called by anyone to keep contract alive.
fn bump_instance(env: soroban_sdk::Env)
fn get_lp_balance(env: soroban_sdk::Env, user: soroban_sdk::Address) -> i128
fn total_lp_supply(env: soroban_sdk::Env) -> i128
Remove liquidity from the pool. Returns (xlm_out, sxlm_out).
fn remove_liquidity(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
lp_amount: i128,
) -> (i128, i128)
Swap sXLM for XLM. Returns XLM received. min_out provides slippage protection.
fn swap_sxlm_to_xlm(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
sxlm_amount: i128,
min_out: i128,
) -> i128
Swap XLM for sXLM. Returns sXLM received. min_out provides slippage protection.
fn swap_xlm_to_sxlm(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
xlm_amount: i128,
min_out: i128,
) -> i128