Blockman Codes
Blockman Codes
  • Видео 101
  • Просмотров 388 654
Decode token paths from pending transactions | ExactInput, ExactOutput | Uniswap V3, Ethers.js
Get my free EthersJS cheatsheet to master Web3!
👉 blockman-codes.ck.page/91b29af293
------------------------------------------
Courses:
👉 Learn to do swap and liquidity on Uniswap V3, with code: bit.ly/3JkXYqL
------------------------------------------
Swaps inside Uniswap V3 transactions are often encoded as paths.
These are hexadecimal values representing the tokens, pools and fees that the transaction swaps through.
But these paths are not human readable.
How do we take a path and decode it into something a human can understand.
I'll explain how to decode paths inside exactInput and exactOutput transactions in this tutorial.
------------
Code:
gist.github.com/BlockmanCodes/9d0652ca76674bd43df095b2...
Просмотров: 2 363

Видео

Find and Decode Pending Mempool Swaps on Uniswap v3 | SwapRouter, EthersJS, Pending Transactions
Просмотров 3,4 тыс.10 месяцев назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Learn Uniswap V3 swap and liquidity functionality with code, using examples: bit.ly/3JkXYqL Did you know you can see Ethereum transactions before they are mined? Let's learn to query the mempool to see swaps and transactions before they are added to blocks. We'll also learn to decode these pending tra...
Query, Filter and Decode Ethereum Event Logs (as a DeFi Developer) | EthersJS
Просмотров 1,9 тыс.11 месяцев назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Learn Uniswap V3 swap and liquidity functionality with code, using examples: bit.ly/3JkXYqL Query, filtering, and decoding event logs can be a bit of a mystery. Especially because the data is encoded, and decoding is not always straightforward. This tutorial walks you through the entire process, from ...
Impersonate Any Address When Forking Ethereum Mainnet | Hardhat
Просмотров 1,1 тыс.11 месяцев назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Learn swap and liquidity functionality with code on Uniswap V3 with examples: bit.ly/3JkXYqL Did you know you can make transactions on behalf of any account when you are forking mainnet locally? Hardhat allows us to easily impersonate any address when forking. Forking and impersonating accounts can be...
Swap Tokens with Universal Router (as a DeFi Developer) | Uniswap V3
Просмотров 8 тыс.Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Learn swap and liquidity functionality with code on Uniswap V3 with examples: bit.ly/3JkXYqL Universal Router is the recommended way to swap tokens on Uniswap V2 and V3. But as of today, there is very little documentation on how to use Universal Router. This tutorial will introduce you to Universal Ro...
Listen to Swaps on ALL Uniswap V3 Pools with Code (as a DeFi Developer) | EthersJS
Просмотров 3 тыс.Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 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 ...
Swap on Pancake Swap V3 with Code (as a DeFi Developer) | EthersJS
Просмотров 6 тыс.Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL How do you swap tokens on Pancake Swap V3 with code. It's similar to swapping on Uniswap V3 but a little different. In this video I'll walk you through code which swap WETH to USDC using the Pancake Swap V3 Smart Router contract. Code: gis...
Programmatically Swap ETH for Tokens on KyberSwap with Code | DeFi | EthersJS
Просмотров 1,6 тыс.Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL How do you swap tokens on KyberSwap programmatically? This tutorial will show you how to swap ETH for USDT, with JavaScript, using Kyber's dynamic fee router. Code: gist.github.com/BlockmanCodes/d0057d623269f0d4390b3526469bf381
Get Kyber Classic DMM Pool Addresses (with code) | KyberSwap
Просмотров 339Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL How do you lookup pool addresses on KyberSwap? It's a required step for doing swaps and liquidity transactions programmatically. There can be many pools on Kyber with different configuations, but there is no centralized app for looking up ...
Earn Protocol Fees on Uniswap V3 (with code) | DeFi
Просмотров 2,4 тыс.Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL How do you add a protocol fee on a Uniswap V3 pool? A protocol fee collects a cut of liquidity provider fees to be paid to the protocol. If you deployed the DEX then it can be paid to you. In this video we'll deploy Uniswap V3 contracts an...
Listen for Liquidity Events (Mint, Burn, Collect) on Unsiwap V3 with Code | Ethers.js
Просмотров 1,6 тыс.Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL Listen for liquidity events like mint, burn and collect on Uniswap V3 pools. This will give you live updates when liquidity is added or removed on any V3 pool you are interested in. Code: gist.github.com/BlockmanCodes/1b15ccb1f5e151938d47d...
Locally Deploy Uniswap V3 Contracts, Pools & Liquidity | UPDATED - May 2023 | DeFi
Просмотров 5 тыс.Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL Learn to deploy Uniswap V3 contracts locally. Then create a pool and add liquidity. This can be a powerful tool because it allows you to test Uniswap V3 locally and be in complete control of the environment. It can also save you ether and ...
Listen for Swap Events on Uniswap V3, V2 & SushiSwap with Code | EthersJS | DeFi | Ethereum
Просмотров 4,1 тыс.Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL Description: Listen for swap events on Uniswap V3, V2 and SushiSwap. This will give the swap price and address doing the swap, live as swaps occur on these platforms. We'll write this code using ethersJS 6. Code: gist.github.com/BlockmanCo...
Use Mainnet Fork to Swap Tokens on Uniswap with Code | Ethereum, EthersJS, Hardhat
Просмотров 3,4 тыс.Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL Learn to fork Ethereum mainnet with Hardhat and make swaps on Uniswap on the forked network. Forking mainnet with Hardhat gives us a generated wallet with generated ether that we can use to make transactions on Uniswap. These transactions ...
Code Uniswap V2 & SushiSwap Swaps | EthersJS | DeFi
Просмотров 3,4 тыс.Год назад
Get my free EthersJS cheatsheet to master Web3! 👉 blockman-codes.ck.page/91b29af293 Courses: 👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL How do you swap tokens on Uniswap V2 and SushiSwap with code? In this video, I'll provide you with code to setup Uniswap V2 and SushiSwap pairs (pools) locally. Then we'll perform tokens swaps on those pairs with code. Code: gist.github.co...
Find SushiSwap and Uniswap V2 Pair Addresses with Code | EthersJS
Просмотров 1,8 тыс.Год назад
Find SushiSwap and Uniswap V2 Pair Addresses with Code | EthersJS
Listen for Newly Created Uniswap V3 Pools With Code | EthersJS | DeFi
Просмотров 2,1 тыс.Год назад
Listen for Newly Created Uniswap V3 Pools With Code | EthersJS | DeFi
Big Numbers in Ethers 5 VS 6 Compared | EthersJS | The Biggest Reason to Upgrade to Version 6
Просмотров 1 тыс.Год назад
Big Numbers in Ethers 5 VS 6 Compared | EthersJS | The Biggest Reason to Upgrade to Version 6
Deploy a Uniswap V2 Pair Locally with Code the Easy Way & Add Liquidity | EthersJS | Hardhat
Просмотров 5 тыс.Год назад
Deploy a Uniswap V2 Pair Locally with Code the Easy Way & Add Liquidity | EthersJS | Hardhat
Uniswap and Sushiswap Arbitrage Code | Uniswap V2 | EthersJS | DeFi
Просмотров 8 тыс.Год назад
Uniswap and Sushiswap Arbitrage Code | Uniswap V2 | EthersJS | DeFi
Get Uniswap V2 Spot Token Price with Code | Uniswap V2, SwapRouter & EthersJS
Просмотров 7 тыс.Год назад
Get Uniswap V2 Spot Token Price with Code | Uniswap V2, SwapRouter & EthersJS
EthersJS 5 VS 6 | Providers | What changed?
Просмотров 801Год назад
EthersJS 5 VS 6 | Providers | What changed?
Get a Uniswap Pool Address in 2 Ways | Uniswap V3 Factory Contract | EthersJS
Просмотров 2,8 тыс.Год назад
Get a Uniswap Pool Address in 2 Ways | Uniswap V3 Factory Contract | EthersJS
Quoter vs Quoter2 | Get Swap Quote with Code | Uniswap V3 | EthersJS
Просмотров 3,5 тыс.Год назад
Quoter vs Quoter2 | Get Swap Quote with Code | Uniswap V3 | EthersJS
Calculate Price Impact for Uniswap V3 Swaps with Code | JavaScript, EthersJS & Quoter2
Просмотров 8 тыс.Год назад
Calculate Price Impact for Uniswap V3 Swaps with Code | JavaScript, EthersJS & Quoter2
Pass ETH (not WETH) as Input Token for a Uniswap V3 Swap with Code | Uniswap V3 Swap Router
Просмотров 4,8 тыс.Год назад
Pass ETH (not WETH) as Input Token for a Uniswap V3 Swap with Code | Uniswap V3 Swap Router
Decode Transaction Data from Etherscan To Read Functions & Arguments Called, Programmatically
Просмотров 3,8 тыс.Год назад
Decode Transaction Data from Etherscan To Read Functions & Arguments Called, Programmatically
Code Flash Swaps & Arbitrage on Uniswap V3 Pools | Solidity & JavaScript | Borrow, Arbitrage & Repay
Просмотров 28 тыс.Год назад
Code Flash Swaps & Arbitrage on Uniswap V3 Pools | Solidity & JavaScript | Borrow, Arbitrage & Repay
Send DeFi Transactions from your MetaMask Wallet in JavaScript with EthersJS | DeFi | Code Tutorial
Просмотров 1,5 тыс.Год назад
Send DeFi Transactions from your MetaMask Wallet in JavaScript with EthersJS | DeFi | Code Tutorial
Collect Liquidity Position Fees on Uniswap V3 Programmatically | Hardhat & EthersJS | DeFi
Просмотров 2,6 тыс.Год назад
Collect Liquidity Position Fees on Uniswap V3 Programmatically | Hardhat & EthersJS | DeFi

Комментарии

  • @pollivivian
    @pollivivian 4 дня назад

    finally a decent video explaining inheritance in practice that goes beyond A, B and C

  • @zhengzuo5118
    @zhengzuo5118 8 дней назад

    Multi swap should be done using ExactInput function by passing in the encoded path instead of three ExactInputSingle

  • @FixedITsc
    @FixedITsc 9 дней назад

    Dude, in all honesty, thank you for taking the time to actually explain this properly. It was the first complete video I’ve watched on the subject that I didn’t feel violated by the end of. That was really well done. After all “if you can’t explain it to a 6 year old, you don’t know it yourself” I feel like you achieved that.

  • @joebauers4224
    @joebauers4224 11 дней назад

    Have loads of questions, you just glossed over all of this quickly and we couldn't actually see any of this actually run. Would have been better to set this up on the test nets with fake coin so we can see all the details behind all this. Whatever, there is a etter explanation of this somewhere else I think.

  • @travisgreg
    @travisgreg 13 дней назад

    If anyone facing issue in using callStatic try this const output = await quoter2.quoteExactInputSingle.staticCall(params)

  • @0xsuperman
    @0xsuperman 16 дней назад

    Any idea how I can find the pool address for uniswap's WETH/UNI pool on Sepolia?

  • @NamVo-mf1ns
    @NamVo-mf1ns 16 дней назад

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

  • @ikniz2005
    @ikniz2005 18 дней назад

    hi there. now the tick value is bigger, and the code does not suit that big tick value anymore

  • @NamVo-mf1ns
    @NamVo-mf1ns 18 дней назад

    very helpful

  • @mike.1
    @mike.1 18 дней назад

    At the end of the video. 13.09 + 0.03% = 13.13 (the price from uniswap interface)

  • @amirnaderi-qe4qm
    @amirnaderi-qe4qm 19 дней назад

    Hi I hope you are doing well How can I add swaped value to to my crypto wallet

  • @user-mm6wx2wo4v
    @user-mm6wx2wo4v 22 дня назад

    Hello. How to write code for matic usdt currency arbitrage? Do you have a code example or video? Thank you.

  • @Lerxsty2112
    @Lerxsty2112 23 дня назад

    Did everything you did, can't get it to work. Errors: "Type annotations can only be used in TypeScript files" where the colons are used, "Unexpected keyword or identifier" for token0.

  • @AmbrishSharma-xy7xt
    @AmbrishSharma-xy7xt 23 дня назад

    how to calculate deposit amount when adding liquidity in v3 pool ? suppose we want to invest 10000 usdt in matc/usdt pool. i think it depend on price range and fee tier please explain

  • @whiterabbitdev
    @whiterabbitdev 29 дней назад

    Thats awesome brother, but I just upgraded v5 to V6 Most important question, can we still use the old version of adding and subtracting without having to change to the new way (.add etc) Other question which you have NOT covered Which NO LONGER WORKS!!! 1. const maxWalletInterface = new ethers.utils.Interface(maxWalletABI); ❌ -> const maxWalletInterface = new ethers.Interface(maxWalletABI); ✅ ? 2. new ethers.providers.JsonRpcProvider(publicProviderUrl); ❌ -> new ethers.providers.JsonRpcProvider(publicProviderUrl); ✅ ? I Assume this doesnt work because when i called .getWalletBalance I was hit with this error: "TypeError: wallet.getBalance is not a function" 3. error: TypeError: Do not know how to serialize a BigInt When Saving your Config File: I.E: JSON.stringify Never get a reply because usually the whole crypto space are narcissistic arrogant people (Could be completely different with Blockman Codes) , if your reading this, be aware of upgrading and the problems that are faced.

  • @IsraelLazoPlus
    @IsraelLazoPlus 29 дней назад

    This is exactly what I was looking for. thanks blockman!

  • @IsraelLazoPlus
    @IsraelLazoPlus 29 дней назад

    Thanks for this video. I was looking for this.

  • @wikkidize
    @wikkidize Месяц назад

    can you do it without infura or any provider at all?

  • @hashemnik
    @hashemnik Месяц назад

    Thank you for the usefull video! How can get best route between two tokens?

  • @dshyryayev
    @dshyryayev Месяц назад

    Thanks!

  • @TheOCDAdvantage
    @TheOCDAdvantage Месяц назад

    Hey great video. What all do I need to install in order to do all of this (i.e. JS packages)? Thanks

  • @balazsputz7965
    @balazsputz7965 Месяц назад

    I am trying to make this work on the Sepolina testnet, and I have an issue with the addresses, especially the router. Has anyone solved this?

  • @harshavardhanranger
    @harshavardhanranger Месяц назад

    crazy how, the 3rd scipt as you said "mysteriously reverts without a reason string" when I change the fee to 300 as well. anyone knows the reason ?

  • @lucasonempera
    @lucasonempera Месяц назад

    hello @blockmancodes, its possible to do a multicall to make a swap if a direct pair does not exist? Token A -> Token B then Token B -> Token C, in one multicall?

  • @MattWoodwardAU
    @MattWoodwardAU Месяц назад

    Damn! I was enjoying this, but by about 01:02:31 I'm starting to see a load of build errors. Would be great to see an update to this video! 🙌

  • @MattWoodwardAU
    @MattWoodwardAU Месяц назад

    Thanks for the run-through this was super helpful! 🙏🙏

  • @Toninirulay
    @Toninirulay 2 месяца назад

    Hi there. Could you explain to me how to create the directories for the new blank note? Because I can't find the option in the Remix. Thank you so much.

  • @scotking3436
    @scotking3436 2 месяца назад

    Thanks for this video. I took a course at Udemy on Triangular Arbitrage and I'd like to know how the price impact is affected by 3 swaps. In the course I took, there are opportunities returned after scoping out possibilities at Uniswap (3 different pairs;2 of each token) and some of the profit potentials are in the double digits. Yet when I go and compare the prices returned with the Uniswap tool after less than a minute, the final result usually shows 0% profit and even .99 or less than 1 unit which is what I start with. I would love to know how to compute price impact with the 3 pairs and get results which match the Uniswap tool.

  • @eikyoutube
    @eikyoutube 2 месяца назад

    Is JetBrains IDE really better ?

  • @jboon4175
    @jboon4175 2 месяца назад

    This is great and simplified a lot of overcomplicated bumf from the docs (which are great if you're trying to build a dex but not so great if you're just trying to make a few swaps). What I really want is a simplified version of calculating volume to reach target price for arbitrage. The calcs using SwapMath and the SDK are mental.

  • @Toya-lj3kt
    @Toya-lj3kt 2 месяца назад

    Hello Blockman, I really appreciate you for this and wanted to ask if you can provide which version of hardhat was used and was this in node js with npm or another. basically need help with the proper environment and versions used.

  • @lovelytimothy2569
    @lovelytimothy2569 2 месяца назад

    Thanks for this great work Can I modify the code to swap usdc to wbnb

  • @LORDWASEEMMALIK
    @LORDWASEEMMALIK 2 месяца назад

    Many thanks, what software are you using here?

  • @jboyce007
    @jboyce007 3 месяца назад

    Anyone successfully doing this with flashbots here?

  • @luislozada8106
    @luislozada8106 3 месяца назад

    Thank you man! I have spent many hours with the QuoterV2 thinking you could call it like the V1. Thanks a bunch!!

  • @Remyjames88
    @Remyjames88 3 месяца назад

    Can you use this to be able to cash out on a coin that doesn’t allow you to sell on uniswap?

  • @joekluck5433
    @joekluck5433 3 месяца назад

    Great Video :) I noticed that the quoter contract "quoteExactInputSingle" call didnt have a particular reference to the specific pool we are looking at ? It is taking the two token addresses plus the fee amount(which is specifically from the target pool). How do you get the exchange amount for specific pools if there are several pools with the same pair of tokens? Cheers :)

    • @joekluck5433
      @joekluck5433 3 месяца назад

      Oh, I think I answered my own question: Each token pair has only 1 Pool in Uniswap at each Fee level, so the fee itself would point at the pool being referenced(of THAT pair combination). Correct?

  • @jackbryan9782
    @jackbryan9782 3 месяца назад

    Yo bro, thanks for the video but, the code needs an update.. the event is now 'PairCreated '

  • @paraipan-rq2sj
    @paraipan-rq2sj 3 месяца назад

    i tried it,but i dnt know what im doing wrong. when i start ' node addLiquidity' it returns an error : TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider') at Object.<anonymous> (C:\Users\zisgh\add-liquidity-to-uniswap\addLiquidity.js:16:39) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Module.load (node:internal/modules/cjs/loader:1203:32) at Module._load (node:internal/modules/cjs/loader:1019:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) at node:internal/main/run_main_module:28:49. any help please?

  • @let4be
    @let4be 3 месяца назад

    Wooo, thanks man! It all makes sense

  • @martyhill6609
    @martyhill6609 3 месяца назад

    When using the syntax "const provider = new ethers.providers.JsonRpcProvider(..) it requires ethers:^5.6.5 or lower to work. (to use ethers.providers...) Current Ether.JS release don't use the providers object after the ethers object. The New syntax is "const provider = new ethers.JsonRpcProvider("...")"

  • @YusufSuhair
    @YusufSuhair 3 месяца назад

    Hi, is NFT Descriptors, Managers and those Libraries of NFT are important? I have no idea where are those being used in the uniswap v3, as I only saw Pool and Swap, correct me if I'm wrong, I'm very curious about this :) If only I can skip those NFT contracts and save some gas fees for the deployment ...

  • @outgrown3094
    @outgrown3094 3 месяца назад

    <3 <3 <3

  • @swapnalidive5357
    @swapnalidive5357 3 месяца назад

    Helpful boss. Thank you.

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

    Nice video! Did you forget the code in description?

  • @aemde
    @aemde 3 месяца назад

    9:14 well it fails because of (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);: This line sorts the input tokens in a specific order to maintain consistency in pair creation.

  • @omega3fatass61
    @omega3fatass61 3 месяца назад

    great tutorial to deploy the v3 contracts , but thumbnail is misleading lol

  • @danicodeve
    @danicodeve 3 месяца назад

    Is an await not required when calling the slot0() function at @17:15 ?

  • @derickkuah
    @derickkuah 3 месяца назад

    I m using your UniswapCourse 10 to run the uniswap to sepolia testnet. But the Price Impact percent is different from the uniswap V3 website. May i know is the formula different?