Raum NetworkDeveloper Docs
RaumFi v3

RaumFi v3 Reference

Reference documentation for RaumFi v3 Soroban CLMM functions, deployed testnet contract IDs, router methods, position manager APIs, quoter, tick lens, and wallet integrations.

Factory

FunctionDescription
initialize(admin, wasm_hash, position_manager)One-time setup. Registers the default fee tiers (500 / 3000 / 10000, i.e. 0.05% / 0.3% / 1%) and stores the pool WASM hash and position manager address.
create_pool(token_a, token_b, fee, initial_tick) -> AddressAdmin-gated unless permissionless creation is enabled. Deploys a new pool at a deterministic address salted from the sorted token pair and fee, then initializes it at initial_tick (must align to that fee tier's tick spacing).
get_pool(token_a, token_b, fee) -> AddressLooks up an existing pool.
get_position_manager() -> AddressReturns the NFT position manager address every pool trusts for add_liquidity.
enable_fee_tier(fee, tick_spacing)Admin-gated. Registers a new fee tier.
set_permissionless_pool_creation(enabled) / set_paused(paused)Admin-gated protocol switches.
propose_admin_transfer(new_admin) / accept_admin_transfer() / cancel_admin_transfer()24-hour timelocked admin handoff - accept reverts if called before the ETA.
set_pool_protocol_fee / collect_pool_protocol_fees / set_pool_paused / set_pool_max_tick_crossesAdmin-gated pass-throughs that invoke the matching function on a given pool contract.

Pool

FunctionDescription
initialize(factory, token0, token1, fee, tick_spacing, initial_tick, position_manager)Called once by the factory. Sets the initial sqrt_price_x96 from initial_tick and seeds the oracle's first observation.
add_liquidity(provider, tick_lower, tick_upper, liquidity) -> (u128, u128)Callable only by the pool's registered position manager; provider must also separately authorize the token transfer. Returns amounts of token0/token1 pulled in.
remove_liquidity(...)Inverse of add_liquidity - reduces a tick range's liquidity and returns the underlying amounts.
swap(payer, recipient, zero_for_one, amount_specified, sqrt_price_limit_x96) -> (i128, i128)Core swap execution, walking across ticks until amount_specified is filled or sqrt_price_limit_x96 is hit. Reverts if the pool is paused or has zero active liquidity.
mint / burn / collectLower-level position lifecycle hooks used internally by add_liquidity/remove_liquidity and by the position manager's fee collection.
get_fee_growth_inside(tick_lower, tick_upper)Fee growth accrued inside a tick range, used to checkpoint a position's owed fees.
observe(seconds_ago: Vec<u32>) -> Vec<(i64, u128)>TWAP oracle read - cumulative tick and liquidity values at each requested offset into the past.
get_state() -> PoolState / get_tick(tick) -> TickData / get_oracle_config()Read-only state accessors.
set_protocol_fee / set_paused / set_max_tick_crosses_per_swap / collect_protocol_feesAdmin-only, invoked through the factory's pass-through functions rather than called directly.

Router

FunctionDescription
initialize(admin, factory, xlm)One-time setup.
swap_exact_input(path, amount_in, amount_out_minimum, payer, recipient, deadline, sqrt_price_limit_x96) -> i128Fixed input amount, minimum output. Single-hop only in the current implementation.
swap_exact_output(path, amount_out, amount_in_maximum, payer, recipient, deadline, sqrt_price_limit_x96) -> i128Fixed output amount, maximum input. Single-hop only.
add_liquidity(token_a, token_b, fee, tick_lower, tick_upper, liquidity, to) -> (u128, u128, u64)Convenience wrapper - resolves the position manager via the factory and calls its mint.

Position manager

FunctionDescription
initialize(admin, factory, name, symbol)Sets the NFT collection's metadata; base URI is https://clmm.raum.network/positions/.
mint(token_a, token_b, fee, to, tick_lower, tick_upper, liquidity) -> (u128, u128, u32)Resolves the pool, mints a sequential NFT token_id to to, calls the pool's add_liquidity, and stores the position's tick range, liquidity, and initial fee-growth checkpoint.
burn / collect(pool, to, token_id)Reduce or exit a position and claim accrued fees.
get_position(token_id) -> PositionDataFull position state for one NFT.
balance_of(owner) / get_owned_tokens(owner) / get_owned_tokens_page(owner, cursor, limit)Enumerable-NFT ownership queries; the paged variant caps at MAX_OWNED_TOKENS_PAGE_SIZE (25).
set_approval_for_all(owner, operator, approved)Standard NFT operator approval.
refresh_position_ttl(token_id)Extends the position's persistent-storage TTL.

Quoter & tick lens

FunctionDescription
quoter.quote_exact_input(pool, token_in, token_out, fee, amount_in, sqrt_price_limit_x96) -> i128Simulates swap_exact_input against current pool/tick state without executing a trade or requiring auth.
quoter.quote(pool, zero_for_one, amount_in, sqrt_price_limit_x96) -> i128Same simulation, addressed by direction instead of token addresses.
tick_lens.get_pool_state(pool) / get_tick(pool, tick)Read-only proxies to a pool's state and per-tick data.
tick_lens.get_ticks_page(...)Paginated scan across a pool's initialized ticks, for building liquidity-depth charts.

Governance

FunctionDescription
initialize(admin, voting_token)One-time setup with the token used to weight votes.
propose(...)Creates a new proposal.
vote(voter, proposal_id, support)Casts a vote weighted by the voter's balance of voting_token.
execute(proposal_id)Executes a passed proposal.
get_proposal(proposal_id) -> ProposalReads proposal state.

Testnet contract IDs

The values the frontend ships with, from frontend/src/contracts/config.ts:

export const CONTRACT_IDS = {
  governance: "CA6BSIKXUSYVNBPYENS3EFBHLOXFO3TKNGOAFU45XIZPOM2DEDU5FKU2",
  factory: "CBXSK5BVCT6NGRCLXCUDUQCD44FV6K62KWFHDE5NELLIMXD5KS53RWWS",
  router: "CBHWSUDOTZSMSFXA2KGCME64DXP2VYSOOARGTUXNUQJTFPLEV3GCDMFV",
  position_manager: "CBNI32C7WLRU5QG7B65RGQM5KYSO45DZHA4CGUAPS3NS62YUEPQD4ZHA",
  xlm: "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC",
  usdc: "CAHJIFKJY4NJ5G4MXHVDI74IT4PXF4IW3BXEPLAEMZYJDY6COMKNHNVD",
  xlm_usdc_pool: "CDQ7F6DEP5T2HCUDCHJLQD54HJHR6OZHYCRTLFLE5AQ5CXBE76UVML47",
};
export const NETWORK_PASSPHRASE = "Test SDF Network ; September 2015";
export const RPC_URL = "https://soroban-testnet.stellar.org";

These are Stellar Testnet deployments, with one live pool pre-configured: XLM/USDC. The live app at clmm.raum.network points at this configuration.

Wallet integrations

The frontend's StellarContext supports Freighter (@stellar/freighter-api), Albedo (@albedo-link/intent), Lobstr (@lobstrco/signer-extension-api), Ledger hardware wallets (@ledgerhq/hw-app-str), and WalletConnect (@walletconnect/sign-client).