CoinMarketCap_DEXScan_Agent_Tool
工作流概述
这是一个包含15个节点的复杂工作流,主要用于自动化处理各种任务。
工作流源代码
{
"id": "ImiznkEUWCkKbg1w",
"meta": {
"instanceId": "a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6",
"templateCredsSetupCompleted": true
},
"name": "CoinMarketCap_DEXScan_Agent_Tool",
"tags": [],
"nodes": [
{
"id": "c055762a-8fe7-4141-a639-df2372f30060",
"name": "When Executed by Another Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
-60,
320
],
"parameters": {
"workflowInputs": {
"values": [
{
"name": "sessionId"
},
{
"name": "message"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "427c5700-f6d4-4e98-b2ef-c8eac986a754",
"name": "CoinMarketCap DEXScan Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
360,
320
],
"parameters": {
"text": "={{ $json.message }}",
"options": {
"systemMessage": "You are an AI agent connected to CoinMarketCap's DEXScan API via a suite of HTTP tools. You can retrieve detailed, real-time, and historical data about decentralized exchanges, spot pairs, liquidity pools, trading activity, and more.
Each tool includes parameter validation and usage guidance to prevent 400 Bad Request errors.
🔧 Available Tools & Descriptions
1. 📜 DEX Metadata
Purpose: Retrieve static information (name, logo, URLs, launch date, etc.) for one or more DEXs.
Endpoint: /v4/dex/listings/info
Required: id (one or more CMC DEX IDs)
Optional: aux → urls, logo, description, date_launched, notice
2. 🌐 DEX Networks List
Purpose: Get all blockchain networks associated with DEX trading, including metadata.
Endpoint: /v4/dex/networks/list
Optional Query Parameters:
start, limit (pagination)
sort: id, name
sort_dir: asc, desc
aux: alternativeName, cryptocurrencyId, cryptocurrencySlug, wrappedTokenId, etc.
3. 📊 DEX Listings Quotes
Purpose: List all decentralized exchanges with live trading data.
Endpoint: /v4/dex/listings/quotes
Optional:
start, limit, sort, sort_dir, type, aux, convert_id
Sort options: volume_24h, market_share, name, num_markets
4. 🔁 DEX Pair Quotes Latest
Purpose: Return latest market quotes for one or more spot pairs.
Endpoint: /v4/dex/pairs/quotes/latest
Required: contract_address or network_id or network_slug
Optional: aux, convert_id, skip_invalid, reverse_order
5. 📈 DEX OHLCV Historical
Purpose: Retrieve historical OHLCV (Open, High, Low, Close, Volume) data for spot pairs.
Endpoint: /v4/dex/pairs/ohlcv/historical
Required: contract_address or use network+asset identifiers
Optional:
time_period: daily, hourly, 1m, 5m, etc.
time_start, time_end, count, interval
aux, convert_id, skip_invalid, reverse_order
6. 🕒 DEX OHLCV Latest
Purpose: Returns current-day OHLCV data for spot pairs (real-time snapshot).
Endpoint: /v4/dex/pairs/ohlcv/latest
Required: contract_address or network_id or network_slug
Optional: aux, convert_id, skip_invalid, reverse_order
7. 🧾 DEX Trades Latest
Purpose: View the latest trades (up to 100) for one or more spot pairs.
Endpoint: /v4/dex/pairs/trade/latest
Required: contract_address or network_id or network_slug
Optional: aux, convert_id, skip_invalid, reverse_order
8. 🪙 DEX Spot Pairs Latest
Purpose: List all active spot trading pairs with latest market data.
Endpoint: /v4/dex/spot-pairs/latest
Required (any of):
network_id, network_slug
dex_id, dex_slug
base_asset_id, base_asset_symbol, base_asset_contract_address
quote_asset_id, quote_asset_symbol, quote_asset_contract_address
Optional:
limit, scroll_id
liquidity_min/max, volume_24h_min/max, percent_change_24h_min/max
sort: name, price, volume_24h, etc.
sort_dir: asc, desc
aux, convert_id, reverse_order
⚠️ General Rules to Avoid 400 Errors
Always include at least one required identifier per endpoint.
Use proper casing and valid slugs (e.g., ethereum, polygon).
Avoid mixing convert and convert_id.
Use comma-separated values when multiple inputs are allowed.
Only use documented values in aux, sort, and interval fields.
Do not leave required parameters blank or use unsupported types."
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "3101c7f4-cf73-4150-8a17-e11366c07c80",
"name": "DEXScan Agent Brain",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-400,
620
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "yUizd8t0sD5wMYVG",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "a596e26a-61eb-4fe1-8a07-3a93694beca0",
"name": "DEXScan Agent Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-220,
620
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "49bb58dc-d68b-4091-86f1-12e1071b1fbc",
"name": "DEX Metadata",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
-40,
620
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v4/dex/listings/info",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "id"
},
{
"name": "aux",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "Returns static metadata for one or more decentralized exchanges, including launch date, description, URLs, and logos.
Here is a precise and complete **tool description** for the `GET /v4/dex/listings/info` endpoint, formatted for use in your n8n agent system or documentation:
---
### 🧭 **DEX Metadata Tool**
**Purpose:**
Retrieve static metadata for one or more decentralized exchanges (DEXs) listed on CoinMarketCap. This includes key profile information such as name, status, description, launch date, logos, official URLs, and important notices.
**Endpoint:**
`https://pro-api.coinmarketcap.com/v4/dex/listings/info`
---
**Query Parameters:**
- `id` *(string, required)* – One or more comma-separated CoinMarketCap DEX IDs to fetch metadata for.
- `aux` *(string, optional)* – A comma-separated list of supplemental fields to include in the response.
Valid values:
- `\"urls\"` – Official website, social media, and documentation links
- `\"logo\"` – Hosted logo (default 64x64, customizable size via URL)
- `\"description\"` – Platform description
- `\"date_launched\"` – ISO 8601 launch date timestamp
- `\"notice\"` – Markdown-formatted warning about operational issues or status alerts
---
**Returns (200 OK):**
For each exchange:
- `id`: Unique CoinMarketCap ID
- `name`: Exchange name
- `slug`: URL-friendly name
- `status`: `\"active\"` or `\"inactive\"`
- `description`: (if requested via `aux`)
- `date_launched`: (if requested via `aux`)
- `logo`: (if requested via `aux`)
- `urls`: (if requested via `aux`)
- `notice`: Operational message, if applicable
---
**Error Handling:**
- **400 Bad Request**: Triggered if the `id` is missing or invalid.
- **⚠️ Large Response Alert:** If multiple IDs return too much metadata and exceed the GPT model’s context window, notify with:
> **\"⚠️ The returned metadata exceeds processing limits. Please reduce the number of IDs or narrow the `aux` parameters.\"**
",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "f87838f8-0840-4a78-9d4b-96c79a137d48",
"name": "DEX Networks List",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
140,
620
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v4/dex/networks/list",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "start",
"valueProvider": "modelOptional"
},
{
"name": "limit",
"valueProvider": "modelOptional"
},
{
"name": "sort",
"valueProvider": "modelOptional"
},
{
"name": "sort_dir",
"valueProvider": "modelOptional"
},
{
"name": "aux",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "Returns a list of all decentralized exchange (DEX) blockchain networks along with their CoinMarketCap IDs and associated metadata.
Optional query parameters (to avoid errors):
start (string) – Offset for pagination (1-based index)
limit (string) – Number of results to return (e.g. \"100\")
sort (string) – Sort field. Valid values: \"id\", \"name\"
sort_dir (string) – Sort order. Valid values: \"asc\", \"desc\"
aux (string) – Comma-separated list of extra fields. Valid values:
\"alternativeName\", \"cryptocurrencyId\", \"cryptocurrenySlug\",
\"wrappedTokenId\", \"wrappedTokenSlug\", \"tokenExplorerUrl\",
\"poolExplorerUrl\", \"transactionHashUrl\"
Make sure input values for sort, sort_dir, and aux are spelled exactly as shown to prevent a 400 error response.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "3f356c20-4efc-479b-b0fa-ab346c7340d8",
"name": "DEX Listings Quotes",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
360,
620
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v4/dex/listings/quotes",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "start",
"valueProvider": "modelOptional"
},
{
"name": "limit",
"valueProvider": "modelOptional"
},
{
"name": "sort",
"valueProvider": "modelOptional"
},
{
"name": "sort_dir",
"valueProvider": "modelOptional"
},
{
"name": "type",
"valueProvider": "modelOptional"
},
{
"name": "aux",
"valueProvider": "modelOptional"
},
{
"name": "convert_id",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "Returns a paginated list of all decentralized exchanges (DEXs) with their latest market data, including market share, quote volume, trading pairs, and multi-currency conversions.
🛠️ Acceptable Query Inputs:
start – Offset pagination start (e.g., \"1\")
limit – Max results to return
sort – Valid: \"name\", \"volume_24h\", \"market_share\", \"num_markets\"
sort_dir – \"asc\" or \"desc\"
type – \"all\", \"orderbook\", \"swap\", \"aggregator\"
aux – Optional extras, e.g., \"date_launched\"
convert_id – Currency IDs to convert quote values (up to 30)",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "3fceb769-621f-4e7f-9351-4052d72b3346",
"name": "DEX Pair Quotes Latest",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
560,
620
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v4/dex/pairs/quotes/latest",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "contract_address",
"valueProvider": "modelOptional"
},
{
"name": "network_id",
"valueProvider": "modelOptional"
},
{
"name": "aux",
"valueProvider": "modelOptional"
},
{
"name": "convert_id",
"valueProvider": "modelOptional"
},
{
"name": "skip_invalid",
"valueProvider": "modelOptional"
},
{
"name": "reverse_order",
"valueProvider": "modelOptional"
},
{
"name": "network_slug",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "Returns the latest market quote for one or more DEX spot trading pairs, including metrics like:
Liquidity
24h buy/sell volume
Security scans
Buy/sell tax
Percent pooled
Pool creation and supply stats
🛠️ Query Parameters Supported:
contract_address – (Comma-separated smart contract addresses)
network_id – CMC network IDs
network_slug – Slug-formatted network names (e.g., ethereum, polygon)
aux – Comma-separated fields:
pool_created, percent_pooled_base_asset, num_transactions_24h,
pool_base_asset, pool_quote_asset, 24h_volume_quote_asset,
total_supply_quote_asset, total_supply_base_asset, holders,
buy_tax, sell_tax, security_scan, 24h_no_of_buys, 24h_no_of_sells,
24h_buy_volume, 24h_sell_volume
convert_id – Comma-separated CMC currency IDs for conversion
skip_invalid – Pass \"true\" to ignore invalid results
reverse_order – Pass \"true\" to invert base/quote pair display",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "134d7fc5-15cf-4897-92bb-97b18a121e41",
"name": "DEX OHLCV Historical",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
740,
620
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v4/dex/pairs/ohlcv/historical",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "contract_address",
"valueProvider": "modelOptional"
},
{
"name": "network_id",
"valueProvider": "modelOptional"
},
{
"name": "network_slug",
"valueProvider": "modelOptional"
},
{
"name": "time_period",
"valueProvider": "modelOptional"
},
{
"name": "time_start",
"valueProvider": "modelOptional"
},
{
"name": "time_end",
"valueProvider": "modelOptional"
},
{
"name": "count",
"valueProvider": "modelOptional"
},
{
"name": "interval",
"valueProvider": "modelOptional"
},
{
"name": "aux",
"valueProvider": "modelOptional"
},
{
"name": "convert_id",
"valueProvider": "modelOptional"
},
{
"name": "skip_invalid",
"valueProvider": "modelOptional"
},
{
"name": "reverse_order",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "This tool retrieves historical OHLCV (Open, High, Low, Close, Volume) data for DEX spot trading pairs. It includes optional data on security risks, transaction activity, supply, and tax information. Supports flexible time range and sampling intervals for charting or backtesting.
✅ Valid Query Parameters:
contract_address (string) – A single DEX spot pair’s smart contract address (required unless using network + asset options).
network_id (string) – One or more CMC network IDs.
network_slug (string) – Friendly name slug of the network (e.g., \"ethereum\").
time_period (string) – Time unit for OHLCV data.
Allowed: \"daily\", \"hourly\", \"1m\", \"5m\", \"15m\", \"30m\", \"4h\", \"8h\", \"12h\", \"weekly\", \"monthly\"
(Default: \"daily\")
time_start (string) – ISO or Unix timestamp for start (e.g., \"2024-01-01\").
time_end (string) – ISO or Unix timestamp for end (e.g., \"2024-03-01\"). Optional.
count (string) – Number of time intervals to return (default is 10, max is 500).
interval (string) – How frequently to sample the time_period. Same options as time_period.
aux (string) – Optional comma-separated extra fields to return: pool_created, percent_pooled_base_asset, num_transactions_24h,
pool_base_asset, pool_quote_asset, 24h_volume_quote_asset,
total_supply_quote_asset, total_supply_base_asset, holders,
buy_tax, sell_tax, security_scan, 24h_no_of_buys, 24h_no_of_sells,
24h_buy_volume, 24h_sell_volume
convert_id (string) – Comma-separated CMC currency IDs for market conversion (e.g., \"1,2781\").
skip_invalid (string) – Pass \"true\" to skip failed lookups in bulk queries.
reverse_order (string) – Pass \"true\" to reverse base/quote asset display order.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "bee1d41a-af4c-442d-b0c6-7be0e17c31a5",
"name": "DEX OHLCV Latest",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
940,
640
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v4/dex/pairs/ohlcv/latest",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "contract_address",
"valueProvider": "modelOptional"
},
{
"name": "network_id",
"valueProvider": "modelOptional"
},
{
"name": "network_slug",
"valueProvider": "modelOptional"
},
{
"name": "aux",
"valueProvider": "modelOptional"
},
{
"name": "convert_id",
"valueProvider": "modelOptional"
},
{
"name": "skip_invalid",
"valueProvider": "modelOptional"
},
{
"name": "reverse_order",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "This tool retrieves the most recent OHLCV (Open, High, Low, Close, Volume) data for one or more spot trading pairs on decentralized exchanges. It reflects market activity during the current UTC day and is continuously updated. Suitable for real-time monitoring of decentralized market performance, this tool supports advanced filtering via network identifiers or contract addresses.
Required Input (at least one of the following):
contract_address (string)
One or more comma-separated smart contract addresses for the trading pair(s).
Example: \"0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640\"
network_id (string)
One or more CoinMarketCap internal network IDs.
Example: \"1\" (Ethereum)
network_slug (string)
The lowercase, hyphenated identifier of a blockchain network.
Example: \"ethereum\", \"binance-smart-chain\"
🧩 Optional Query Parameters:
aux (string)
Comma-separated list of additional fields to enrich the returned data:
Valid values: pool_created, percent_pooled_base_asset, num_transactions_24h,
pool_base_asset, pool_quote_asset, 24h_volume_quote_asset,
total_supply_quote_asset, total_supply_base_asset, holders,
buy_tax, sell_tax, security_scan, 24h_no_of_buys, 24h_no_of_sells,
24h_buy_volume, 24h_sell_volume
Example: \"security_scan,holders,pool_created\"
convert_id (string)
Calculate quote values in one or more fiat/crypto currencies using CoinMarketCap IDs.
Example: \"1\" (USD), \"2781\" (BTC)
Note: Cannot be used with the convert symbol-based parameter.
skip_invalid (string)
Accepts \"true\" or \"false\" (default).
If set to \"true\", skips spot pairs with invalid or missing data instead of returning a 400 error.
Example: \"true\"
reverse_order (string)
Accepts \"true\" or \"false\" (default).
Flips the order of the token pair if the token contract uses reverse naming convention.
Example: \"true\"
⚠️ Tips to Avoid 400 Errors:
Ensure at least one of contract_address, network_id, or network_slug is included.
Use correct spelling and case for slugs (e.g., \"ethereum\" not \"Ethereum\").
Only include valid aux values in a comma-separated list.
Do not use both convert and convert_id at the same time.
Avoid empty strings for required parameters or unsupported values in optional fields.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "742a6f07-d85d-4b6c-9ba6-90940e2b365c",
"name": "DEX Trades Latest",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1140,
640
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v4/dex/pairs/trade/latest",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "contract_address",
"valueProvider": "modelOptional"
},
{
"name": "network_id",
"valueProvider": "modelOptional"
},
{
"name": "network_slug",
"valueProvider": "modelOptional"
},
{
"name": "aux",
"valueProvider": "modelOptional"
},
{
"name": "convert_id",
"valueProvider": "modelOptional"
},
{
"name": "skip_invalid",
"valueProvider": "modelOptional"
},
{
"name": "reverse_order",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "Returns up to the latest 100 trades for one or more DEX spot pairs using CoinMarketCap.
Query Parameters Accepted:
contract_address: (Required*) One or more comma-separated contract addresses.
network_id: CoinMarketCap network ID (alternative to contract_address).
network_slug: URL-friendly network name (alternative to network_id).
aux: Optional fields to include: \"transaction_hash\", \"blockchain_explorer_link\".
convert_id: One or more fiat/crypto IDs to return converted market values.
skip_invalid: \"true\" to skip invalid pairs instead of erroring.
reverse_order: \"true\" to reverse trading pair (e.g., A/B → B/A).
Use at least one of contract_address, network_id, or network_slug to avoid a 400 error.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "3ddf229c-16b2-4610-982e-d5e3c07b0cb0",
"name": "DEX Spot Pairs Latest",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1340,
640
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v4/dex/spot-pairs/latest",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "network_id",
"valueProvider": "modelOptional"
},
{
"name": "network_slug",
"valueProvider": "modelOptional"
},
{
"name": "dex_id",
"valueProvider": "modelOptional"
},
{
"name": "dex_slug",
"valueProvider": "modelOptional"
},
{
"name": "base_asset_id",
"valueProvider": "modelOptional"
},
{
"name": "base_asset_symbol",
"valueProvider": "modelOptional"
},
{
"name": "base_asset_contract_address",
"valueProvider": "modelOptional"
},
{
"name": "base_asset_ucid",
"valueProvider": "modelOptional"
},
{
"name": "quote_asset_id",
"valueProvider": "modelOptional"
},
{
"name": "quote_asset_symbol",
"valueProvider": "modelOptional"
},
{
"name": "quote_asset_contract_address",
"valueProvider": "modelOptional"
},
{
"name": "quote_asset_ucid",
"valueProvider": "modelOptional"
},
{
"name": "scroll_id",
"valueProvider": "modelOptional"
},
{
"name": "limit",
"valueProvider": "modelOptional"
},
{
"name": "liquidity_min",
"valueProvider": "modelOptional"
},
{
"name": "liquidity_max",
"valueProvider": "modelOptional"
},
{
"name": "volume_24h_min",
"valueProvider": "modelOptional"
},
{
"name": "volume_24h_max",
"valueProvider": "modelOptional"
},
{
"name": "no_of_transactions_24h_min",
"valueProvider": "modelOptional"
},
{
"name": "no_of_transactions_24h_max",
"valueProvider": "modelOptional"
},
{
"name": "percent_change_24h_min",
"valueProvider": "modelOptional"
},
{
"name": "percent_change_24h_max",
"valueProvider": "modelOptional"
},
{
"name": "sort",
"valueProvider": "modelOptional"
},
{
"name": "sort_dir",
"valueProvider": "modelOptional"
},
{
"name": "aux",
"valueProvider": "modelOptional"
},
{
"name": "reverse_order",
"valueProvider": "modelOptional"
},
{
"name": "convert_id",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "This tool calls the /v4/dex/spot-pairs/latest endpoint to retrieve a paginated list of all active decentralized exchange (DEX) spot pairs with the latest market data. This includes price, liquidity, trading volume, and more. You can filter, sort, and enrich the results using query parameters.
⚠️ To avoid a 400 Bad Request error, you must include at least one of the following identifiers in your request:
network_id OR network_slug
dex_id OR dex_slug
base_asset_id, base_asset_symbol, or base_asset_contract_address
quote_asset_id, quote_asset_symbol, or quote_asset_contract_address
✅ Supported Query Parameters
Core Identifiers (At least one required):
network_id: One or more comma-separated CoinMarketCap network IDs.
network_slug: One or more comma-separated URL-friendly network slugs.
dex_id: One or more CoinMarketCap DEX exchange IDs.
dex_slug: One or more URL-friendly DEX slugs.
base_asset_id, base_asset_symbol, base_asset_contract_address: Identify the base asset of the pair.
quote_asset_id, quote_asset_symbol, quote_asset_contract_address: Identify the quote asset of the pair.
base_asset_ucid / quote_asset_ucid: Optional unique CoinMarketCap identifiers.
Pagination:
scroll_id: For continuous pagination. Use the scroll_id from the previous response to get the next set.
limit: Maximum number of results to return.
Filtering:
liquidity_min, liquidity_max: Minimum/maximum liquidity thresholds.
volume_24h_min, volume_24h_max: Minimum/maximum 24h volume thresholds.
no_of_transactions_24h_min, no_of_transactions_24h_max: Filter by transaction count.
percent_change_24h_min, percent_change_24h_max: 24-hour price change filters.
Sorting:
sort: Sort the results by:
name, date_added, price, volume_24h, percent_change_1h, percent_change_24h, liquidity, fully_diluted_value, no_of_transactions_24h
sort_dir: Direction of sort (asc or desc, default: desc)
Additional Metadata (Optional):
Use the aux parameter to enrich the response with supplemental fields:
pool_created, percent_pooled_base_asset, num_transactions_24h, pool_base_asset, pool_quote_asset, 24h_volume_quote_asset, total_supply_quote_asset, total_supply_base_asset, holders, buy_tax, sell_tax, security_scan, 24h_no_of_buys, 24h_no_of_sells, 24h_buy_volume, 24h_sell_volume
Quote Conversion:
convert_id: Convert pricing to specific fiat or crypto by CMC ID (e.g. convert_id=1,2781 for BTC, USD).
⚠️ Cannot be used with convert (symbol-based conversion).
Other Options:
reverse_order: Flip the base/quote asset order if needed.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "3dab3ebc-14c5-49a8-bb11-aa82564785a5",
"name": "DEXScan Agent Guide",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1580,
-760
],
"parameters": {
"width": 1080,
"height": 1420,
"content": "# 📊 CoinMarketCap DEXScan AI Agent Tool (n8n Workflow)
## 🧠 Multi-Agent System: DEXScan Agent
This workflow powers **DEX intelligence capabilities** in the CoinMarketCap AI Analyst ecosystem. It enables deep insights into **liquidity**, **volume**, **spot pairs**, and **trading activity** across decentralized exchanges.
---
### 🔧 Connected DEX Tools:
1. **DEX Metadata** – `/v4/dex/listings/info`
2. **DEX Networks List** – `/v4/dex/networks/list`
3. **DEX Listings Quotes** – `/v4/dex/listings/quotes`
4. **DEX Pair Quotes Latest** – `/v4/dex/pairs/quotes/latest`
5. **DEX OHLCV Historical** – `/v4/dex/pairs/ohlcv/historical`
6. **DEX OHLCV Latest** – `/v4/dex/pairs/ohlcv/latest`
7. **DEX Trades Latest** – `/v4/dex/pairs/trade/latest`
8. **DEX Spot Pairs Latest** – `/v4/dex/spot-pairs/latest`
---
## ✅ Key Capabilities:
- View real-time DEX liquidity and 24h trading volume
- Retrieve metadata (logos, URLs, launch info) for decentralized exchanges
- Track market pair quotes, liquidity, and spot pair data
- Monitor historical OHLCV data for technical analysis
- Identify recent trades and pair-specific activity
---
## 🧠 Agent Structure
### **1️⃣ DEXScan Brain**
- **Type**: GPT-4o Mini
- **Function**: Understands queries, routes tools, summarizes results
### **2️⃣ Session Memory**
- Maintains contextual state via memory buffer
### **3️⃣ Tool Triggers**
- **HTTP Tools:** Each CMC endpoint is mapped to one of 8 tool nodes with rich parameter control
---
## ⚠️ Notes:
- Use **`contract_address`**, **`network_slug`**, or **`network_id`** in nearly all endpoints
- Avoid using both `convert` and `convert_id` in the same query
- Be cautious of high-volume requests which may exceed token limits (e.g., when requesting OHLCV for many intervals)
---
📎 API responses are designed for fine-tuned filtering. You can retrieve:
- Top trading pairs on Polygon
- Volume-based DEX rankings
- Historical trade data for a Uniswap pair
- Real-time liquidity on Solana spot pairs"
},
"typeVersion": 1
},
{
"id": "af395be6-3683-478e-bffd-087ffa8dc8c9",
"name": "DEX Usage + Examples",
"type": "n8n-nodes-base.stickyNote",
"position": [
-100,
-760
],
"parameters": {
"color": 5,
"width": 960,
"height": 1000,
"content": "## 📌 How to Use the Workflow
### ✅ Step 1: Provide Inputs
Use `contract_address`, `network_slug`, `dex_slug`, or `convert_id` as needed
### ✅ Step 2: Trigger From Supervisor Agent
Parent agent forwards user message and sessionId to DEXScan
### ✅ Step 3: DEX Data is Returned
Data can be streamed to Telegram, dashboards, or HTTP response
---
## 🔍 Example API Calls
### 1️⃣ Get Top DEXs by 24h Volume
```plaintext
GET /v4/dex/listings/quotes?sort=volume_24h&limit=5
```
### 2️⃣ Query Historical OHLCV for SOL-USDT
```plaintext
GET /v4/dex/pairs/ohlcv/historical?network=solana&pair=SOL-USDT&interval=1d
```
### 3️⃣ Latest Trades on a Uniswap Pair
```plaintext
GET /v4/dex/pairs/trade/latest?contract_address=0x...&network_slug=ethereum
```
### 4️⃣ Spot Pairs on Polygon
```plaintext
GET /v4/dex/spot-pairs/latest?network_slug=polygon&sort=volume_24h
```
### 5️⃣ DEX Metadata for PancakeSwap
```plaintext
GET /v4/dex/listings/info?id=123&aux=logo,description,date_launched
```"
},
"typeVersion": 1
},
{
"id": "0fcffddb-d343-4739-917a-878925673295",
"name": "DEX Errors + IP Notice",
"type": "n8n-nodes-base.stickyNote",
"position": [
1220,
-760
],
"parameters": {
"color": 3,
"width": 740,
"height": 600,
"content": "## ⚠️ DEXScan Error Codes & Fixes
| Code | Message |
|------|---------|
| `200` | Success |
| `400` | Bad Request – missing/invalid query |
| `401` | Unauthorized – invalid API key |
| `429` | Rate limit exceeded |
| `500` | Server error |
### 🔍 Fixes:
- Always use at least 1 required param: `contract_address`, `network_slug`, etc.
- Double-check slugs and convert ID formats
- Don’t mix `convert` and `convert_id`
- Avoid oversized `aux` and `interval` combinations
---
## 🚀 Support & Licensing
🔗 **Don Jayamaha – LinkedIn**
[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)
© 2025 Treasurium Capital Limited Company. All rights reserved.
This AI workflow architecture, including logic, design, and prompt structures, is the intellectual property of Treasurium Capital Limited Company. Unauthorized reproduction, redistribution, or resale is prohibited under U.S. copyright law. Licensed use only."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "2507ec1c-d0e3-45ef-aca6-f16c81f9cf17",
"connections": {
"DEX Metadata": {
"ai_tool": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DEX OHLCV Latest": {
"ai_tool": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DEX Networks List": {
"ai_tool": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DEX Trades Latest": {
"ai_tool": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DEX Listings Quotes": {
"ai_tool": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DEXScan Agent Brain": {
"ai_languageModel": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"DEX OHLCV Historical": {
"ai_tool": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DEXScan Agent Memory": {
"ai_memory": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"DEX Spot Pairs Latest": {
"ai_tool": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DEX Pair Quotes Latest": {
"ai_tool": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"When Executed by Another Workflow": {
"main": [
[
{
"node": "CoinMarketCap DEXScan Agent",
"type": "main",
"index": 0
}
]
]
}
}
}
功能特点
- 自动检测新邮件
- AI智能内容分析
- 自定义分类规则
- 批量处理能力
- 详细的处理日志
技术分析
节点类型及作用
- Executeworkflowtrigger
- @N8N/N8N Nodes Langchain.Agent
- @N8N/N8N Nodes Langchain.Lmchatopenai
- @N8N/N8N Nodes Langchain.Memorybufferwindow
- @N8N/N8N Nodes Langchain.Toolhttprequest
复杂度评估
配置难度:
维护难度:
扩展性:
实施指南
前置条件
- 有效的Gmail账户
- n8n平台访问权限
- Google API凭证
- AI分类服务订阅
配置步骤
- 在n8n中导入工作流JSON文件
- 配置Gmail节点的认证信息
- 设置AI分类器的API密钥
- 自定义分类规则和标签映射
- 测试工作流执行
- 配置定时触发器(可选)
关键参数
| 参数名称 | 默认值 | 说明 |
|---|---|---|
| maxEmails | 50 | 单次处理的最大邮件数量 |
| confidenceThreshold | 0.8 | 分类置信度阈值 |
| autoLabel | true | 是否自动添加标签 |
最佳实践
优化建议
- 定期更新AI分类模型以提高准确性
- 根据邮件量调整处理批次大小
- 设置合理的分类置信度阈值
- 定期清理过期的分类规则
安全注意事项
- 妥善保管API密钥和认证信息
- 限制工作流的访问权限
- 定期审查处理日志
- 启用双因素认证保护Gmail账户
性能优化
- 使用增量处理减少重复工作
- 缓存频繁访问的数据
- 并行处理多个邮件分类任务
- 监控系统资源使用情况
故障排除
常见问题
邮件未被正确分类
检查AI分类器的置信度阈值设置,适当降低阈值或更新训练数据。
Gmail认证失败
确认Google API凭证有效且具有正确的权限范围,重新进行OAuth授权。
调试技巧
- 启用详细日志记录查看每个步骤的执行情况
- 使用测试邮件验证分类逻辑
- 检查网络连接和API服务状态
- 逐步执行工作流定位问题节点
错误处理
工作流包含以下错误处理机制:
- 网络超时自动重试(最多3次)
- API错误记录和告警
- 处理失败邮件的隔离机制
- 异常情况下的回滚操作