Raum NetworkDeveloper Docs
RaumFi v2

RaumFi v2 Overview

Technical overview for RaumFi v2, a Stellar Soroban constant-product AMM with factory, pair, router, LP token, and multi-hop swap components.

RaumFi v2 follows the same swap model as Uniswap V2: liquidity providers deposit two tokens into a pair, traders swap against that pool, and price moves along a constant-product curve (x * y = k). Every swap carries a 0.3% fee, taken from the input amount and left in the pool's reserves for liquidity providers.

The contracts live under corecontracts/ as four independent Soroban crates - there is no separate math/library crate; pricing math is duplicated locally inside the pair and router crates instead:

  • raumfi-factory - deploys new pair contracts at a deterministic address and keeps a registry of every pair created.
  • raumfi-pair - the AMM for one token pair. Holds reserves, executes deposit / swap / withdraw, and embeds its own SEP-41 LP token implementation directly in the contract (pair_token module) rather than deploying a separate token contract per pair.
  • raumfi-router - the entry point integrators call: add_liquidity, remove_liquidity, and multi-hop swaps. Computes deterministic pair addresses locally via router_pair_for instead of calling back into the factory on every read.
  • rntoken - a standalone SEP-41 token contract, imported by the pair crate's test suite to act as the underlying assets in a pool (not deployed as part of the protocol itself).

The workspace was audited by QuillAudits; the audit report ships in the repository under audit/. The branch documented here, Audit_Inital_A2_Fix, contains the fixes applied after that review.

Repository: Raum-Network/raum-raumfi-core-v1 (branch: Audit_Inital_A2_Fix) - Live app: v1.dex.raum.network

Technical FAQ

What is RaumFi v2?

RaumFi v2 is a Stellar Soroban constant-product automated market maker that follows the same pricing model as Uniswap v2.

What contracts make up RaumFi v2?

RaumFi v2 is made up of Soroban contracts for the factory, pair, router, and test token. Integrators usually call the router for liquidity and swaps, while the factory creates and tracks pair contracts.

What swap fee does RaumFi v2 charge?

RaumFi v2 charges a 0.3% swap fee. The fee is taken from the input token and kept in the pool reserves, so liquidity providers earn it through the pool.

Does RaumFi v2 use concentrated liquidity?

No. RaumFi v2 uses a constant-product AMM model. Concentrated liquidity is part of RaumFi v3.

Who are these docs for?

Use these docs if you are integrating RaumFi v2, reviewing the Soroban contracts, auditing AMM behavior, or comparing RaumFi v2's constant-product model with RaumFi v3's concentrated-liquidity design.