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.
Ramses implements concentrated liquidity based on Uniswap V3’s core math, but extends it with:
- Period-based accounting system for weekly reward distribution
- Governance-adjustable fees decoupled from tick spacing
- Gauge-integrated emission tracking at the protocol core
- Competitive farming where in-range, active liquidity earns more
Concentrated Liquidity Overview
Ramses V3 uses concentrated liquidity (as introduced in Uniswap V3), where LPs allocate capital within custom price ranges rather than across the full curve. A position is in-range when the current tick falls between itstickLower and tickUpper — only in-range positions earn swap fees and gauge rewards.
Ticks and Price Discretization
Tick Basics
Ticks partition continuous price space into discrete boundaries:- Each tick represents a 0.01% price change
- Formula:
price = 1.0001^tick - Example: tick 0 = price 1.0, tick 100 = price 1.01005
Tick Spacing
Tick spacing determines minimum distance between usable ticks:| Tick Spacing | Min Price Movement | Use Case |
|---|---|---|
| 1 | 0.01% | Ultra-stable pairs (USDC/USDT) |
| 10 | 0.10% | Correlated assets (ETH/stETH) |
| 60 | 0.60% | Standard pairs (ETH/USDC) |
| 200 | 2.00% | High-volatility pairs |
- Tighter spacing = more granular positioning
- Wider spacing = fewer active ticks, lower gas costs
- Matched to expected volatility and pool characteristics
Tick Crossing
When the price crosses a tick boundary:- Contract switches to new tick interval
- Activates/deactivates liquidity at that tick
- Gas cost increases for the transaction that crosses the tick
- Updates tick state for fee accrual and period tracking
Period-Based Accounting System
This is the most significant difference from Uniswap V3. Ramses implements weekly period-based accounting to enable fair gauge reward distribution based on time-weighted active liquidity.
The Problem with Snapshot-Based Rewards
Traditional liquidity mining uses snapshots:- “You have X liquidity at snapshot time = Y% of rewards”
- Incentivizes gaming: Add liquidity before snapshot, remove after
- Ignores actual contribution over time
The Ramses Solution: periodSecondsInside
Ramses tracks how long each position was in-range during each weekly period:Technical Implementation
Ramses extends Uniswap V3’s tick accounting with additional period tracking: Standard Uniswap V3 (Tick.sol):Period Transitions
Every Thursday 00:00 UTC, a new period begins:- Snapshot current state: Record
secondsPerLiquidityfor all active ticks - Initialize new period: Reset period counters
- Calculate rewards: Previous period’s
periodSecondsInsidedetermines reward share - Distribute emissions: Gauges distribute to positions based on their period contribution
Debt Accounting
To prevent reward gaming, Ramses tracks debt for positions that modify liquidity mid-period:- Adding liquidity just before epoch flip for free rewards
- Counting partial-period liquidity as if it existed the entire week
Competitive Farming Model
Ramses incentivizes capital efficiency through competitive rewards:Proximity Bonus
Positions closer to current price earn more per unit liquidity:In-Range Requirement
Only active liquidity earns rewards:- Price in range: Accruing
periodSecondsInside✓ - Price out of range:
periodSecondsInsidefrozen ✗
Integration Considerations
For Integrators
- Query position status:
- Calculate periodSecondsInside (complex, see Position.sol):
- Monitor tick crossings via events:
Gas Considerations
Period-based accounting adds minor gas overhead:- Tick crossing: +~5,000 gas for period updates
- Position operations: +~10,000 gas for debt accounting
- Reward claims: Similar to standard V3
Additional Resources
- Fees
- Token Contracts & Tokenomics
- Uniswap V3 Whitepaper - Core math and design
- ConsenSys Diligence Audit - Period accounting analysis
