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.
Deploys Ramses V3 pools and manages control over pool protocol fees. Uses the AccessHub pattern for governance instead of simple ownership.
Functions
createPool
function createPool(
address tokenA,
address tokenB,
int24 tickSpacing,
uint160 sqrtPriceX96
) external returns (address pool)
Creates a pool for the given two tokens and tick spacing, optionally initializing it with a price
tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. The fee is automatically derived from the tickSpacingInitialFee mapping. The call will revert if the pool already exists, the token arguments are invalid, or no fee has been enabled for the given tick spacing. If sqrtPriceX96 is non-zero, the pool will be initialized with that price.
Parameters:
| Name | Type | Description |
|---|
tokenA | address | One of the two tokens in the desired pool |
tokenB | address | The other of the two tokens in the desired pool |
tickSpacing | int24 | The desired tick spacing for the pool |
sqrtPriceX96 | uint160 | The initial sqrt price of the pool as a Q64.96 (0 to skip init) |
Return Values:
| Name | Type | Description |
|---|
pool | address | The address of the newly created pool |
enableTickSpacing
function enableTickSpacing(
int24 tickSpacing,
uint24 initialFee
) external
Enables a tick spacing with the given default fee
Maps tick spacing values to their default fee amounts. This is the inverse of Uniswap V3’s enableFeeAmount. Only callable by governance (AccessHub).
Parameters:
| Name | Type | Description |
|---|
tickSpacing | int24 | The spacing between ticks to enable |
initialFee | uint24 | The default fee amount, denominated in hundredths of a bip (i.e. 1e-6) |
setFeeProtocol
function setFeeProtocol(
uint24 _feeProtocol
) external
Sets the default protocol fee for all pools. Only callable by governance (AccessHub).
Parameters:
| Name | Type | Description |
|---|
_feeProtocol | uint24 | The new default protocol fee, denominated in 1e-6 precision |
setPoolFeeProtocol
function setPoolFeeProtocol(
address pool,
uint24 _feeProtocol
) external
Sets the protocol fee for a specific pool. Only callable by governance (AccessHub). Pass type(uint24).max to revert the pool to the global default.
Parameters:
| Name | Type | Description |
|---|
pool | address | The pool address to update |
_feeProtocol | uint24 | The new protocol fee for the pool (1e-6 basis) |
gaugeFeeSplitEnable
function gaugeFeeSplitEnable(
address pool
) external
Enables gauge fee splitting for a pool. When called by the voter contract, sets the pool’s fee protocol to 100% so all fees route through the FeeCollector for distribution to voters. When called by other addresses, simply refreshes the pool’s fee protocol from the factory.
Parameters:
| Name | Type | Description |
|---|
pool | address | The pool to enable gauge fee splitting on |
setFeeCollector
function setFeeCollector(
address _feeCollector
) external
Updates the fee collector address. Only callable by governance (AccessHub).
Parameters:
| Name | Type | Description |
|---|
_feeCollector | address | The new fee collector address |
setVoter
function setVoter(
address _voter
) external
Updates the voter contract address. Only callable by governance (AccessHub).
Parameters:
| Name | Type | Description |
|---|
_voter | address | The new voter address |
setFee
function setFee(
address _pool,
uint24 _fee
) external
Sets the swap fee for a specific pool. Only callable by governance (AccessHub).
Parameters:
| Name | Type | Description |
|---|
_pool | address | The pool to update |
_fee | uint24 | The new swap fee, denominated in hundredths of a bip (i.e. 1e-6) |
State Variables
voter
function voter(
) external returns (address)
Returns the address of the Voter contract used for gauge integration.
feeCollector
function feeCollector(
) external view returns (address)
Returns the address of the FeeCollector contract that routes protocol fees.
feeProtocol
function feeProtocol(
) external view returns (uint24)
Returns the default protocol fee applied to pools that don’t have a pool-specific override.
tickSpacingInitialFee
function tickSpacingInitialFee(
int24 tickSpacing
) external view returns (uint24 initialFee)
Returns the default fee for a given tick spacing. Returns 0 if the tick spacing is not enabled.
poolFeeProtocol
function poolFeeProtocol(
address pool
) external view returns (uint24)
Returns the effective protocol fee for a specific pool. Falls back to the global feeProtocol if no pool-specific override is set.
Events
PoolCreated
event PoolCreated(
address token0,
address token1,
uint24 fee,
int24 tickSpacing,
address pool
)
Emitted when a pool is created
Parameters:
| Name | Type | Description |
|---|
token0 | address | The first token of the pool by address sort order |
token1 | address | The second token of the pool by address sort order |
fee | uint24 | The fee collected upon every swap in the pool, denominated in hundredths of a bip |
tickSpacing | int24 | The minimum number of ticks between initialized ticks |
pool | address | The address of the created pool |
TickSpacingEnabled
event TickSpacingEnabled(
int24 tickSpacing,
uint24 fee
)
Emitted when a new tick spacing is enabled for pool creation via the factory
Parameters:
| Name | Type | Description |
|---|
tickSpacing | int24 | The tick spacing that was enabled |
fee | uint24 | The default fee associated with the tick spacing |
SetFeeProtocol
event SetFeeProtocol(
uint24 feeProtocolOld,
uint24 feeProtocolNew
)
Emitted when the default protocol fee is changed
Parameters:
| Name | Type | Description |
|---|
feeProtocolOld | uint24 | The previous protocol fee |
feeProtocolNew | uint24 | The updated protocol fee |
SetPoolFeeProtocol
event SetPoolFeeProtocol(
address pool,
uint24 feeProtocolOld,
uint24 feeProtocolNew
)
Emitted when a pool-specific protocol fee is changed
Parameters:
| Name | Type | Description |
|---|
pool | address | The pool address |
feeProtocolOld | uint24 | The previous protocol fee |
feeProtocolNew | uint24 | The updated protocol fee |
FeeAdjustment
event FeeAdjustment(
address pool,
uint24 newFee
)
Emitted when a pool’s swap fee is changed
Parameters:
| Name | Type | Description |
|---|
pool | address | The pool address |
newFee | uint24 | The new swap fee |
FeeCollectorChanged
event FeeCollectorChanged(
address indexed oldFeeCollector,
address indexed newFeeCollector
)
Emitted when the fee collector address is changed
Parameters:
| Name | Type | Description |
|---|
oldFeeCollector | address | The previous fee collector |
newFeeCollector | address | The new fee collector |