Skip to main content

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 its tickLower 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: Why tick spacing matters:
  • 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:
  1. Contract switches to new tick interval
  2. Activates/deactivates liquidity at that tick
  3. Gas cost increases for the transaction that crosses the tick
  4. 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:
Formula:

Technical Implementation

Ramses extends Uniswap V3’s tick accounting with additional period tracking: Standard Uniswap V3 (Tick.sol):
Ramses V3 Addition (Tick.sol + Position.sol):

Period Transitions

Every Thursday 00:00 UTC, a new period begins:
  1. Snapshot current state: Record secondsPerLiquidity for all active ticks
  2. Initialize new period: Reset period counters
  3. Calculate rewards: Previous period’s periodSecondsInside determines reward share
  4. 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:
This prevents:
  • 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:
Why: Position A provides liquidity where it’s most needed (near current price)

In-Range Requirement

Only active liquidity earns rewards:
  • Price in range: Accruing periodSecondsInside
  • Price out of range: periodSecondsInside frozen ✗
Strategy: LPs must actively manage positions to keep them in-range

Integration Considerations

For Integrators

  1. Query position status:
  1. Calculate periodSecondsInside (complex, see Position.sol):
  1. 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
Optimization: Batch operations when possible (multi-position management, claim + collect combos)

Additional Resources