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.

Positions represent an owner address’ liquidity between a lower and upper tick boundary Positions store additional state for tracking fees owed to the position

Functions

get

  function get(
    mapping(bytes32 => PositionInfo) storage self,
    address owner,
    uint256 index,
    int24 tickLower,
    int24 tickUpper
  ) internal view returns (PositionInfo storage position)
Returns the Info struct of a position, given an owner and position boundaries

Parameters:

NameTypeDescription
selfmapping(bytes32 => PositionInfo) storageThe mapping containing all user positions
owneraddressThe address of the position owner
indexuint256The index of the position
tickLowerint24The lower tick boundary of the position
tickUpperint24The upper tick boundary of the position

Return Values:

NameTypeDescription
positionPositionInfo storageThe position info struct of the given owners’ position

update

  function update(
    PositionInfo storage self,
    int128 liquidityDelta,
    uint256 feeGrowthInside0X128,
    uint256 feeGrowthInside1X128,
    bytes32 _positionHash,
    uint256 period,
    uint160 secondsPerLiquidityPeriodX128
  ) internal
Credits accumulated fees to a user’s position and updates period-based reward accounting

Parameters:

NameTypeDescription
selfPositionInfo storageThe individual position to update
liquidityDeltaint128The change in pool liquidity as a result of the position update
feeGrowthInside0X128uint256The all-time fee growth in token0, per unit of liquidity, inside the position’s tick boundaries
feeGrowthInside1X128uint256The all-time fee growth in token1, per unit of liquidity, inside the position’s tick boundaries
_positionHashbytes32The hash of the position key (owner, index, tickLower, tickUpper)
perioduint256The current period (weekly epoch)
secondsPerLiquidityPeriodX128uint160The seconds per liquidity for the current period inside the position’s tick boundaries

positionHash

  function positionHash(
    address owner,
    uint256 index,
    int24 tickLower,
    int24 tickUpper
  ) internal pure returns (bytes32)
Returns the hash used to store positions in a mapping: keccak256(abi.encodePacked(owner, index, tickLower, tickUpper))

Parameters:

NameTypeDescription
owneraddressThe address of the position owner
indexuint256The index of the position
tickLowerint24The lower tick boundary of the position
tickUpperint24The upper tick boundary of the position