Calculating amounts for adding liquidity #7
-
Hello. I need your help for this. I have 100 ETH and 10000 USDC. I want to add liquidity for ETH/USDC at range 1000-1600. Some ETH should be swapped to USDC. How can I calculate required ETH and USDC amounts for adding liquidity and required swap amount for ETH to USDC? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Let me answer a simpler question: what should the proportion of ETH and USDC be in the position? To compute the proportion you can rely on the fact that liquidity in both sides of the position should be equal:
Expressing
Assuming x = 1, you can compute As a side note, I can't believe that there still isn't a calculator for this online, after 1.5 years since v3 was released! If you know this proportion, that is, how much USDC (Y) you need for one ETH (X), then knowing the current price P you can compute the value V of one unit (this is not checked, hope there are no mistakes):
Sell |
Beta Was this translation helpful? Give feedback.
Let me answer a simpler question: what should the proportion of ETH and USDC be in the position?
To compute the proportion you can rely on the fact that liquidity in both sides of the position should be equal:
L_x = L_y
Following the naming conventions from the Python code, the relevant liquidity math formulas are:
Expressing
y
from the above:Assuming x = 1, you can compute
y_unit
, that is, how much USDC is needed per one ETH.As a side note, I can't believe that there still isn't a calculator for this online, after 1.5 years since v3 was released!
If you know this proportion, that is, how much…