Skip to content

Instantly share code, notes, and snippets.

@KvizadSaderah
KvizadSaderah / getPrice.js
Created July 2, 2024 18:25 — forked from BlockmanCodes/getPrice.js
Uni V3: getPriceFromTick
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,
@KvizadSaderah
KvizadSaderah / .env
Created July 2, 2024 18:25 — forked from BlockmanCodes/.env
Uniswap V3 / EthersJS: decode mempool swap router swaps
WEBSOCKET_URL=wss://mainnet.infura.io/ws/v3/abc
@KvizadSaderah
KvizadSaderah / listen.js
Created July 2, 2024 18:24 — forked from BlockmanCodes/listen.js
Uniswap V3: listen all pools
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"},