Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

FIXME from the code #344

Locked
rfreis started this conversation in General
Aug 16, 2023 · 13 comments
Discussion options

Hi. Congratulations for your job done!

Just looking at the repository and as I'm working and understanding the same issue of this line comment

# FIXME: How to calculate this properly? See https://docs.uniswap.org/reference/libraries/SqrtPriceMath

  • I decided to share what I was able to find
q96 = 2**96
def price_to_sqrtp(p):
    """
    Code from https://uniswapv3book.com/docs/milestone_1/calculating-liquidity/
    """
    return int(math.sqrt(p) * q96)
You must be logged in to vote

Replies: 13 comments

Comment options

You must be logged in to vote
0 replies

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment options

Why do the bots keep spamming this thread?!

You must be logged in to vote
0 replies

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Morty Proxy This is a proxified and sanitized view of the page, visit original site.