get_liquidity_sources
Retrieve available liquidity sources for a specific blockchain to identify trading opportunities and execute DeFi transactions.
Instructions
Get list of liquidity sources available on a specific chain
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainId | Yes | Blockchain ID to get sources for |
Implementation Reference
- src/services/agService.js:97-115 (handler)Core AgService handler implementing the HTTP fetch to the aggregator API endpoint /api/swap/sources.
async getLiquiditySources(chainId) { try { const response = await fetch(`${this.baseUrl}/api/swap/sources?chainId=${chainId}`); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } const data = await response.json(); if (!data.success) { throw new Error(data.error || 'API request failed'); } return data.data; } catch (error) { throw new Error(`Failed to get liquidity sources: ${error.message}`); } }