Skip to main content
Version: 3.0.0

Position

Represents a position on a Uniswap V3 Pool

Constructors#

constructor#

+ new Position(__namedParameters: PositionConstructorArgs): Position

Constructs a position for a given pool with the given liquidity

Parameters#

NameType
__namedParametersPositionConstructorArgs

Returns: Position

Defined in: entities/position.ts:31

Properties#

liquidity#

Readonly liquidity: default

Defined in: entities/position.ts:26


pool#

Readonly pool: Pool

Defined in: entities/position.ts:23


tickLower#

Readonly tickLower: number

Defined in: entities/position.ts:24


tickUpper#

Readonly tickUpper: number

Defined in: entities/position.ts:25

Accessors#

amount0#

• get amount0(): CurrencyAmount<Token>

Returns the amount of token0 that this position's liquidity could be burned for at the current pool price

Returns: CurrencyAmount<Token>

Defined in: entities/position.ts:68


amount1#

• get amount1(): CurrencyAmount<Token>

Returns the amount of token1 that this position's liquidity could be burned for at the current pool price

Returns: CurrencyAmount<Token>

Defined in: entities/position.ts:100


mintAmounts#

• get mintAmounts(): Readonly<{ amount0: default ; amount1: default }>

Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at the current price for the pool

Returns: Readonly<{ amount0: default ; amount1: default }>

Defined in: entities/position.ts:240


token0PriceLower#

• get token0PriceLower(): Price<Token, Token>

Returns the price of token0 at the lower tick

Returns: Price<Token, Token>

Defined in: entities/position.ts:54


token0PriceUpper#

• get token0PriceUpper(): Price<Token, Token>

Returns the price of token0 at the upper tick

Returns: Price<Token, Token>

Defined in: entities/position.ts:61

Methods#

burnAmountsWithSlippage#

burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: default ; amount1: default }>

Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the position with the given slippage tolerance

Parameters#

NameTypeDescription
slippageTolerancePercenttolerance of unfavorable slippage from the current price

Returns: Readonly<{ amount0: default ; amount1: default }>

Defined in: entities/position.ts:192


mintAmountsWithSlippage#

mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: default ; amount1: default }>

Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position with the given slippage tolerance

Parameters#

NameTypeDescription
slippageTolerancePercenttolerance of unfavorable slippage from the current price

Returns: Readonly<{ amount0: default ; amount1: default }>

Defined in: entities/position.ts:134


fromAmount0#

Static fromAmount0(__namedParameters: { amount0: BigintIsh ; pool: Pool ; tickLower: number ; tickUpper: number ; useFullPrecision: boolean }): Position

Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1

Parameters#

NameTypeDescription
__namedParametersobject-
__namedParameters.amount0BigintIshthe desired amount of token0
__namedParameters.poolPoolthe pool for which the position is created
__namedParameters.tickLowernumberthe lower tick
__namedParameters.tickUppernumberthe upper tick
__namedParameters.useFullPrecisionbooleanif true, liquidity will be maximized according to what the router can calculate, not what core can theoretically support

Returns: Position

Defined in: entities/position.ts:334


fromAmount1#

Static fromAmount1(__namedParameters: { amount1: BigintIsh ; pool: Pool ; tickLower: number ; tickUpper: number }): Position

Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0

Parameters#

NameTypeDescription
__namedParametersobject-
__namedParameters.amount1BigintIshthe desired amount of token1
__namedParameters.poolPoolthe pool for which the position is created
__namedParameters.tickLowernumberthe lower tick
__namedParameters.tickUppernumberthe upper tick

Returns: Position

Defined in: entities/position.ts:357


fromAmounts#

Static fromAmounts(__namedParameters: { amount0: BigintIsh ; amount1: BigintIsh ; pool: Pool ; tickLower: number ; tickUpper: number ; useFullPrecision: boolean }): Position

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

Parameters#

NameTypeDescription
__namedParametersobject-
__namedParameters.amount0BigintIshtoken0 amount
__namedParameters.amount1BigintIshtoken1 amount
__namedParameters.poolPoolthe pool for which the position should be created
__namedParameters.tickLowernumberthe lower tick of the position
__namedParameters.tickUppernumberthe upper tick of the position
__namedParameters.useFullPrecisionbooleanif false, liquidity will be maximized according to what the router can calculate, not what core can theoretically support

Returns: Position

Defined in: entities/position.ts:293