SqrtPriceMath
Library to calculate sqrtPriceX96 from token amounts
Functions
getSqrtPriceX96
Calculates the sqrtPriceX96 from the token amounts
The order of the tokens is irrelevant, as the values will be re-ordered.
function getSqrtPriceX96(
address tokenA,
address tokenB,
uint256 amountA,
uint256 amountB
) internal pure returns (uint160 sqrtPriceX96);
Parameters
Name | Type | Description |
---|---|---|
tokenA | address | The address of a token |
tokenB | address | The address of the other token |
amountA | uint256 | The amount of tokenA |
amountB | uint256 | The amount of tokenB |
Returns
Name | Type | Description |
---|---|---|
sqrtPriceX96 | uint160 | The sqrtPriceX96 |