Listen to Swaps on ALL Uniswap V3 Pools with Code (as a DeFi Developer) | EthersJS

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024
  • Get my free EthersJS cheatsheet to master Web3!
    👉 blockman-codes...
    ------------------------------------------
    Courses:
    👉 Learn all swap and liquidity functionality with code on Uniswap V3 with examples: bit.ly/3JkXYqL
    ------------------------------------------
    Have you ever wanted to listen to swaps on all Uniswap V3 pools?
    In this video we'll programmatically find the addresses of all pools on Uniswap V3, and then listen for swap on each of them.
    We'll do this with ethersJS.
    ------------
    Code: gist.github.co...

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

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

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

  • @ivoleitao2883
    @ivoleitao2883 11 месяцев назад

    Great work and great tutorial! Thank you so much. Would you please give a hint on how you could increase the number of pools? I had a go with passing an incrementing variable on the query but did not work. I'm completely stuck! 😅

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

    you have no idea the amount of rich knowledge you give for free
    plz keep up the good work

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

      My pleasure!

    • @davidxiao-ml2fr
      @davidxiao-ml2fr 6 месяцев назад

      @@blockmancodes yeah, your video is great, but seem no update for some time now, will update?

  • @sumanyasahoo9533
    @sumanyasahoo9533 11 месяцев назад +1

    In which part did you talk about the alchemy as a provider? @blockmancodes

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

      I was already starting to think that I'm stupid and couldn't figure out where to talk about this.

  • @NamVo-mf1ns
    @NamVo-mf1ns 3 месяца назад

    Hey, I wonder is there any hard limit of Ethereum on the number of contract events that we listent on?

  • @jerrywang3225
    @jerrywang3225 Год назад +2

    Thanks. First time to use graph api and look forward to more tutorials on that.

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

    What if I want to get pools from BSC or other chains? Are those all of the pools on ETH chain?

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

    Thanks a lot!! And how will be to listen for new pools created for the first time?

  • @jessejacob8256
    @jessejacob8256 7 месяцев назад

    can the graph api be used on other chains like base?

  • @rs.ravi_sharma
    @rs.ravi_sharma Год назад

    Thanks, this content is very helpful And how can I listen swap events for more than 6000 pools.

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

    How do we, Can we do a Emergency Withdraw on Uniswap V3 interacting with their contract on Etherscan?
    I know it’s possible on Pancake writing to their masterchef contract

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

      You could continually check the price and make the withdrawal from external code. But I don't think it's built into v3

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

    awesome!! but does The Graph always stay up to date?

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

      I've seen cases where it's not. If you need up-to-the-second data, query the pool directly

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

      @blockmancodes

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

    How can I fetch token details like price, market cap, liquidity from v3 SDK?

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

      For price, use quoter
      For market cap, do totalSupply * price
      For liquidity, it's more difficult, check liquidity per tick on the pool contract

  • @BransTiong
    @BransTiong 10 месяцев назад

    Can you make a tutorial on how we can make a Dex aggregator ?

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

    We want to swap video PancakeSwap or create nodes for the same router without using SmartRouterV3

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

      I think I have a pancake swap video already.
      What do you mean "create nodes for the same router without using SmartRouterV3"? Can you give an example?

  • @СТАКАН-о5х
    @СТАКАН-о5х Год назад +1

    how to get more than 6000 pools?

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

    Can you have a look in to pulsechain!
    It's a much faster Etherium fork with way cheaper fees ..!
    Plsx swap is a fork of uniswap V3

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

    Please, sir, my teacher, to do additional videos on Pancakeswap, how to control the slip in the barefoot, how did the prices take from Oracle, and how the gas was set. Please, you are the only light that changed my life

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

      Yes. I'll eventually do more pancake swap tutorials

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

      ​@@blockmancodesWaiting for me to be patient
      I love you, I love you, my teacher

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

      ​@@blockmancodesWaiting

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

    Dear Sir, can you please make a tuto about uniswapv3 ticks and concentrated liquidity ?. Many thanks.

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

    is this useful for PancakeSwap V3 ?

  • @pan-galactic-gargleblaster
    @pan-galactic-gargleblaster Год назад +1

    We learned that graph is too slow for MEV (Guessing that's the reason you're here). Ditch caching and db's entirely. Hold pools in ram where it takes a fraction of one ms to read. Even Redis will be 10x slower reads than just instantiating 10,000 pools as consts.

    • @pan-galactic-gargleblaster
      @pan-galactic-gargleblaster Год назад +1

      also, you can use keccak hashed event topics to listen for swaps in the mempool. Any tx's that happen on the router, simulate, look for the hashed event topic "sync()" in it's logs, and then if it exists, decode the sync() logs and you have the reserves to update the individual pool you instantiated previously. Since you're doing this inside the mempool, you end up with the future state of the pool before it gets mined. lots of fun activities with that knowledge

  • @androidtechsayed201
    @androidtechsayed201 9 месяцев назад

    Plz make a video how to fork uniswap fully

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

    Very helpful video as usual. Thank you so much.

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

    Please explain more lessons on
    pancakeswap v3 oracle

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

    Thanks for everything!

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

    I love you, I love you, I love you, I love

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

    I also cannot read the prices of the currency contracts on the BSCSCAN network
    There is no SQRTPRICEX96

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

    NIce video, can you do one on using graph traversal to find optimal arbitrage swap routes?

    • @pan-galactic-gargleblaster
      @pan-galactic-gargleblaster Год назад +4

      Most of us don't even use algo's for routes, there's certainly no need to. It's much easier to take the assumption that for any given token, the numeraire of the pair (base token) will be one of only 6 tokens [WETH, WBTC, USDC, DAI, USDT, stETH].
      So lets say I want to swap from PEPE to AAVE. There isn't going to be a PEPE-AAVE pool, however, with absolute certainty, there will be a PEPE-WETH and an AAVE-WETH, making the path [PEPE, WETH, AAVE]. 99% of the time that will be the most liquid path, and therefore have the least price impact, and thus the least slippage, and therefore the "optimal" path. If you want to be 100% sure, you can check for each of the 6 base numeraires and return the one with the last slippage as your "optimal" path.
      What you might actually be asking, is "What is the optimal path, when taking into account multiple markets?" The answer to that my friend, is to do the above^ but for each market, each side of the trade, and each numereraire token. Then organize the results in an array, and filter them from least to most slippage. Take the chunk of the path that returns more than the original swap and you have a multi market optimal route for arbitrage. If it doesnt return more than the original swap, then there is no arb

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

      Smart

    • @AnhTuan-uu7vh
      @AnhTuan-uu7vh Год назад

      @@pan-galactic-gargleblaster how to have a frameset just add the element you want to swap or replace the pair so they can work. i don't know the code i only hunt 1-2$ i really want a framework because bots are very fast

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

    LEGEND BLOCKMAN

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

    Do you have a tg account I'd like to connect with you

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

      I don't. But I have email in my about page

  • @hamadalmarzooqi-r4n
    @hamadalmarzooqi-r4n Год назад

    My friend, I want to communicate with you so that you can help me with something I want to program, for example, put the currency address and put the percentage in the profit and the percentage in the loss. If I arrive, he sells. Can you do this programming for me in return for money

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

    Thank you, for helpful video

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

    Make one on deploy Pancakeswap V3 locally.

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

    I hope I give me your account on Telegram

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

      I don't use telegram. Too distracting to have conversations in multiple places. But thank you for following on YT!

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

      thank you so much

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

      ​@@blockmancodesthank you so much