Documentation Index
Fetch the complete documentation index at: https://tech.ramses.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Fee Architecture
Ramses V3 uses tick spacing to determine pool characteristics and allows governance-controlled fee adjustment per pool, diverging from Uniswap V3’s fixed fee tiers.While Uniswap V3 uses predefined static fee tiers that are immutable after pool creation, Ramses V3 decouples tick spacing from fees. Each tick spacing has a default initial fee, but governance can adjust the swap fee of any pool at any time via
factory.setFee(pool, newFee).Fee Model
How Fees Are Set
Fees in Ramses V3 are not determined by an on-chain algorithm during swaps. Instead:- Each tick spacing has a default initial fee set in the factory’s
tickSpacingInitialFeemapping - When a pool is created, it inherits the initial fee for its tick spacing
- Governance can adjust any pool’s fee at any time via
RamsesV3Factory.setFee(pool, fee) - The pool stores its current fee and applies it to all swaps
Default Tick Spacing / Fee Mapping
| Tick Spacing | Default Fee | Min Price Movement | Typical Use Case | Example Pairs |
|---|---|---|---|---|
| 1 | 0.01% (100) | 0.01% | Ultra-stable | Stablecoin pairs (USDC/USDT) |
| 5 | 0.025% (250) | 0.05% | Highly correlated | Pegged assets |
| 10 | 0.05% (500) | 0.10% | Correlated assets | ETH/wstETH, BTC/WBTC |
| 50 | 0.30% (3000) | 0.50% | Standard volatility | Most token pairs |
| 100 | 1.00% (10000) | 1.00% | Higher volatility | Less liquid pairs |
| 200 | 2.00% (20000) | 2.00% | High volatility | Exotic/new tokens |
100 = 0.01%, 3000 = 0.30%.
Swap Fee Distribution
LP Fee Collection
Swap fees are distributed pro-rata to all in-range liquidity at the time of the swap:- In-Range Positions: Positions where
tickLower ≤ currentTick < tickUpperearn fees - Out-of-Range Positions: Positions outside the active price earn 0 fees
- Fee Accrual: Fees accumulate continuously as long as a position remains in-range
- Manual Collection: LPs must call
collect()to claim accumulated fees (not auto-compounded)
Protocol Fee Split (feeProtocol)
ThefeeProtocol setting determines what percentage of swap fees are routed to the protocol (FeeCollector) vs staying with LPs. It is also denominated in parts per million (1/1,000,000).
The fee split differs dramatically based on whether a pool has a gauge:
Gauged Pools (100% to voters)
When a gauge is attached to a pool via the Voter contract,gaugeFeeSplitEnable sets the pool’s feeProtocol to 1,000,000 (100%). This means all swap fees are routed to the FeeCollector, which distributes them to the pool’s FeeDistributor for xRAM voters to claim. LPs on gauged pools earn emissions from the gauge instead of swap fees.
Non-Gauged Pools (95% to LPs, 5% to treasury)
Pools without a gauge use the factory’s defaultfeeProtocol of 50,000 (5%). This means:
- 95% of swap fees go to LPs (collected via
pool.collect()) - 5% goes to the FeeCollector, which sends it to the treasury (since there’s no gauge/FeeDistributor)
Fee Flow
Protocol Fee Distribution
Contract:FeeCollector.sol
When collectProtocolFees(pool) is called, the FeeCollector:
- Calls
pool.collectProtocol()to pull the protocol’s share of fees - If the pool has no gauge (or gauge is not alive): sends everything directly to the treasury
- If the pool has a live gauge: splits fees between the FeeDistributor (for voters) and the treasury based on the
treasuryFeesratio
| Scenario | FeeDistributor (Voters) | Treasury |
|---|---|---|
| Gauged pool | 100% - treasuryFees | treasuryFees share |
| Non-gauged pool | N/A (no FeeDistributor) | 100% of protocol portion |
FeeCollector Interface
Distribution Cycle
- Accumulation: Fees accumulate in pools continuously
- Collection: Anyone can call
collectProtocolFees(pool)to trigger collection and distribution (permissionless) - Voter Claims: On gauged pools, xRAM holders claim from FeeDistributor proportional to their voting weight
- LP Claims: On non-gauged pools, LPs collect their 95% share anytime via
collect()
Integrator Considerations
Querying Current Fees
Always query the current fee before estimating swap outputs:Slippage Protection
Since fees can be changed by governance, set appropriate slippage tolerance:Events
Additional Resources
- Concentrated Liquidity
- Token Contracts & Tokenomics
- RamsesV3Pool Reference
- RamsesV3Factory Reference
