Uniswap V3 SDK
Initialize provider.
Get latest block number from ethereum mainnet:
token0 case
Here we are trying to understand what is the behaviour of the pool if token is on token0 and WETH on token1.
We learn from USDC/WETH pool:
Then get the token price:
token1 case
Here we are trying to understand what is the behaviour of the pool if token is on token1 and WETH on token0.
We learn from WETH/USDT pool:
Then get the token price: