Skip to main content
Version: 3.0.0

maxLiquidityForAmounts

@uniswap/v3-sdk / Exports / utils/maxLiquidityForAmounts / maxLiquidityForAmounts

maxLiquidityForAmounts

maxLiquidityForAmounts(sqrtRatioCurrentX96: JSBI, sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh, amount1: BigintIsh, useFullPrecision: boolean): JSBI

Computes the maximum amount of liquidity received for a given amount of token0, token1, and the prices at the tick boundaries.

Parameters#

NameTypeDescription
sqrtRatioCurrentX96JSBIthe current price
sqrtRatioAX96JSBIprice at lower boundary
sqrtRatioBX96JSBIprice at upper boundary
amount0BigintIshtoken0 amount
amount1BigintIshtoken1 amount
useFullPrecisionbooleanif false, liquidity will be maximized according to what the router can calculate, not what core can theoretically support

Returns: JSBI

Defined in: utils/maxLiquidityForAmounts.ts:42