Uniswap V3 - How to Calculate Price of ETH from sqrtPriceX96? | DeFi

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024

ความคิดเห็น • 15

  • @smartcontractprogrammer
    @smartcontractprogrammer  2 ปีที่แล้ว

    0:00 - Intro
    1:09 - What is P?
    1:39 - Example price of USDC in terms of ETH
    4:21 - Example price of ETH in terms of USDC
    6:28 - Price of ETH from sqrtPriceX96
    7:40 - Example price of ETH from sqrtPriceX96
    Uniswap USDC / ETH pool
    etherscan.io/address/0x8ad599c3A0ff1De082011EFDDc58f1908eb6e6D8#readContract
    Notes
    github.com/stakewithus/notes
    Take a course
    www.smartcontract.engineer/

  • @adimishra6950
    @adimishra6950 ปีที่แล้ว +1

    thank you so much!! it took me almost whole day to resolve

  • @duytruongnguyen8096
    @duytruongnguyen8096 ปีที่แล้ว

    Very helpful, thank you!

  • @KW-vv1dt
    @KW-vv1dt ปีที่แล้ว

    yo, your videos are amazing and easy to understand! thanks for sharing!
    would like to know what's the note taking tool you are using?

  • @chacal31
    @chacal31 2 ปีที่แล้ว

    Great content ! How do you manage to write so fast the math? Is this some symbol that you already draw and you reuse, or there is a library?

  • @viktorcortez5706
    @viktorcortez5706 2 ปีที่แล้ว

    Hi bro, thanks for your video. If it's possible can you make a video about flashloan with balancer? They have just a smart contract code with 2 functions without explanations. It looks similar to AAVE (I used code for AAVE flashloan from your video too)

  • @navibongo9354
    @navibongo9354 ปีที่แล้ว

    This returns the RATIO of eth in terms of usdc or x in terms of y (y/x). So confusing when you say Price, because i assume you mean the amountOut. -.-

  • @Tijdperkzuid
    @Tijdperkzuid ปีที่แล้ว

    I think I watched the video 4 times now and still not able to get the actual price. I am working with javascript. would be awesome to see some coding examples, even solidity would work for me.

    • @Tijdperkzuid
      @Tijdperkzuid ปีที่แล้ว

      I got the formula working, I know now 1 ETH = X USDC, but I can not figure out how to get the price in 1 USDC = X ETH

    • @smartcontractprogrammer
      @smartcontractprogrammer  ปีที่แล้ว

      flip the price

    • @kangChihLun
      @kangChihLun ปีที่แล้ว +1

      @@Tijdperkzuid use one divide by 1 eth price

    • @Tijdperkzuid
      @Tijdperkzuid ปีที่แล้ว

      @@kangChihLun thanks for the reply, I already got it.

  • @nickeast4853
    @nickeast4853 3 หลายเดือนก่อน

    simple maths complicated lol