Price to tick calculation #58
Answered
by
Jeiwan
adradr
asked this question in
Milestone 1. First Swap
-
I am probably missing some point here, but after reading your article, still don't understand. I copied a random position from the USDC/ETH 0.3% Ethereum mainnet pool. By simply running your Thanks, EDIT: 0.05% -> 0.3% |
Beta Was this translation helpful? Give feedback.
Answered by
Jeiwan
Feb 26, 2023
Replies: 1 comment
-
GitHub wiped out my answer... Well, in short, you need to flip the price so it's the price of USDC in WETH (the price in a pool is the price of token 0 in terms of token 1): math.floor(math.log(int(1e18 // 1900.79e6), 1.0001))
# 200820 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
adradr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GitHub wiped out my answer... Well, in short, you need to flip the price so it's the price of USDC in WETH (the price in a pool is the price of token 0 in terms of token 1):