Automate Blockchain DEX Insights with n8n and LangChain

This workflow automates real-time blockchain DEX insights by integrating Telegram with DexScreener API using n8n and LangChain. It solves the problem of manually tracking token boosts, pools, and trading pair data efficiently through AI-driven analysis.
telegramTrigger
agent
lmChatOpenAi
+5
Workflow Identifier: 2018
NODES in Use: Telegram Trigger, Set, When chat message received, OpenAI Chat Model, Window Buffer Memory, Agent, ToolHttpRequest, Telegram

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

1. The Challenge of Tracking Real-Time Blockchain DEX Activity

Meet Alex, a cryptocurrency trader and analyst specializing in decentralized exchanges (DEXs). Every day, Alex spends hours manually checking multiple blockchain DEX platforms to gather the latest token profiles, boosted tokens, trading pairs, and liquidity pool status. This process is repetitive, prone to mistakes, and time-consuming—leading to potential missed opportunities and costly delays.

Alex’s struggle is not unique. The fast-paced nature of blockchain trading demands instant access to reliable insights like token boosts and real-time trading liquidity. However, the DexScreener platform, a leading source for DEX data, provides a treasure trove of information that’s complex to monitor without specialized tools. Until now, no seamless automation existed to combine AI intelligence and live data from DexScreener directly into Alex’s everyday communication channel: Telegram.

2. What This Automation Does

This n8n workflow integrates Telegram messaging, LangChain AI, and the DexScreener API to provide an intelligent Blockchain DEX Screener Insights Agent. When Alex or any user sends a message to this Telegram bot, the workflow:

  • Receives and understands chatbot queries in Telegram through a Telegram Trigger.
  • Processes natural language with OpenAI’s Chat Model GPT-4o-mini to decipher what blockchain DEX data is requested.
  • Leverages LangChain Agents linked with a suite of DexScreener API tools to fetch specific insights, including:
    • Latest token profiles with descriptions and images
    • Currently boosted tokens and their details
    • Top tokens by boost activity
    • Search for trading pairs matching user input
    • Order status for tokens
    • Detailed pair information by chain and pair address
    • Liquidity pools for tokens
    • Pools and trading pairs by token addresses
  • Maintains conversational context using Window Buffer Memory so queries feel natural and continuous.
  • Responds directly back to the user in Telegram with formatted, insightful answers.

This automation transforms tedious manual lookups into instant, contextual insights delivered right where Alex already communicates, saving hours daily and reducing errors.

3. Prerequisites ⚙️

  • Telegram Account and Bot Token 📱 – To receive and send messages through Telegram nodes.
  • OpenAI API Account 🔑 – For GPT-4o-mini language model access via LangChain.
  • n8n Workflow Automation Platform 🔌 – Either hosted or via your own server (self-hosting options like Hostinger are available for performance and security).
  • DexScreener API – No explicit API key needed as the endpoints are public, but adherence to rate limits (60-300 requests per minute) is important.

4. Step-by-Step Guide to Building This Workflow

Step 1: Set Up Telegram Trigger Node

Navigate to your n8n editor, click + Add Node, search for Telegram Trigger, and add it. Set it to listen for message updates. Link your Telegram API credentials (set up a bot in Telegram and connect its token here). This node waits to capture messages from your Telegram bot.

Outcome: The workflow triggers each time you send a message to your Telegram bot.

Step 2: Add Session ID with Set Node

Add a Set node named Adds SessionId. Configure it to create a new string variable sessionId set to {{$json.message.chat.id}}. This uniquely identifies the chat session, allowing the AI agent to maintain context.

Common mistake: Forgetting to include other fields in the node settings will cause loss of message data.

Step 3: Configure the LangChain Chat Trigger

Add the node When chat message received set to LangChain’s chatTrigger. This node receives the natural language input to feed into the AI engine.

Step 4: Set Up the OpenAI Chat Model Node

Add OpenAI Chat Model node using the GPT-4o-mini model. Attach your OpenAI API credentials. This node processes conversational queries to understand what specific DexScreener data the user requests. No parameters need altering here unless you want different model behavior.

Step 5: Add Window Buffer Memory Node

Insert Window Buffer Memory node connected to the AI agent. This stores recent conversation context, making exchanges more human-like and coherent.

Step 6: Create Blockchain DEX Screener Insights Agent Node

This is the core LangChain agent node configured with a detailed system message explaining available DexScreener API tools and usage instructions. It also uses the user’s Telegram message text as input.

The node references multiple toolHttpRequest nodes representing these API calls:

  • DexScreener Latest Token Profiles
  • DexScreener Latest Boosted Tokens
  • DexScreener Top Token Boosts
  • DexScreener Search Pairs
  • DexScreener Check Orders Paid for Token
  • DexScreener Get Pairs by Chain and Pair Address
  • DexScreener Token Pools
  • DexScreener Pairs by Token Address

Each tool uses HTTP requests to fetch live data respecting the API’s rate limits and headers.

Step 7: Configure Each DexScreener Tool HTTP Request Node

For each HTTP node:

  • Set the URL as specified (e.g., https://api.dexscreener.com/token-profiles/latest/v1)
  • Add header Accept: */*
  • Enable path/query parameters where needed, for example passing chainId, tokenAddress, or search query parameter q
  • Provide detailed toolDescription to inform the AI agent about usage and rate limits

Step 8: Add Telegram Node for Sending Replies

Connect the output from the Blockchain DEX Screener Insights Agent to the Telegram node. Configure it with your Telegram credentials and set the text field to {{$json.output}}, sending the AI’s response back to the user in the same chat.

Step 9: Test Your Setup

Send questions to your Telegram bot like “Show me the latest boosted tokens” or “Get info about SOL/USDC pair”. The AI agent leverages the DexScreener tools to fetch live data and return insightful answers.

5. Customizations ✏️

  • Add More DEX APIs: In the Blockchain DEX Screener Insights Agent node, add new HTTP tools for other DEX platforms by duplicating the existing toolHttpRequest nodes and updating URLs and descriptions.
  • Change AI Model: Switch from GPT-4o-mini to GPT-4 or other OpenAI models within the OpenAI Chat Model node to enhance answer quality or reduce costs.
  • Multi-language Support: Use LangChain’s prompt engineering capabilities in the agent’s system message to support multiple languages for a global user base.
  • Notification Customization: Modify the Telegram node to send detailed messages with markdown, images, or buttons if Telegram supports it, for richer responses.
  • Rate Limit Handling: Implement a queue or wait feature in n8n for HTTP requests if you expect high volume to avoid API rate limit errors.

6. Troubleshooting 🔧

Problem: “No response from OpenAI Chat Model node”
Cause: API key missing, expired, or insufficient credits.
Solution: Double-check your OpenAI credentials under the node’s credentials tab. Renew or upgrade your account if needed.

Problem: “Telegram messages not triggering workflow”
Cause: Incorrect Telegram Bot Token or webhook not set properly.
Solution: Verify your Telegram API credential in n8n, and ensure the Telegram bot webhook is active and pointing to your n8n instance URL.

Problem: “Rate limit exceeded on DexScreener API requests”
Cause: Too many requests sent too quickly to DexScreener API endpoints.
Solution: Add delays between requests, respect rate limits noted in node descriptions, and use queue throttling in n8n.

7. Pre-Production Checklist ✅

  • Test Telegram Trigger by sending various messages and confirm n8n receives them.
  • Validate the OpenAI Chat Model processes text and generates appropriate input for LangChain agents.
  • Make trial API calls to each DexScreener HTTP Request node to confirm connectivity and correct parameter usage.
  • Run a full test conversation flow through Telegram to observe proper responses from the AI agent.
  • Backup your n8n workflow JSON before deployment for rollback.

8. Deployment Guide

Activate the workflow by switching it from inactive to active within the n8n editor. Ensure your n8n instance is publicly accessible to Telegram’s webhook URL for triggers to function. Monitor executions in the n8n dashboard to track errors or slowdowns. Adjust any API rate limits or node configurations if needed based on traffic and usage. Consider self-hosting n8n on reliable platforms like Hostinger for production stability.

9. FAQs

Can I use a different chat platform instead of Telegram?
Yes, n8n supports other chat integrations like Slack or Discord, but you will need to replace the Telegram trigger and node with their equivalents and adjust permissions accordingly.

Does this consume OpenAI API credits?
Yes, every message processed through the OpenAI Chat Model and LangChain consumes API calls and credits. Monitor usage to avoid unexpected charges.

Is my blockchain data safe?
The workflow only queries public DexScreener APIs and does not transmit sensitive user data externally except Telegram chats. Secure your n8n instance and API keys carefully.

Can this handle large volumes of queries simultaneously?
It depends on your n8n setup resources and the API rate limits. Consider scaling your infrastructure or adding queue management for concurrency.

10. Conclusion

By building this n8n Blockchain DEX Screener Insights Agent, you’ve automated the complex process of extracting and analyzing critical DeFi token data. This workflow harnesses AI, natural language, and live DexScreener API calls to deliver real-time insights directly to your Telegram chat. Alex and users like him save countless hours each week and reduce the risk of missing high-impact market moves.

Now that you have this powerful tool in your automation arsenal, consider expanding it with additional DEX data sources or integrating portfolio tracking for a complete blockchain trading assistant. Keep exploring n8n and LangChain’s capabilities to make your crypto trading smarter and faster.

Happy automating!

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free