Get Uniswap V2 Spot Token Price with Code | Uniswap V2, SwapRouter & EthersJS

Поделиться
HTML-код
  • Опубликовано: 7 сен 2024
  • Get my free EthersJS cheatsheet to master Web3!
    👉 blockman-codes...
    ------------------------------------------
    Courses:
    👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL
    ------------------------------------------
    How do you get the swap price for a token pair on Uniswap V2 with code?
    We can do it with a few lines of code using Uniswap V2's SwapRouter contract and EthersJS.
    We'll cover it in this tutorial.

Комментарии • 16

  • @blockmancodes
    @blockmancodes  Год назад +1

    Learn to use all of Uniswap's swap and liquidity functionality with code. bit.ly/3JkXYqL

  • @oulaalshiekh3474
    @oulaalshiekh3474 5 месяцев назад +1

    where can we access this code ?, no github link

  • @nithin3476
    @nithin3476 8 месяцев назад

    when u click a link how that opens in new tab any extension you are using??

  • @harsh_pathak27
    @harsh_pathak27 7 месяцев назад +1

    do i get it the real-time price?

  • @sherazahmed5848
    @sherazahmed5848 Год назад

    it is giving wrong output values for larger amount of input token

  • @wanhonglau779
    @wanhonglau779 Год назад

    great work! I found that its pretty slow to query token price via API with smart token price. Is there a way to speed up?
    and does your queried token price match with what is shown in UI?

    • @blockmancodes
      @blockmancodes  Год назад

      The UI price incorporates split routes and multi-hops, so unlikely to get exactly that value when checking the price on a single pool.
      Slow requests when querying a contract likely due to the node provider. Infura is usually good though. Unless you're talking about querying the subgraph

  • @basitkhan3853
    @basitkhan3853 Год назад

    Great work 👍 can you make video on how we can interact with deployed smart contract through forking

  • @bilalhassan6363
    @bilalhassan6363 Год назад

    Make a video on getting tax of a token by simulating using hardfork like hardhat or ganache in uniswap v2.

    • @blockmancodes
      @blockmancodes  Год назад

      Can you give me a specific example you'd like me to cover?

  • @user-dj7en8fl5v
    @user-dj7en8fl5v Год назад

    Hello, make please similar tutorial about pancakeSwap V3 🙏

  • @cutedevilstudio7023
    @cutedevilstudio7023 Год назад

    Hello, i want to enroll on your course on teachable. But i dont have credit card. Can u activate paypal payment?
    Also how to contact you sir, discord invitation on ur channel expired

    • @blockmancodes
      @blockmancodes  Год назад +1

      I've now activated paypal. Let me know if it still doesn't work

    • @cutedevilstudio7023
      @cutedevilstudio7023 Год назад +1

      @@blockmancodes i just enrolled sir. So far its a good course. Can't wait until it fully completed.
      Btw will u add features like yield farming. I mean like cake token on pancakeswap