Workflow: CoinMarketCap_AI_Data_Analyst_Agent
Integrations: noOp, set, stickyNote, stopAndError, telegram, telegramTrigger

{"id": "mE7Zvhv1lOd4Q3xY", "meta": {"instanceId": "workflow-aa966e99", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:57.835149", "updatedAt": "2025-09-29T07:07:57.835229", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production"}, "name": "CoinMarketCap_AI_Data_Analyst_Agent", "tags": ["automation", "n8n", "production-ready", "excellent", "optimized"], "nodes": [{"id": "1eab0bd5-8f9c-4bc4-92b7-50779baa505c", "name": "Telegram Send Message", "type": "n8n-nodes-base.telegram", "position": [1180, 0], "webhookId": "0eeae020-ed6f-4900-ae38-d646d893171d", "parameters": {"text": "={{ $json.output }}", "chatId": "={{ $('Telegram Input').item.json.message.chat.id }}", "additionalFields": {}}, "credentials": {"telegramApi": {"id": "R3vpGq0SURbvEw2Z", "name": "Telegram account"}}, "typeVersion": 1, "notes": "This telegram node performs automated tasks as part of the workflow."}, {"id": "fd89fa7e-c4e1-4559-a0cc-42beaeccefb4", "name": "Adds SessionId", "type": "n8n-nodes-base.set", "position": [280, 0], "parameters": {"options": {}, "assignments": {"assignments": [{"id": "b5c25cd4-226b-4778-863f-79b13b4a5202", "name": "sessionId", "type": "string", "value": "={{ $json.message.chat.id }}"}]}, "includeOtherFields": true}, "typeVersion": 3.4, "notes": "This set node performs automated tasks as part of the workflow."}, {"id": "aea9adc8-8215-4459-9bf0-5a6b6364ffcc", "name": "CoinMarketCap AI Data Analyst Agent", "type": "n8n-nodes-base.noOp", "notes": "{{ $json.sessionId }}", "position": [660, 0], "parameters": {"text": "={{ $json.message.text }}", "options": {"systemMessage": "You are the **CoinMarketCap AI Data Analyst**, a powerful, multi-source crypto intelligence system that integrates three specialized agents:  \n- **CoinMarketCap Crypto Agent**  \n- **CoinMarketCap Exchange & Community Agent**  \n- **CoinMarketCap DEXScan Agent**\n\nYour job is to provide accurate, real-time, and strategic insights into the cryptocurrency landscape across centralized and decentralized platforms.\n\n---\n\n### \ud83d\udee0\ufe0f Tools and Agent Capabilities\n\nYou have access to a suite of **live CoinMarketCap APIs** organized by sub-agents. Each tool is mapped to an endpoint and validated for parameter safety to avoid 400 errors.\n\n---\n\n#### \ud83d\udd39 1. CoinMarketCap Crypto Agent\n\n**Focus:** Cryptocurrency-level data, listings, quotes, and conversions.\n\n**Tools:**\n- `Crypto Map` \u2013 Get coin IDs, names, symbols  \n- `Crypto Info` \u2013 Metadata like whitepapers, socials  \n- `Crypto Listings` \u2013 Top market cap coins  \n- `Quotes Latest` \u2013 Live price, volume, market cap  \n- `Global Metrics` \u2013 Total market stats, BTC dominance  \n- `Price Conversion` \u2013 Convert one asset to another  \n\n\u2705 Use for:  \n\u201cTop 10 coins by market cap,\u201d \u201cConvert 5 ETH to USD,\u201d \u201cBTC volume today,\u201d \u201cWhitepaper for SOL\u201d\n\n---\n\n#### \ud83d\udd39 2. CoinMarketCap Exchange & Community Agent\n\n**Focus:** Exchange intel, community sentiment, and market behavior.\n\n**Tools:**\n- `Exchange Map` \u2013 Discover exchanges and get IDs  \n- `Exchange Info` \u2013 Metadata like launch date, country, links  \n- `Exchange Assets` \u2013 Exchange token holdings & wallets  \n- `CMC 100 Index` \u2013 Latest CMC 100 index constituents  \n- `Fear and Greed Index` \u2013 Market sentiment tracker  \n\n\u2705 Use for:  \n\u201cWhich tokens does Binance hold?\u201d \u201cCurrent crypto sentiment\u201d \u201cTop 100 CMC coins\u201d\n\n---\n\n#### \ud83d\udd39 3. CoinMarketCap DEXScan Agent\n\n**Focus:** Decentralized trading data (spot pairs, pools, liquidity, OHLCV, trades).\n\n**Tools:**\n- `DEX Metadata` \u2013 Info for any DEX (logo, date, description)  \n- `DEX Networks List` \u2013 All blockchain networks  \n- `DEX Listings Quotes` \u2013 DEXs with live trading stats  \n- `DEX Pair Quotes Latest` \u2013 Live price/liquidity for spot pairs  \n- `DEX OHLCV Historical` \u2013 Historical OHLCV (e.g., 1h, 1d)  \n- `DEX OHLCV Latest` \u2013 Real-time OHLCV for current UTC day  \n- `DEX Trades Latest` \u2013 Up to 100 recent trades  \n- `DEX Spot Pairs Latest` \u2013 All active spot pairs with filters  \n\n\u2705 Use for:  \n\u201cPrice history of USDT/ETH on Uniswap,\u201d \u201cShow DEXs with highest volume,\u201d \u201cGet liquidity of token pair,\u201d \u201cSecurity scan for PancakeSwap pools\u201d\n\n---\n\n### \u2699\ufe0f Multi-Agent Coordination (Advanced Multi-Query Reasoning)\n\nYou are empowered with **advanced multi-query analysis** capabilities:\n- Chain data between agents (e.g., map \u2192 quote \u2192 historical chart)\n- Use outputs from one tool as inputs for another\n- Automatically fetch required IDs (e.g., exchange ID, contract address) before making a final API call\n- Combine centralized (CEX) and decentralized (DEX) insights into one unified response\n- Filter and compare across timeframes, assets, exchanges, and networks\n\n---\n\n### \u26a0\ufe0f Validation & Error Prevention Guidelines\n\nTo prevent 400 Bad Request errors:\n- Always include at least **one required field** per endpoint  \n- Use **valid slugs, symbols, or CoinMarketCap IDs**  \n- Don\u2019t use `convert` and `convert_id` together  \n- Use **comma-separated lists** for multi-inputs (if allowed)  \n- Use documented `aux`, `sort`, `interval` fields only  \n- Handle pagination via `scroll_id` or `start/limit` properly  \n\nIf output is too large:\n> \u26a0\ufe0f \u201cThe requested data exceeds the model\u2019s context limit. Please reduce the scope using filters, limits, or sort.\u201d\n\n---\n\n### \u2705 Example Tasks You Can Perform\n- \u201cGet liquidity and 24h volume for ETH/USDC on Polygon\u201d\n- \u201cCompare BTC price on Binance vs Uniswap\u201d\n- \u201cShow top 5 DEXs by volume and their top pairs\u201d\n- \u201cAnalyze historical price of SHIBA on Ethereum over last 7 days\u201d\n- \u201cGet CoinMarketCap\u2019s sentiment index and top index coins\u201d\n- \u201cList active spot pairs on Arbitrum with volume > $1M and return price, liquidity, and last 24h % change\u201d\n\n---\n\nYou are a **real-time, multi-source AI analyst** purpose-built to extract deep insights from CoinMarketCap\u2019s centralized and decentralized datasets. Use your agents intelligently, validate your queries, and return precise, structured results.\n\nLet\u2019s analyze the crypto world. \ud83c\udf0d\ud83d\udcca\ud83e\udde0\n"}, "promptType": "define"}, "typeVersion": 1.7}, {"id": "955f82c6-ce76-4d56-9714-4926a4936cbf", "name": "CoinMarketCap Agent Brain", "type": "n8n-nodes-base.noOp", "position": [420, 280], "parameters": {"model": {"__rl": true, "mode": "list", "value": "gpt-4o-mini"}, "options": {}}, "credentials": {"openAiApi": {"id": "yUizd8t0sD5wMYVG", "name": "OpenAi account"}}, "typeVersion": 1.2, "notes": "This lmChatOpenAi node performs automated tasks as part of the workflow."}, {"id": "2c253e1f-5a34-4334-8a8a-98c1e9e937cd", "name": "CoinMarketCap Memory", "type": "n8n-nodes-base.noOp", "position": [580, 280], "parameters": {}, "typeVersion": 1.3, "notes": "This memoryBufferWindow node performs automated tasks as part of the workflow."}, {"id": "0878a84b-14a3-4f8e-b94d-339b1c759f4d", "name": "CoinMarketCap Crypto Agent Tool", "type": "n8n-nodes-base.noOp", "position": [740, 280], "parameters": {"name": "CoinMarketCap_Crypto_Agent_Tool", "workflowId": {"__rl": true, "mode": "list", "value": "R4EuB1gx1IpMXCJM", "cachedResultName": "JayaFamily Assistant \u2014 CoinMarketCap_Crypto_Agent_Tool"}, "workflowInputs": {"value": {"message": "={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}", "sessionId": "={{ $json.sessionId }}"}, "schema": [{"id": "message", "type": "string", "display": true, "removed": false, "required": false, "displayName": "message", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "sessionId", "type": "string", "display": true, "removed": false, "required": false, "displayName": "sessionId", "defaultMatch": false, "canBeUsedToMatch": true}], "mappingMode": "defineBelow", "matchingColumns": [], "attemptToConvertTypes": false, "convertFieldsToString": false}}, "typeVersion": 2.1, "notes": "This toolWorkflow node performs automated tasks as part of the workflow."}, {"id": "4a6e4ae9-5ba5-48ab-8198-a7cd8c84b0ee", "name": "CoinMarketCap Exchange and Community Agent Tool", "type": "n8n-nodes-base.noOp", "position": [900, 280], "parameters": {"name": "CoinMarketCap_Exchange_and_Community_Agent_Tool", "workflowId": {"__rl": true, "mode": "list", "value": "kbJb4VMD3SZlcS2u", "cachedResultName": "JayaFamily Assistant \u2014 CoinMarketCap_Exchange_and_Community_Agent_Tool"}, "workflowInputs": {"value": {"message": "={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}", "sessionId": "={{ $json.sessionId }}"}, "schema": [{"id": "sessionId", "type": "string", "display": true, "removed": false, "required": false, "displayName": "sessionId", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "message", "type": "string", "display": true, "removed": false, "required": false, "displayName": "message", "defaultMatch": false, "canBeUsedToMatch": true}], "mappingMode": "defineBelow", "matchingColumns": [], "attemptToConvertTypes": false, "convertFieldsToString": false}}, "typeVersion": 2.1, "notes": "This toolWorkflow node performs automated tasks as part of the workflow."}, {"id": "77ffefe3-9671-4155-baed-d782035b6079", "name": "CoinMarketCap DEXScan Agent Tool", "type": "n8n-nodes-base.noOp", "position": [1080, 280], "parameters": {"name": "CoinMarketCap_DEXScan_Agent_Tool", "workflowId": {"__rl": true, "mode": "list", "value": "ImiznkEUWCkKbg1w", "cachedResultName": "JayaFamily Assistant \u2014 CoinMarketCap_DEXScan_Agent_Tool"}, "workflowInputs": {"value": {"message": "={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}", "sessionId": "={{ $json.sessionId }}"}, "schema": [{"id": "sessionId", "type": "string", "display": true, "removed": false, "required": false, "displayName": "sessionId", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "message", "type": "string", "display": true, "removed": false, "required": false, "displayName": "message", "defaultMatch": false, "canBeUsedToMatch": true}], "mappingMode": "defineBelow", "matchingColumns": [], "attemptToConvertTypes": false, "convertFieldsToString": false}}, "typeVersion": 2.1, "notes": "This toolWorkflow node performs automated tasks as part of the workflow."}, {"id": "d3fc4697-478b-4e6e-8d42-8138ec614748", "name": "Telegram Input", "type": "n8n-nodes-base.telegramTrigger", "position": [-220, 0], "webhookId": "b33d2025-01c2-4386-b677-206a87a1856b", "parameters": {"updates": ["message"], "additionalFields": {}}, "credentials": {"telegramApi": {"id": "R3vpGq0SURbvEw2Z", "name": "Telegram account"}}, "typeVersion": 1.1, "notes": "This telegramTrigger node performs automated tasks as part of the workflow."}, {"id": "d1108256-43c3-403f-bb7d-181c6de62f2a", "name": "CMC Multi-Agent Guide", "type": "n8n-nodes-base.stickyNote", "position": [-1600, -1600], "parameters": {"width": 1180, "height": 1960, "content": "# \ud83d\udcca CoinMarketCap AI Analyst Agent (n8n Workflow)\n\n## \ud83e\udde0 Multi-Agent System Overview\nThis is the **primary supervisor agent** for the **CoinMarketCap AI Analyst Workflow**, designed using **modular AI agent architecture** in **n8n**.\n\n\u26a0\ufe0f **This workflow requires 3 external tool workflows to function properly.** You must download, install, and connect the following:\n\n### \ud83d\udd0c Required Sub-Agent Tools:\n1. **CoinMarketCap_Crypto_Agent_Tool** \u2013 Handles cryptocurrency quotes, listings, conversions\n2. **CoinMarketCap_Exchange_and_Community_Agent_Tool** \u2013 Handles exchanges, trending tokens, Fear & Greed Index\n3. **CoinMarketCap_DEXScan_Agent_Tool** \u2013 Handles decentralized liquidity, pair quotes, OHLCV analysis\n\nOnce installed, these agents enable advanced capabilities:\n\n### \u2705 Key AI Functions:\n- Analyze market caps, volumes, supply metrics across coins\n- Track new listings and top gainers/losers\n- Evaluate trading pairs and liquidity in CEX and DEX markets\n- Retrieve sentiment indicators and trending discussions\n\n---\n\n## \ud83e\udde0 Node Structure Summary\n\n### **1\ufe0f\u20e3 Analyst Brain**\n- **Model**: GPT-4o Mini\n- **Function**: Understands user queries, delegates tasks to agents\n\n### **2\ufe0f\u20e3 Memory Buffer**\n- Stores session state and context between prompts\n\n### **3\ufe0f\u20e3 Tool Triggers**\n- **toolWorkflow()** function calls: \n   - `CoinMarketCap_Crypto_Agent_Tool`\n   - `CoinMarketCap_Exchange_and_Community_Agent_Tool`\n   - `CoinMarketCap_DEXScan_Agent_Tool`\n\n---\n\n## \u26a0\ufe0f Notes:\n- \ud83d\udcce Make sure API credentials are installed and valid for each agent\n- \ud83d\udccd Each tool runs independently but feeds results to the supervisor for synthesis\n- \ud83e\udde9 Use `message` and `sessionId` parameters consistently in every sub-agent call\n\n# \ud83d\udcca CoinMarketCap AI Analyst Agent Tools (n8n Workflow) Guide\n\n## \ud83d\ude80 Workflow Overview\nThe **CoinMarketCap AI Analyst Agent** is a modular AI-powered system built on **n8n** to deliver **real-time crypto market insights**. It connects directly to CoinMarketCap APIs across three specialized agents:\n\n- **Cryptocurrency Agent** \u2013 Market listings, quotes, conversions, and token info.\n- **Exchange & Community Agent** \u2013 Trending topics, exchange performance, and sentiment.\n- **DEXScan Agent** \u2013 Liquidity, trading volume, and OHLC data on decentralized markets.\n\n### \ud83c\udfaf **Key Capabilities**:\n- Fetch latest token listings and rank movements\n- Track real-time price quotes and convert values between currencies\n- Compare metrics like market cap, volume, and dominance\n- Monitor exchange market pairs and volume\n- Analyze community sentiment and Fear & Greed Index\n- Visualize DEX liquidity and historical trading trends\n\n---\n\n## \ud83d\udd17 Node Architecture Summary\n\n### **1\ufe0f\u20e3 AI Analyst Brain**\n- **Type**: GPT-4o Mini\n- **Function**: Interprets prompts and queries, routes requests to proper sub-agent.\n\n### **2\ufe0f\u20e3 Session Memory**\n- **Type**: Memory Buffer\n- **Function**: Maintains query context during conversation.\n\n### **3\ufe0f\u20e3 Tool Agents**\n- **Type**: Tool Workflow\n- Cryptocurrency / Exchange / DEXScan agent endpoints trigger APIs with mapped params.\n\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "5800cdc3-7d4b-4385-8401-b5913a43a28d", "name": "CMC Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [1260, -1600], "parameters": {"color": 3, "width": 680, "height": 600, "content": "## \u26a0\ufe0f Error Handling Guide\n\n| **Error Code** | **Meaning** |\n|---------------|------------|\n| `200` | Success |\n| `400` | Bad Request (invalid query/params) |\n| `401` | Unauthorized (missing or invalid API key) |\n| `429` | Rate Limit Exceeded |\n| `500` | CoinMarketCap server error |\n\n### \ud83d\udd0d Common Fixes\n- Ensure `symbol`, `slug`, or `id` match valid CoinMarketCap entries\n- Use correct `timestamp`, `network`, and pagination parameters\n- Rate-limit high-frequency queries to avoid 429 errors\n\n---\n\n## \ud83d\ude80 Need Help?\nFor custom CoinMarketCap agent support, dashboards, or token data automation, connect:\n\n\ud83c\udf10 **Don Jayamaha \u2014 LinkedIn**  \n\ud83d\udd17 [{{ $env.WEBHOOK_URL }}]({{ $env.WEBHOOK_URL }}\n\n\u00a9 2025 Treasurium Capital Limited Company. All rights reserved.\nThis 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.\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "068e7732-d92e-4a1d-a4b5-c0ee6363f3fb", "name": "CMC Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [0, -1600], "parameters": {"color": 5, "width": 900, "height": 1500, "content": "## \ud83d\udccc How to Use the Workflow\n\n### \u2705 Step 1: Provide Inputs\n- Use token `symbol`, `slug`, or `ID`\n- Set timestamps (`before`, `after`) in **Unix format** for historical data\n- Use `chain`, `limit`, and `start` for pagination when needed\n\n### \u2705 Step 2: Execute API Tools\n- The AI routes queries to sub-agents: **Cryptocurrency**, **Exchange**, or **DEXScan**\n\n### \u2705 Step 3: Get Response & Output\n- Results can be output to Telegram, dashboards, or n8n HTTP Response nodes\n\n---\n\n## \ud83d\udde3\ufe0f Example Questions to Ask the CMC AI Analyst\n\n### \ud83d\udcac Market Intelligence\n- \"What are the top 5 tokens by trading volume right now?\"\n- \"Which coins gained the most in the last 24 hours?\"\n- \"What\u2019s the total crypto market cap today?\"\n\n### \ud83d\udcac Token Insights\n- \"What\u2019s the price of SOL in USD?\"\n- \"How much is 1000 USDT in BTC?\"\n- \"Show me the description and whitepaper link for Dogecoin.\"\n\n### \ud83d\udcac Exchange & Sentiment\n- \"What\u2019s the Fear & Greed index today?\"\n- \"List exchanges with the highest asset holdings.\"\n- \"Give me info about Binance \u2013 when was it launched?\"\n\n### \ud83d\udcac DEX Data\n- \"Show me the top DEX spot pairs on Ethereum.\"\n- \"What\u2019s the OHLCV data for SOL-USDT on Solana over the last 7 days?\"\n- \"What trades just occurred on PancakeSwap?\"\n\n---\n\n## \u26a0\ufe0f Example API Queries\n\n### 1\ufe0f\u20e3 Get Top 5 Tokens by Volume\n```plaintext\nGET /v1/cryptocurrency/listings/latest?sort=volume_24h&limit=5\n```\n\n### 2\ufe0f\u20e3 Convert 1000 USDT to BTC\n```plaintext\nGET /v1/tools/price-conversion?amount=1000&symbol=USDT&convert=BTC\n```\n\n### 3\ufe0f\u20e3 Check Fear & Greed Index\n```plaintext\nGET /v3/fear-and-greed/latest\n```\n\n### 4\ufe0f\u20e3 Get OHLCV of DEX Pair\n```plaintext\nGET /v4/dex/pairs/ohlcv/historical?network=solana&pair=SOL-USDT&interval=1d\n```\n\n---"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "error-7c88e16e", "name": "Error Handler", "type": "n8n-nodes-base.stopAndError", "typeVersion": 1, "position": [1000, 400], "parameters": {"message": "Workflow execution error", "options": {}}}], "active": false, "pinData": {}, "settings": {"executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000}, "versionId": "ed2f29c5-293a-4796-8986-9c5f9980c6c6", "connections": {"1eab0bd5-8f9c-4bc4-92b7-50779baa505c": {"main": [[{"node": "error-handler-1eab0bd5-8f9c-4bc4-92b7-50779baa505c-c632c9e2", "type": "main", "index": 0}]]}, "955f82c6-ce76-4d56-9714-4926a4936cbf": {"main": [[{"node": "error-handler-955f82c6-ce76-4d56-9714-4926a4936cbf-d0749c0b", "type": "main", "index": 0}]]}, "d3fc4697-478b-4e6e-8d42-8138ec614748": {"main": [[{"node": "error-handler-d3fc4697-478b-4e6e-8d42-8138ec614748-f9b86c31", "type": "main", "index": 0}]]}}, "description": "Automated workflow: CoinMarketCap_AI_Data_Analyst_Agent. This workflow integrates 9 different services: telegramTrigger, stickyNote, telegram, agent, set. It contains 15 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: CoinMarketCap_AI_Data_Analyst_Agent. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}