0.0.8 • Published 5 months ago

@evmexplorer/uniswap v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

EVMExplorer-Uniswap

EVM Explorer TypeScript Uniswap v3 SDK.

📦 Install

npm install @evmexplorer/uniswap

or

yarn add @evmexplorer/uniswap

🚀 Features

  • Fetch USD price quotes for various tokens on Uniswap V3.
  • Easily integrated with Ethers.js for Ethereum network interactions.
  • Simple TypeScript API with clear typings for improved developer experience.

Example usage

To get a quote of AAVE token price in USD from Uniswap V3:

import { getQuoteUniswapUSD } from '@evmexplorer/uniswap';
import { AlchemyProvider } from 'ethers';
import dotenv from 'dotenv';

dotenv.config();

const api = process.env.API;
const provider = new AlchemyProvider('mainnet', api);

const tokenData = {
  address: '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9',
  decimals: 18,
  chainId: 1,
};

const exchangeRateWETH = '3920.84';

const result = await getQuoteUniswapUSD(tokenData, provider, exchangeRateWETH);

🌿 Notes

  • Ensure you have an Alchemy API key, which can be obtained by signing up on the Alchemy website.
  • Update the exchangeRateWETH variable with the current price for accurate results. This can be sourced dynamically from price feeds or exchanges.

More information

EVM Explorer - Tracking Smart Contract Transaction Data

Understanding Slot0 Data

0.0.8

5 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.7

5 months ago

0.0.6

11 months ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago