npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

uniswap-v2-loader

v6.0.1

Published

Uniswap v2 protocol loader

Readme

  uniswap-v2-loader  Coverage

Fast DeFi AMM pools loader. Optimized for Multi-core CPUs with smart disk-cache. This package is a loader that allows you to download protocol addresses yourself. If you want to instantly get all addresses (pools and their tokens), use the packages from the next section. Those packages check for updates every hour and republish the package with updated data.

Uniswap V2 based protocols

Install

  • CLI
    • npm i -g uniswap-v2-loader
  • Node.js API
    • npm i --save uniswap-v2-loader

CLI

uniswap-v2-loader --from=1 --to=3

Output:

2,0x12ede161c702d1494612d19f05992f43aa6a26fb,0x06af07097c9eeb7fd685c692751d5c66db49c215,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
3,0xa478c2975ab1ea89e8196811f51a7b7ade33eb11,0x6b175474e89094c44da98b954eedeac495271d0f,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

API

Methods:

  • load(config)
    • return Promise(<Pair>[])
  • subscribe(callback, config)
    • Continuous synchronization engine. Performs initial load and subsequently polls for new pairs.
    • return unsubscribe function

where config is common Object with set of parameters to loader.

config is an Object (key/value)

  • from
    • Start index (inclusive).
    • Type: number
    • Default: 0
  • to
    • End index (inclusive).
    • Type: number
    • Default: undefined
  • filename
    • CSV cache path.
    • Type: string
    • Default: OS cache folder
  • factory
    • Smart contract factory address.
    • Type: string
    • Default: 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
  • key
    • Alchemy API Key
    • Type: string
    • Default: FZBvlPrOxtgaKBBkry3SH0W1IqH4Y5tu
  • multicall_size
    • RPC batch size per multicall request.
    • Type:number
    • Default: 50
  • workers
    • Number of parallel worker threads.
    • Type: number
    • Default: CPU - 1
  • progress
    • Each loaded pair execute this callback: (id, total, pair) => {}.
    • Callback arguments:
      • id fabric index of pair contract (int)
      • total total amount of pairs at fabric at current moment
      • pair instance of Pair({id: number, pair: string, token0: string, token1: string})
    • Type: function
    • Default: undefined
  • abort_signal
    • Signal to cancel loading and release workers.
    • Type: AbortSignal
    • Default: undefined
  • update_timeout
    • Polling interval in milliseconds. Used only in subscribe
    • Type: number
    • Default: 5000

Schema Pair

Standardized liquidity pool object.

| Property | Type | Description | | :--- | :--- | :--- | | id | number | Numeric index of the pair in the factory | | pair | string | DEX pair address | | token0 | string | Token address | | token1 | string | Token address |

Example <Pair>[]

[
  {
    "id": 0,
    "pair": "0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc",
    "token0": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "token1": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
  }
]

Smart Cross-Platform Caching

The loader automatically identifies the optimal persistent storage path for your operating system to ensure zero-configuration caching:

  • Linux: $XDG_CACHE_HOME or ~/.cache/
  • macOS: ~/Library/Caches/
  • Windows: %LOCALAPPDATA% or AppData/Local/

Cache files are named following the pattern ${package_name}_{factory_address}.csv.

API Usage

const { load } = require('uniswap-v2-loader')

console.time('SushiSwap')

load({ 
  factory: '0xc0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac',
  to: 100,
  progress: (i, total, pair) =>
    console.log(pair.token0, pair.token1)
})
.then(pairs => {
  console.timeEnd('SushiSwap')
  console.log(pairs.length, 'pairs')
})