get_trending_pools_by_network
Identify trending liquidity pools on a specific blockchain network to discover trading opportunities based on recent activity metrics.
Instructions
Get trending pools on a specific network
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | Yes | Network ID (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) | |
| duration | No | Duration for trending: '5m', '1h', '6h', '24h' (optional, default: '24h') |
Implementation Reference
- Helper function in CoinGeckoApiService that makes the HTTP request to CoinGecko's trending pools endpoint for a specific network, handling query parameters and API key.
async getTrendingPoolsByNetwork(network, options = {}) { try { const queryParams = new URLSearchParams(); if (options.include) queryParams.append('include', options.include); if (options.page) queryParams.append('page', options.page); if (options.duration) queryParams.append('duration', options.duration); const url = `${this.baseUrl}/networks/${network}/trending_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 get trending pools by network: ${error.message}`); } }