Skip to main content
Version: V3

LiquidityMath

Functions#

addDelta#

  function addDelta(    uint128 x,    int128 y  ) internal pure returns (uint128 z)

Add a signed liquidity delta to liquidity and revert if it overflows or underflows

Parameters:#

NameTypeDescription
xuint128The liquidity before change
yint128The delta by which liquidity should be changed

Return Values:#

NameTypeDescription
zuint128The liquidity delta