IDiamondSwapV3PoolImmutables
DiamondSwap V3 Pool Immutables Interface (IDiamondSwapV3PoolImmutables)
The DiamondSwap V3 Pool Immutables Interface (IDiamondSwapV3PoolImmutables) defines the immutable variables that are set at the time of the pool's deployment and remain unchanged throughout the lifetime of the pool. These variables define key properties of the pool, such as the token pair, fee tier, and tick spacing. Below is a detailed breakdown of the functions associated with the DiamondSwap V3 Pool Immutables Interface.
Functions
factory() → address
factory() → address
This function returns the address of the factory contract that deployed the pool. The factory contract is responsible for managing and organizing all pools within the DiamondSwap protocol.
- Returns: The address of the DiamondSwap V3 Factory contract.
The factory address is important as it links the pool to the broader DiamondSwap ecosystem and provides the context for governance and management.
token0() → address
token0() → address
This function returns the address of the first token in the pair. In the DiamondSwap protocol, token0
is always the token with the lower address when compared lexicographically (i.e., sorted alphabetically by address).
- Returns: The address of token0.
Understanding the token ordering is crucial when interacting with the pool, as it ensures consistent behavior across different pools and interactions.
token1() → address
token1() → address
This function returns the address of the second token in the pair. In the DiamondSwap protocol, token1
is always the token with the higher address when compared lexicographically.
- Returns: The address of token1.
Like token0
, the token1
address helps define the pool's token pair, which is central to all liquidity, swaps, and pricing functions within the pool.
fee() → uint24
fee() → uint24
This function returns the fee tier associated with the pool. The fee tier represents the percentage fee charged on each swap and is expressed in hundredths of a basis point (e.g., 500 for a 0.05% fee, 3000 for a 0.3% fee).
- Returns: The fee tier of the pool as a
uint24
.
The fee tier is a critical aspect of the pool, determining the cost of swaps and the potential earnings for liquidity providers.
tickSpacing() → int24
tickSpacing() → int24
This function returns the tick spacing of the pool. Tick spacing represents the minimum price difference between ticks in the pool, and it defines the granularity of the liquidity positions that can be created.
- Returns: The tick spacing of the pool as an
int24
.
Tick spacing affects how liquidity can be concentrated within certain price ranges, allowing liquidity providers to tailor their positions more precisely.
maxLiquidityPerTick() → uint128
maxLiquidityPerTick() → uint128
This function returns the maximum amount of liquidity that can be provided per tick. This value acts as a safeguard to prevent excessive concentration of liquidity in a single tick, which could potentially disrupt the pool's pricing mechanisms.
- Returns: The maximum liquidity per tick as a
uint128
.
This value ensures that liquidity is distributed across a range of prices, promoting a healthy and balanced pool environment.
Conclusion
The DiamondSwap V3 Pool Immutables Interface (IDiamondSwapV3PoolImmutables) defines the fixed properties of a pool that are established at deployment and remain constant throughout the pool's lifetime. Understanding these immutable variables is essential for anyone interacting with the pool, as they define the core characteristics that govern how the pool operates. Whether you're a developer building on top of DiamondSwap, a trader executing swaps, or a liquidity provider managing positions, these immutables provide the foundation for all interactions within the pool.
Updated 3 months ago