Find Pools

Returns all pools that contain a specific token pair. This endpoint is useful for discovering available liquidity sources, comparing rates across different DEXs, and analyzing market depth for specific token pairs.

When to Use This Endpoint

Liquidity Analysis:

  • Research available liquidity for a token pair before trading

  • Compare fees and rates across different protocols

  • Identify the most liquid pools for large trades

Trading Strategy Development:

  • Build tools that analyze arbitrage opportunities

  • Create dashboards showing liquidity distribution

  • Develop algorithms that monitor pool performance over time

Market Research:

  • Study how liquidity is distributed across the ecosystem

  • Track new pools as they're created

  • Monitor changes in pool composition and fees

Endpoint: GET /pools

Parameters:

Name
Type
Description
Required

tokenA

address

Address of the first token

Yes

tokenB

address

Address of the second token

Yes

excludeDexes

string

Comma-separated list of router indices to exclude

No

Parameter Details:

  • tokenA & tokenB: The order doesn't matter - the API will find pools containing both tokens regardless of which is specified first

  • excludeDexes: Useful if you want to exclude specific protocols from your analysis. Refer to the router indices in the response to identify which numbers correspond to which DEXs

Example Requests:

# Basic pool discovery
GET https://api.liqd.ag/pools?tokenA=0x47bb061C0204Af921F43DC73C7D7768d2672DdEE&tokenB=0xF26A8ab118f4C46A2D3C0C5cF4bf446008efBf8c

# Exclude specific DEXs (router indices 1 and 3)
GET https://api.liqd.ag/pools?tokenA=0x47bb061C0204Af921F43DC73C7D7768d2672DdEE&tokenB=0xF26A8ab118f4C46A2D3C0C5cF4bf446008efBf8c&excludeDexes=1,3

Example Response:

{
  "success": true,
  "data": [
    {
      "poolAddress": "0x...",
      "pairedToken": "0x...",
      "routerIndex": 1,
      "fee": 0,
      "stable": true,
      "protocol": "KittenSwap",
      "pair": "WETH/USDC",
      "price": "1845.32"
    },
    {
      "poolAddress": "0x...",
      "pairedToken": "0x...",
      "routerIndex": 3,
      "fee": 500,
      "stable": false,
      "protocol": "HyperSwapV3",
      "pair": "WETH/USDC",
      "price": "1842.75"
    }
  ]
}

Understanding the Response

Pool Identification:

  • poolAddress: The smart contract address of the liquidity pool

  • protocol: Human-readable name of the DEX protocol

  • routerIndex: Numerical identifier used internally for routing decisions

Pool Characteristics:

  • fee: Trading fee for this pool (in basis points, where 500 = 0.5%)

  • stable: Whether this is a stable pool (optimized for assets with similar values)

  • pair: Human-readable token pair description

  • price: Current exchange rate in the pool

Trading Information:

  • pairedToken: The address of the token paired with your query tokens

  • Use the price information to compare rates across different pools

Practical Applications

Before Making Large Trades: Use this endpoint to understand liquidity distribution and identify which pools can handle your trade size without significant price impact.

Building Trading Tools: Integrate this data into trading interfaces to show users where their trades will be executed and why certain routes are chosen.

Arbitrage Detection: Compare prices across different pools to identify potential arbitrage opportunities when pools show significant price differences.

Pool Performance Monitoring: Track how pools perform over time by regularly polling this endpoint and analyzing changes in liquidity and pricing.

Last updated