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.
The Ramses V3 Factory facilitates creation of Ramses V3 pools and control over the protocol fees. It uses the AccessHub pattern for governance instead of simple ownership.
Functions
tickSpacingInitialFee
function tickSpacingInitialFee(
int24 tickSpacing
) external view returns (uint24)
Returns the default fee for a given tick spacing, if enabled, or 0 if not enabled
Parameters:
| Name | Type | Description |
|---|
tickSpacing | int24 | The tick spacing to look up |
Return Values:
| Type | Description |
|---|
| uint24 | The initial fee for the tick spacing (0 if not enabled) |
getPool
function getPool(
address tokenA,
address tokenB,
int24 tickSpacing
) external view returns (address pool)
Returns the pool address for a given pair of tokens and tick spacing, or address 0 if it does not exist
tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
Parameters:
| Name | Type | Description |
|---|
tokenA | address | The contract address of either token0 or token1 |
tokenB | address | The contract address of the other token |
tickSpacing | int24 | The tick spacing of the pool |
Return Values:
| Name | Type | Description |
|---|
pool | address | The pool address |
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 tickSpacingInitialFee. The call will revert if the pool already exists or the token arguments are invalid. If sqrtPriceX96 is non-zero, the pool is 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
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
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
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
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
Parameters:
| Name | Type | Description |
|---|
_feeCollector | address | The new fee collector address |
setVoter
function setVoter(
address _voter
) external
Updates the voter contract address
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
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) |
voter
function voter(
) external returns (address)
Returns the address of the Voter contract
feeCollector
function feeCollector(
) external view returns (address)
Returns the address of the FeeCollector contract
feeProtocol
function feeProtocol(
) external view returns (uint24)
Returns the default protocol fee
poolFeeProtocol
function poolFeeProtocol(
address pool
) external view returns (uint24)
Returns the effective protocol fee for a specific pool
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
FeeCollectorChanged
event FeeCollectorChanged(
address indexed oldFeeCollector,
address indexed newFeeCollector
)
Emitted when the fee collector address is changed