Questions tagged [sqrtpricelimitx96]
The sqrtpricelimitx96 tag has no summary.
6 questions
0 votes
1 answer
61 views
Set up initial sqrtPriceX96 when creating a pool in solidity
Like the title of the post says it, how do I set up the initial sqrtPriceX96 when creating an Uniswap v3 pool, in solidity? Let's call token0 ABC. ABC has 18 decimals. token1 is USDC (so 6 decimals). ...
0 votes
0 answers
73 views
Unusual sqrtPriceX96 to price in JavaScript | Converting sqrtPriceX96 to price in JS
could you help me figure out why the calculation of price using slot0 sqrtPriceX96 from UniswapV3 pool doesn't work for one of the tokens? This code works correctly for several other tokens. Just ...
0 votes
1 answer
244 views
What is the difference (in terms of calculation) between tokens pricing while swapping vs while adding liquidity in Uniswap V3?
In Uniswap V3, getting different prices of 1 WETH to USDC while swapping and adding liquidity, potentially because of fees and other contributing factors. Swap Add Liquidity Programmatically, I'm ...
0 votes
1 answer
70 views
what am I doing wrong in getting price data from the liq pool?
import requests import json url_v3 = "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3" pools_query_v3 = """ { pools(orderBy: txCount, orderDirection: desc) { ...
0 votes
1 answer
715 views
How to Calculate SqrtPriceX96 for a Specific Percentage Change in Uniswap v3?
I am working with Uniswap v3 and need to calculate the sqrtPriceX96 value that is exactly 5% (or any other percentage) above or below the current pool price. I understand that each tick in Uniswap v3 ...
4 votes
1 answer
1k views
What is the difference between sqrtPriceLimitX96 and amountOutMinimum for uniswap?
The sqrtPriceLimitX96 is just a price limit which cannot be exceeded by the trade. At the same time, the amountOutMinimum appears to do the same thing in that you can achieve maximum price by taking: ...