Quoter vs Quoter2 | Get Swap Quote with Code | Uniswap V3 | EthersJS
YouTube Viewers YouTube Viewers
6.7K subscribers
3,161 views
0

 Published On Mar 24, 2023

Get my free EthersJS cheatsheet to master Web3!
👉 https://blockman-codes.ck.page/91b29a...
------------------------------------------
Courses:
👉 Build a Uniswap V3 interface that can do swaps: https://bit.ly/3JkXYqL
------------------------------------------

Uniswap V3 has 2 different quoter contracts for getting price quotes before making a swap. These are Quoter and Quoter2. But what is the difference? Should you use Uniswap V3's Quoter or Quoter2 contract when getting price quotes? We'll cover that in this tutorial!

------------------------------------------
-----Imports-----
const { abi: QuoterAbi } = require('@uniswap/v3-periphery/artifacts/contracts/lens/Quoter.sol/Quoter.json')
const { abi: Quoter2Abi } = require('@uniswap/v3-periphery/artifacts/contracts/lens/QuoterV2.sol/QuoterV2.json')
const { ethers } = require('ethers')

-----Addresses-----
const WETH_ADDRESS = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'
const USDC_ADDRESS = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
const QUOTER_ADDRESS = '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6'
const QUOTER2_ADDRESS = '0x61fFE014bA17989E743c5F6cB21bF9697530B21e'

-----NPM Packages-----
"@uniswap/sdk": "^3.0.3",
"@uniswap/sdk-core": "^3.2.2",
"@uniswap/v3-core": "^1.0.1",
"@uniswap/v3-periphery": "^1.4.3",
"@uniswap/v3-sdk": "^3.9.0",
"dotenv": "^16.0.3",
"ethers": "^5.7.2"

show more

Share/Embed