v12PredictPot(owner, salt?, kitchen?) derives a Pot’s address without reading a chain, potSalt and DEFAULT_POT_SALT give its salt, and kitchenExecutionFee() builds the read of the Kitchen’s fee per cook. sqrtPriceX96FromPrice and priceFromSqrtPriceX96 convert between a price and a pool’s sqrtPriceX96.
@eco-incorp/sauce.
MAX_SQRT_PRICE_X96
Variable · @eco-incorp/sauce
MIN_SQRT_PRICE_X96
Variable · @eco-incorp/sauce
The bounds a V3 or V4 pool’s price is held within: TickMath.MIN_SQRT_RATIO and MAX_SQRT_RATIO.
priceFromSqrtPriceX96
Function · @eco-incorp/sauce
The price a pool at sqrtPriceX96 trades at, in quote tokens per one base token as a decimal
string: the inverse of sqrtPriceX96FromPrice. Rounded to fractionDigits decimal places
(default 18), half up, without trailing zeros.
sqrtPriceX96FromPrice
Function · @eco-incorp/sauce
The sqrtPriceX96 of a pool trading at price units of the quote token per one base token, in
whole tokens: 2,700 USDC per WETH is sqrtPriceX96FromPrice("2700", { baseDecimals: 18, quoteDecimals: 6, baseIsToken0 }). Rounded down. Throws a RangeError for a price a pool cannot
hold, outside [MIN_SQRT_PRICE_X96, MAX_SQRT_PRICE_X96).
As a swap’s price limit it bounds both directions: selling token0 moves the pool’s price down, so
the limit is a floor; selling token1 moves it up, so the limit is a ceiling.
PoolPriceTokens
Interface · @eco-incorp/sauce
The two tokens a price is quoted in, and which of them is the pool’s token0.
