What is sqrtPriceX96 in Uniswap V3 Pools | Napkin Math to get Price from sqrtRatioX96 / sqrtPriceX96

  Рет қаралды 6,122

Blockman Codes

Blockman Codes

Күн бұрын

Пікірлер: 27
@blockmancodes
@blockmancodes Жыл бұрын
Learn to use all of Uniswap's swap and liquidity functionality with code. bit.ly/3JkXYqL
@kangChihLun
@kangChihLun 2 жыл бұрын
Thank you for the tutorial , that is more clear than official doc!
@blockmancodes
@blockmancodes 2 жыл бұрын
Glad it's helpful!
@azhar0406
@azhar0406 Жыл бұрын
One of the best Uniswap V3 tutorial video I have ever seen. Giga Chad Bro
@blockmancodes
@blockmancodes Жыл бұрын
Thanks brother
@st4rgard3n42
@st4rgard3n42 2 жыл бұрын
You are a gentleman and a scholar ser. Thank you
@blockmancodes
@blockmancodes Жыл бұрын
Thank you ser
@blockmancodes
@blockmancodes 2 жыл бұрын
What Uniswap V3 math do you want to understand next?
@veliea5160
@veliea5160 2 жыл бұрын
can you please explain the reason why Uniswap v3 keeps track of square root of price. In V3 core pdf in (6.7 equation) it derives an equation from (6.6. eq) which holds square root of price but I could not understand how it derived. i tried to work on derivate to get a meaningful reason but could not figure out
@mahdikarimi8444
@mahdikarimi8444 2 жыл бұрын
can you talk about concentrated liquidity and tick spacing ?
@blockmancodes
@blockmancodes 2 жыл бұрын
@@veliea5160 I'll do a video on "why" uniswap uses square roots. Because Uniswap's explaination here, docs.uniswap.org/sdk/v3/guides/fetching-prices isn't very specific lol. I think your other question is about the calculation of liquidity right? It's a little complicated in V3. I'll do a video on that eventually
@blockmancodes
@blockmancodes 2 жыл бұрын
@@mahdikarimi8444 I can absolutely do a video on it
@metamodern7648
@metamodern7648 11 ай бұрын
Hello, can you please tell why would one choose to calculate price/ratio using this Math rather than calling Quoter contract? Is it faster/cheaper to do this way? Thank in advance
@not-high-on-life
@not-high-on-life 9 ай бұрын
Wooo, thanks man! It all makes sense
@followclout
@followclout Жыл бұрын
I'm confused. Why do the officials docs say to divide by 2^96 but you say to divide by 2^192?
@androidtechsayed201
@androidtechsayed201 2 жыл бұрын
Best devs ever🥰
@sEYbaStIeNS
@sEYbaStIeNS 2 жыл бұрын
It doesn't work for me. For example with the pool USDC / ETH 0.3% fees: 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 sqrtPriceX96 is 1.97*10^33. And using that formula we get 6,19*10^8. Did I do something wrong ? Maybe we should somewhere include the decimals in the calculation since they are not the same for both tokens as in your example ? Thanks
@followclout
@followclout Жыл бұрын
Yeah I think it has to do with different decimals. That's the one thing I'm also trying to figure out
@followclout
@followclout Жыл бұрын
I got it, You have to divide your final answer by 10^-12 (which is the difference between the decimals for usdc 10^6 and ETH 10^18)
@aemde
@aemde 10 ай бұрын
perfect
@hodlertiny3352
@hodlertiny3352 2 жыл бұрын
Thanks for sharing. My questions is, sqrtPriceX96 doesn't consider slippage? In AMM v2, price are based on input amount which will impact pool reserve and it is easy to understand. But in v3, sqrtPriceX96 doesn't consider input amount?
@blockmancodes
@blockmancodes 2 жыл бұрын
sqrtPriceX96 is literally the price ratio between the 2 tokens. If you want to accurately estimate slippage in V3 you need to take into account the liquidity at every tick
@st4rgard3n42
@st4rgard3n42 2 жыл бұрын
@@blockmancodes That's most definitely what I am trying to figure out right now. That's what brought me here - so I am going to go ahead and start pouring over your existing vids - thanks again
@hodlertiny3352
@hodlertiny3352 2 жыл бұрын
@@blockmancodes Sir, is it possible to calculate Uniswap V3 output off-chain? In Uniswap V2, with Reserve A, Reserve B, fee rate R, and input amount C, the output can be easily calculated off-chain. Wondering if it is possible in V3? Thanks ahead.
@nanowormer4278
@nanowormer4278 Жыл бұрын
I really helped, thanks!
@blockmancodes
@blockmancodes Жыл бұрын
Glad it helped!!
@outgrown3094
@outgrown3094 9 ай бұрын
Transformers (how LLMs work) explained visually | DL5
27:14
3Blue1Brown
Рет қаралды 4,7 МЛН
What is a Cryptographic Hashing Function? (Example + Purpose)
7:08
Whiteboard Crypto
Рет қаралды 107 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
Does WordPress need a Radical Rethink in 2025?
6:39
Jamie WP
Рет қаралды 1,6 М.
5 Hidden Windows Features You Should Be Using in 2025!
8:05
Kevin Stratvert
Рет қаралды 133 М.
Get Price from Tick for Uniswap V3 Pool | JavaScript Coding Tutorial
15:59
How to Remember Everything You Read
26:12
Justin Sung
Рет қаралды 3,8 МЛН
Think Fast, Talk Smart: Communication Techniques
58:20
Stanford Graduate School of Business
Рет қаралды 44 МЛН
[Webinar] How to Build a Modern Agentic System
1:00:55
Arthur
Рет қаралды 14 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
Turn 2 Eggs Into Fluffy Japanese Soufflé Pancakes!
5:26
CookingAtHome
Рет қаралды 3,1 МЛН
Attention in transformers, step-by-step | DL6
26:10
3Blue1Brown
Рет қаралды 2,1 МЛН