Skip to main content
Helpful?

Position

@uniswap/v3-sdk / Exports / Position

Class: Position

Represents a position on a Uniswap V3 Pool

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Position(__namedParameters)

Constructs a position for a given pool with the given liquidity

Parameters

NameType
__namedParametersPositionConstructorArgs

Defined in

entities/position.ts:40

Properties

_mintAmounts

Private _mintAmounts: null | Readonly<{ amount0: default ; amount1: default }> = null

Defined in

entities/position.ts:31


_token0Amount

Private _token0Amount: null | CurrencyAmount<Token> = null

Defined in

entities/position.ts:29


_token1Amount

Private _token1Amount: null | CurrencyAmount<Token> = null

Defined in

entities/position.ts:30


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:258


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): 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 }>

The amounts, with slippage

Defined in

entities/position.ts:213


mintAmountsWithSlippage

mintAmountsWithSlippage(slippageTolerance): 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 }>

The amounts, with slippage

Defined in

entities/position.ts:157


ratiosAfterSlippage

Private ratiosAfterSlippage(slippageTolerance): Object

Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage

Parameters

NameTypeDescription
slippageTolerancePercentThe amount by which the price can 'slip' before the transaction will revert

Returns

Object

The sqrt ratios after slippage

NameType
sqrtRatioX96Lowerdefault
sqrtRatioX96Upperdefault

Defined in

entities/position.ts:134


fromAmount0

Static fromAmount0(__namedParameters): Position

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

Parameters

NameType
__namedParametersObject
__namedParameters.amount0BigintIsh
__namedParameters.poolPool
__namedParameters.tickLowernumber
__namedParameters.tickUppernumber
__namedParameters.useFullPrecisionboolean

Returns

Position

The position

Defined in

entities/position.ts:354


fromAmount1

Static fromAmount1(__namedParameters): Position

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

Parameters

NameType
__namedParametersObject
__namedParameters.amount1BigintIsh
__namedParameters.poolPool
__namedParameters.tickLowernumber
__namedParameters.tickUppernumber

Returns

Position

The position

Defined in

entities/position.ts:378


fromAmounts

Static fromAmounts(__namedParameters): Position

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

Parameters

NameType
__namedParametersObject
__namedParameters.amount0BigintIsh
__namedParameters.amount1BigintIsh
__namedParameters.poolPool
__namedParameters.tickLowernumber
__namedParameters.tickUppernumber
__namedParameters.useFullPrecisionboolean

Returns

Position

The amount of liquidity for the position

Defined in

entities/position.ts:312

Helpful?