Skip to content

Calculating amounts for adding liquidity #7

Answered by atiselsts
ibrahimkecici asked this question in Q&A
Discussion options

You must be logged in to vote

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:

L_y = y / (sp - sa) = x * sp * sb / (sb - sp) = L_x

Expressing y from the above:

y = x * sp * sb *  (sp - sa) / (sb - sp)

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…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@ibrahimkecici
Comment options

@atiselsts
Comment options

Answer selected by ibrahimkecici
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #6 on December 20, 2022 07:26.