Skip to main content
Helpful?

Overview

Table of contents

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

AddLiquidityOptions

Ƭ AddLiquidityOptions: MintOptions | IncreaseOptions

Defined in

nonfungiblePositionManager.ts:77


FullWithdrawOptions

Ƭ FullWithdrawOptions: ClaimOptions & WithdrawOptions

Defined in

staker.ts:8


IncreaseOptions

Ƭ IncreaseOptions: CommonAddLiquidityOptions & IncreaseSpecificOptions

Defined in

nonfungiblePositionManager.ts:75


MintOptions

Ƭ MintOptions: CommonAddLiquidityOptions & MintSpecificOptions

Defined in

nonfungiblePositionManager.ts:74


PermitOptions

Ƭ PermitOptions: StandardPermitArguments | AllowedPermitArguments

Defined in

selfPermit.ts:22

Variables

ADDRESS_ZERO

Const ADDRESS_ZERO: "0x0000000000000000000000000000000000000000"

Defined in

constants.ts:3


FACTORY_ADDRESS

Const FACTORY_ADDRESS: "0x1F98431c8aD98523631AE4a59f267346ea31F984"

Defined in

constants.ts:1


POOL_INIT_CODE_HASH

Const POOL_INIT_CODE_HASH: "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54"

Defined in

constants.ts:5


TICK_SPACINGS

Const TICK_SPACINGS: { [amount in FeeAmount]: number }

The default factory tick spacings by fee amount.

Defined in

constants.ts:20

Functions

computePoolAddress

computePoolAddress(__namedParameters): string

Computes a pool address

Parameters

NameType
__namedParametersObject
__namedParameters.factoryAddressstring
__namedParameters.feeFeeAmount
__namedParameters.initCodeHashManualOverride?string
__namedParameters.tokenAToken
__namedParameters.tokenBToken

Returns

string

The pool address

Defined in

utils/computePoolAddress.ts:16


encodeRouteToPath

encodeRouteToPath(route, exactOutput): string

Converts a route to a hex encoded path

Parameters

NameTypeDescription
routeRoute<Currency, Currency>the v3 path to convert to an encoded path
exactOutputbooleanwhether the route should be encoded in reverse, for making exact output swaps

Returns

string

Defined in

utils/encodeRouteToPath.ts:11


encodeSqrtRatioX96

encodeSqrtRatioX96(amount1, amount0): JSBI

Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0

Parameters

NameTypeDescription
amount1BigintIshThe numerator amount i.e., the amount of token1
amount0BigintIshThe denominator amount i.e., the amount of token0

Returns

JSBI

The sqrt ratio

Defined in

utils/encodeSqrtRatioX96.ts:11


isSorted

isSorted<T>(list, comparator): boolean

Determines if a tick list is sorted

Type parameters

Name
T

Parameters

NameTypeDescription
listT[]The tick list
comparator(a: T, b: T) => numberThe comparator

Returns

boolean

true if sorted

Defined in

utils/isSorted.ts:7


maxLiquidityForAmounts

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

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

Parameters

NameTypeDescription
sqrtRatioCurrentX96defaultthe current price
sqrtRatioAX96defaultprice at lower boundary
sqrtRatioBX96defaultprice 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:68


mostSignificantBit

mostSignificantBit(x): number

Parameters

NameType
xdefault

Returns

number

Defined in

utils/mostSignificantBit.ts:12


nearestUsableTick

nearestUsableTick(tick, tickSpacing): number

Returns the closest tick that is nearest a given tick and usable for the given tick spacing

Parameters

NameTypeDescription
ticknumberthe target tick
tickSpacingnumberthe spacing of the pool

Returns

number

Defined in

utils/nearestUsableTick.ts:9


priceToClosestTick

priceToClosestTick(price): number

Returns the first tick for which the given price is greater than or equal to the tick price

Parameters

NameTypeDescription
pricePrice<Token, Token>for which to return the closest tick that represents a price less than or equal to the input price, i.e. the price of the returned tick is less than or equal to the input price

Returns

number

Defined in

utils/priceTickConversions.ts:29


subIn256

subIn256(x, y): JSBI

Parameters

NameType
xdefault
ydefault

Returns

JSBI

Defined in

utils/tickLibrary.ts:11


tickToPrice

tickToPrice(baseToken, quoteToken, tick): Price<Token, Token>

Returns a price object corresponding to the input tick and the base/quote token Inputs must be tokens because the address order is used to interpret the price represented by the tick

Parameters

NameTypeDescription
baseTokenTokenthe base token of the price
quoteTokenTokenthe quote token of the price
ticknumberthe tick for which to return the price

Returns

Price<Token, Token>

Defined in

utils/priceTickConversions.ts:14


toHex

toHex(bigintIsh): string

Converts a big int to a hex string

Parameters

NameType
bigintIshBigintIsh

Returns

string

The hex encoded calldata

Defined in

utils/calldata.ts:23


tradeComparator

tradeComparator<TInput, TOutput, TTradeType>(a, b): number

Trades comparator, an extension of the input output comparator that also considers other dimensions of the trade in ranking them

Type parameters

NameTypeDescription
TInputextends CurrencyThe input token, either Ether or an ERC-20
TOutputextends CurrencyThe output token, either Ether or an ERC-20
TTradeTypeextends TradeTypeThe trade type, either exact input or exact output

Parameters

NameTypeDescription
aTrade<TInput, TOutput, TTradeType>The first trade to compare
bTrade<TInput, TOutput, TTradeType>The second trade to compare

Returns

number

A sorted ordering for two neighboring elements in a trade array

Defined in

entities/trade.ts:16

Helpful?