Skip to main content

Function: tickToPrice()

gSwap SDK 2.0.0-rc.4


gSwap SDK 2.0.0-rc.4 / tickToPrice

Function: tickToPrice()

tickToPrice(tick): BigNumber

Defined in: packages/gswap-sdk/dist/index.d.ts:4315

The token1/token0 price at tick: 1.0001 ** tick, exact to 60 significant digits (the lower edge of the tick's price range; tickToSqrtPrice(tick) ** 2). A tick outside the contract's bounds is still computed; ask assertTickRange first when that matters. A non-integer tick is computed as given.

Use .toNumber() for a display value (it differs from Math.exp(tick * Math.log(1.0001)) in the last digits of a double: that expression multiplies in floating point first).

Parameters​

tick​

number

Returns​

BigNumber