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

dex-pool-scanner

v1.0.1

Published

Multi-protocol DEX liquidity pool scanner and price tracker for EVM networks.

Downloads

210

Readme

DEX Pool Scanner

npm version npm downloads License: MIT TypeScript

Multi-protocol DEX liquidity pool scanner and real-time price tracker for EVM networks. Discovers pools from multiple DEX protocols using The Graph and monitors price changes via WebSocket.

Supported Protocols

  • UniswapV3 - Full support for pool discovery and real-time price tracking

Installation

npm install dex-pool-scanner

Or using yarn:

yarn add dex-pool-scanner

Or using pnpm:

pnpm add dex-pool-scanner

Quick Start

  1. Create protocols.json configuration file:
{
  "protocols": {
    "uniswap-v3": {
      "name": "Uniswap V3",
      "factory": "0x33128a8fC17869897dcE68Ed026d694621f6FDfD",
      "subgraphId": "43Hwfi3dJSoGpyas9VwNoDAv55yjgGrPpNSmbQZArzMG",
      "enabled": true,
      "poolType": "UniswapV3"
    }
  },
  "discovery": {
    "minLiquidityUSD": 10000,
    "cacheRefreshMinutes": 60,
    "maxPoolsPerProtocol": 100
  }
}
  1. Set environment variables:
# .env
THE_GRAPH_API_KEY=your_api_key
RPC_URL=wss://your-rpc-url
ENABLE_LOG=true  # Optional: enable logging
  1. Run Scanner:
# run file: examples/basic-discovery.ts
npm run example 

Build on top:

import { Scanner, CachedPool, PoolPrice } from 'dex-pool-scanner';

const onPriceChange = (pool: CachedPool, newPrice: PoolPrice, oldPrice: PoolPrice | null) => {
  // Handle price updates
  console.log(`Price update for ${pool.token0Symbol}/${pool.token1Symbol}:`, newPrice);
};

async function main() {
  const scanner = new Scanner(onPriceChange);

  /** 
   * Check configuration options
   */
  await scanner.start({ 
    tokens: {
      WETH: '0x4200000000000000000000000000000000000006',
      USDC: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
    },
    protocols: {
      'uniswap-v3': {
        name: 'Uniswap V3',
        factory: '0x33128a8fC17869897dcE68Ed026d694621f6FDfD',
        subgraphId: '43Hwfi3dJSoGpyas9VwNoDAv55yjgGrPpNSmbQZArzMG',
        enabled: true,
        poolType: 'UniswapV3'
      }
    },
    discovery: {
      minLiquidityUSD: 10000,
      cacheRefreshMinutes: 60,
      maxPoolsPerProtocol: 100
    }
  });

  // Keep running
  setTimeout(() => {
    console.log('\nStopping scanner...');
    scanner.stop();
    process.exit(0);
  }, 60000);
}

main().catch(console.error);

Configuration

protocols.json

Required configuration file for protocol settings:

  • protocols: Object mapping protocol IDs to their configuration
    • name: Display name
    • factory: Factory contract address
    • subgraphId: The Graph subgraph ID
    • enabled: Enable/disable protocol
    • poolType: Liquidity pool type (e.g., "UniswapV3")
  • discovery: Discovery settings
    • minLiquidityUSD: Minimum liquidity threshold
    • cacheRefreshMinutes: Cache refresh interval
    • maxPoolsPerProtocol: Max pools per protocol

tokens.json (Optional)

Token whitelist for filtering pools:

{
  "tokens": {
    "WETH": "0x4200000000000000000000000000000000000006",
    "USDC": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
  }
}

If not provided, all pools will be shown.

API

Scanner

const scanner = new Scanner(
  onPriceChange: (pool: CachedPool, newPrice: PoolPrice, oldPrice: PoolPrice | null) => void,
  configPath?: string  // Default: './protocols.json' (used if protocols/discovery not provided in start())
);

await scanner.start({
  clearCache?: boolean,  // Clear pool cache before starting
  tokens?: Record<string, string>,  // Token whitelist (overrides tokens.json)
  protocols?: Record<string, ProtocolConfig>,  // Protocol config (overrides configPath, must provide with discovery)
  discovery?: DiscoveryConfig  // Discovery settings (required if protocols provided)
});

scanner.stop();  // Stop monitoring

Environment Variables

  • THE_GRAPH_API_KEY: The Graph API key (required)
  • RPC_URL: WebSocket RPC URL (required)
  • ENABLE_LOG: Set to "true" to enable logging (optional)

Documentation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © Maximiliano Malvido