A comprehensive web application to query liquidity pool information from multiple DEX protocols across EVM-compatible networks (Ethereum, BSC, Base).
Query real-time liquidity pool data from Uniswap V2/V3/V4 and PancakeSwap V3/V4 with a beautiful web interface and RESTful API.
- π Query pool information by Pool ID or Address
- π Multi-network support (Base, BSC, Ethereum)
- π Auto-detect network functionality
- π± Support for 5+ DEX protocols:
- Uniswap V4 - Latest hooks-based protocol
- Uniswap V3 - Concentrated liquidity
- PancakeSwap V4 CL - Concentrated liquidity with hooks
- PancakeSwap V4 Bin - Bin-based liquidity
- PancakeSwap V3 - Concentrated liquidity
- π Real-time pool state (liquidity, price, tick/bin)
- π¨ Beautiful web interface
- Node.js >= 16.0.0
- npm >= 8.0.0
# Clone the repository
git clone [email protected]:wmh/evm-dex-pool-query.git
cd evm-dex-pool-query
# Install dependencies
npm install
# Start the server
npm startThe server will start on http://localhost:3333
# Auto-restart on file changes
npm run devnpm testGET /api/supported
GET /api/pool/:dex/:poolId
Example:
GET /api/pool/uniswapv4/0xa1e7d3925f6603ec872cadbb151ddd0cbe6749ee5a7ac62de8ae346ac4179efd
GET /api/pool/:dex/:network/:poolId
Example:
GET /api/pool/uniswapv4/BASE/0xa1e7d3925f6603ec872cadbb151ddd0cbe6749ee5a7ac62de8ae346ac4179efd
Parameters:
dex:uniswapv4orpancakev4network:BASE,BSC,ETH, orMONADpoolId: Pool ID (32 bytes hex string)
Get transaction details on a specific network:
GET /api/transaction/:network/:txHash
Query transaction across all networks:
GET /api/transaction/:txHash
Example:
GET /api/transaction/MONAD/0x1234567890abcdef...
Note: Transaction hashes and pool IDs are both 32-byte hex values. The API automatically detects if you're trying to use a transaction hash as a pool ID and provides helpful error messages.
{
"network": "Base",
"dex": "Uniswap V4",
"poolId": "0x...",
"token0": {
"address": "0x...",
"symbol": "USDC",
"name": "USD Coin",
"decimals": 6
},
"token1": {
"address": "0x...",
"symbol": "WETH",
"name": "Wrapped Ether",
"decimals": 18
},
"fee": 3000,
"feePercent": 0.3,
"tickSpacing": 60,
"hooks": "0x...",
"state": {
"sqrtPriceX96": "...",
"tick": 12345,
"liquidity": "...",
"lpFee": 3000,
"protocolFee": 0,
"price": 0.000123,
"priceFormatted": "1.234567e-4"
},
"contracts": {
"poolManager": "0x...",
"quoterV2": "0x...",
"stateView": "0x..."
},
"explorer": "https://basescan.org/address/0x..."
}- β Uniswap V4
- β Uniswap V3
- β PancakeSwap V4 CL
- β PancakeSwap V4 Bin
- β Uniswap V4
- β Uniswap V3
- β PancakeSwap V3
- β PancakeSwap V4 CL
- β PancakeSwap V4 Bin
- β Uniswap V4
- β Uniswap V3
- β Uniswap V4
- β Uniswap V3
- β Uniswap V2
- β PancakeSwap V3
- β PancakeSwap V2
- V2 (BSC):
0x4351190e37788312036f29fb49d2bb985b0bb126 - V3 (ETH):
0x5ecebf93f9235347c4f44d4be56c46eef67b8279 - V4 (BSC):
0x73b41de853cdbaaa9b536f6b0d6b787d753c17af7bf34a13f59b0396fe874d82
- V4 CL (BSC):
0x48130f6eedfe2a3bad65fd0fd2987c2ca5317da9f054a9bcbfbd51cf26a140f8 - V4 Bin (BSC):
0xb7dcd468ba90891583f5485e209d4334c79e2c017c836aa46209565b406fcde
evm-dex-pool-query/
βββ config/
β βββ networks.js # Network configurations
β βββ abis.js # Smart contract ABIs
βββ services/
β βββ uniswapV4Service.js # Uniswap V4 logic
β βββ pancakeV4Service.js # PancakeSwap V4 logic
β βββ transactionService.js # Transaction lookup
βββ routes/
β βββ poolRoutes.js # API routes
βββ public/
β βββ index.html # Web interface
βββ server.js # Express server
βββ package.json
- Backend: Node.js, Express.js
- Blockchain: ethers.js v6
- Frontend: Vanilla JavaScript, HTML5, CSS3
The API returns appropriate HTTP status codes:
200: Success400: Bad request (invalid DEX or network)404: Pool not found500: Server error
- Support for more DEX protocols (Uniswap V2, V3, SushiSwap, etc.)
- Historical pool data
- Price charts
- Position tracking
- Swap simulations
- WebSocket support for real-time updates
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please open an issue on GitHub.