search_pools
Find DeFi liquidity pools by searching with pool addresses, token addresses, or token symbols across multiple blockchain networks.
Instructions
Search for pools by query (pool address, token address, or token symbol)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (pool address, token address, or token symbol) | |
| network | No | Network ID to search on (optional, e.g., 'eth', 'bsc', 'polygon_pos') | |
| include | No | Attributes to include: 'base_token', 'quote_token', 'dex' (comma-separated) | |
| page | No | Page number for pagination (optional, default: 1) |
Implementation Reference
- Core implementation that makes HTTP request to CoinGecko /onchain/search/pools endpoint
async searchPools(query, options = {}) { try { const queryParams = new URLSearchParams(); if (query) queryParams.append('query', query); if (options.network) queryParams.append('network', options.network); if (options.include) queryParams.append('include', options.include); if (options.page) queryParams.append('page', options.page); const url = `${this.baseUrl}/search/pools${queryParams.toString() ? '?' + queryParams.toString() : ''}`; const response = await fetch(url, { headers: { 'x-cg-demo-api-key': this.apiKey } }); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } return await response.json(); } catch (error) { throw new Error(`Failed to search pools: ${error.message}`); } }