@uniswap/v3-sdk / Exports / Position
Represents a position on a Uniswap V3 Pool
- burnAmountsWithSlippage
- mintAmountsWithSlippage
- ratiosAfterSlippage
- fromAmount0
- fromAmount1
- fromAmounts
• new Position(__namedParameters)
Constructs a position for a given pool with the given liquidity
| Name | Type |
|---|---|
__namedParameters |
PositionConstructorArgs |
• Private _mintAmounts: null | Readonly<{ amount0: default ; amount1: default }> = null
• Private _token0Amount: null | CurrencyAmount<Token> = null
• Private _token1Amount: null | CurrencyAmount<Token> = null
• Readonly liquidity: default
• Readonly pool: Pool
• Readonly tickLower: number
• Readonly tickUpper: number
• get amount0(): CurrencyAmount<Token>
Returns the amount of token0 that this position's liquidity could be burned for at the current pool price
CurrencyAmount<Token>
• get amount1(): CurrencyAmount<Token>
Returns the amount of token1 that this position's liquidity could be burned for at the current pool price
CurrencyAmount<Token>
• 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
Readonly<{ amount0: default ; amount1: default }>
• get token0PriceLower(): Price<Token, Token>
Returns the price of token0 at the lower tick
Price<Token, Token>
• get token0PriceUpper(): Price<Token, Token>
Returns the price of token0 at the upper tick
Price<Token, Token>
â–¸ 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
| Name | Type | Description |
|---|---|---|
slippageTolerance |
Percent |
tolerance of unfavorable slippage from the current price |
Readonly<{ amount0: default ; amount1: default }>
The amounts, with slippage
â–¸ 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
| Name | Type | Description |
|---|---|---|
slippageTolerance |
Percent |
Tolerance of unfavorable slippage from the current price |
Readonly<{ amount0: default ; amount1: default }>
The amounts, with slippage
â–¸ Private ratiosAfterSlippage(slippageTolerance): Object
Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage
| Name | Type | Description |
|---|---|---|
slippageTolerance |
Percent |
The amount by which the price can 'slip' before the transaction will revert |
Object
The sqrt ratios after slippage
| Name | Type |
|---|---|
sqrtRatioX96Lower |
default |
sqrtRatioX96Upper |
default |
â–¸ 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
| Name | Type |
|---|---|
__namedParameters |
Object |
__namedParameters.amount0 |
BigintIsh |
__namedParameters.pool |
Pool |
__namedParameters.tickLower |
number |
__namedParameters.tickUpper |
number |
__namedParameters.useFullPrecision |
boolean |
The position
â–¸ 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
| Name | Type |
|---|---|
__namedParameters |
Object |
__namedParameters.amount1 |
BigintIsh |
__namedParameters.pool |
Pool |
__namedParameters.tickLower |
number |
__namedParameters.tickUpper |
number |
The position
â–¸ 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.
| Name | Type |
|---|---|
__namedParameters |
Object |
__namedParameters.amount0 |
BigintIsh |
__namedParameters.amount1 |
BigintIsh |
__namedParameters.pool |
Pool |
__namedParameters.tickLower |
number |
__namedParameters.tickUpper |
number |
__namedParameters.useFullPrecision |
boolean |
The amount of liquidity for the position