Skip to main content

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:

NameTypeDescription
tickSpacingint24The tick spacing to look up

Return Values:

TypeDescription
uint24The 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:

NameTypeDescription
tokenAaddressThe contract address of either token0 or token1
tokenBaddressThe contract address of the other token
tickSpacingint24The tick spacing of the pool

Return Values:

NameTypeDescription
pooladdressThe 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:

NameTypeDescription
tokenAaddressOne of the two tokens in the desired pool
tokenBaddressThe other of the two tokens in the desired pool
tickSpacingint24The desired tick spacing for the pool
sqrtPriceX96uint160The initial sqrt price of the pool as a Q64.96 (0 to skip init)

Return Values:

NameTypeDescription
pooladdressThe address of the newly created pool

enableTickSpacing

  function enableTickSpacing(
    int24 tickSpacing,
    uint24 initialFee
  ) external
Enables a tick spacing with the given default fee

Parameters:

NameTypeDescription
tickSpacingint24The spacing between ticks to enable
initialFeeuint24The 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:

NameTypeDescription
_feeProtocoluint24The 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:

NameTypeDescription
pooladdressThe pool address to update
_feeProtocoluint24The new protocol fee for the pool (1e-6 basis)

gaugeFeeSplitEnable

  function gaugeFeeSplitEnable(
    address pool
  ) external
Enables gauge fee splitting for a pool

Parameters:

NameTypeDescription
pooladdressThe pool to enable gauge fee splitting on

setFeeCollector

  function setFeeCollector(
    address _feeCollector
  ) external
Updates the fee collector address

Parameters:

NameTypeDescription
_feeCollectoraddressThe new fee collector address

setVoter

  function setVoter(
    address _voter
  ) external
Updates the voter contract address

Parameters:

NameTypeDescription
_voteraddressThe new voter address

setFee

  function setFee(
    address _pool,
    uint24 _fee
  ) external
Sets the swap fee for a specific pool

Parameters:

NameTypeDescription
_pooladdressThe pool to update
_feeuint24The 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:

NameTypeDescription
token0addressThe first token of the pool by address sort order
token1addressThe second token of the pool by address sort order
feeuint24The fee collected upon every swap in the pool, denominated in hundredths of a bip
tickSpacingint24The minimum number of ticks between initialized ticks
pooladdressThe 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:

NameTypeDescription
tickSpacingint24The tick spacing that was enabled
feeuint24The default fee associated with the tick spacing

SetFeeProtocol

  event SetFeeProtocol(
    uint24 feeProtocolOld,
    uint24 feeProtocolNew
  )
Emitted when the default protocol fee is changed

Parameters:

NameTypeDescription
feeProtocolOlduint24The previous protocol fee
feeProtocolNewuint24The updated protocol fee

SetPoolFeeProtocol

  event SetPoolFeeProtocol(
    address pool,
    uint24 feeProtocolOld,
    uint24 feeProtocolNew
  )
Emitted when a pool-specific protocol fee is changed

Parameters:

NameTypeDescription
pooladdressThe pool address
feeProtocolOlduint24The previous protocol fee
feeProtocolNewuint24The 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