This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const JSBI = require('jsbi') | |
const { TickMath, FullMath } = require('@uniswap/v3-sdk') | |
const baseToken = '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599' // WETH | |
const quoteToken = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' // WBTC | |
async function main( | |
baseToken, | |
quoteToken, | |
inputAmount, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WEBSOCKET_URL=wss://mainnet.infura.io/ws/v3/abc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require('ethers') | |
const poolAbi = [ | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{"indexed": true, "internalType": "address", "name": "sender", "type": "address"}, | |
{"indexed": true, "internalType": "address", "name": "recipient", "type": "address"}, | |
{"indexed": false, "internalType": "int256", "name": "amount0", "type": "int256"}, | |
{"indexed": false, "internalType": "int256", "name": "amount1", "type": "int256"}, |