n8n Aave V3 DeFi Position Monitor with Telegram + Email AI Reports
Scheduled Google Sheets wallet loader → Moralis on-chain data via API → GPT-4o-generated readable summary → simultaneous Telegram and Gmail delivery
- Who
- DeFi users, traders, or fund operators who need to batch-monitor multiple Ethereum wallet positions on Aave V3
- You get
- Periodically fetch on-chain position data and generate readable reports with health factor and liquidation risk, pushed to Telegram and email
- You need
- n8n · telegram · gmail · google-sheets
Constraints
Prerequisites: self-hosted or cloud n8n instance; Moralis account and API Key; OpenAI API Key; Telegram Bot and Chat ID; Gmail OAuth2 authorization; Google Sheets OAuth2 authorization. Costs: Moralis and OpenAI API are usage-based; self-hosted n8n has no platform fee. Input: Google Sheets with a `wallet_address` column. Output: Telegram text message + Gmail HTML email.
What they did
Template author Don Jayamaha built a 23-node n8n workflow. It triggers on schedule or manually, batch-reads Ethereum wallet addresses from Google Sheets, injects wallet and current-date variables via Edit Fields, then uses a LangChain AI Agent driving GPT-4o-mini to call three Moralis DeFi API endpoints (summary, positions, aave-v3/positions) for on-chain data, ultimately generating a structured Aave health report and pushing it simultaneously to Telegram and Gmail.
How it went
Published as an official n8n.io template (author_report), showing 900 views and a YouTube demo video. The author claims multi-wallet monitoring, dynamic liquidation-risk flagging, and human-readable summarization. Output formats include Telegram text summaries and HTML email reports.
Worth knowing
1. IP notice: template architecture, prompts, and report formatting are proprietary to Treasurium Capital Limited Company; unauthorized rebranding, redistribution, or resale is prohibited (source statement). 2. Core dependencies: you must bring your own Moralis API Key and OpenAI API Key, billed by usage; self-hosted n8n has no platform fee but requires instance maintenance. 3. Placeholder variables: Telegram Chat ID (<<Insert ChatID>>) and Gmail recipient ([email protected]) must be replaced with actual values after import, or messages will fail to deliver. 4. Health-factor threshold: the prompt suggests updating every 30 minutes and triggering critical alerts when health factor < 1.1, but actual trigger logic depends on the Schedule Trigger interval setting, which users must configure themselves. 5. Extension ideas: the author suggests adding Telegram slash commands for on-demand queries, expanding to Compound/Lido/Uniswap, or exporting to Notion/Slack/Data Studio (listed as customization ideas in source, not implemented in the core template). 6. Not tested by this site: reproduction=not_tested. We have not verified whether Moralis API response formats 100% match the prompt template, nor verified HTML email rendering consistency across clients.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- telegram node: connect Telegram Bot Token.
- lmChatOpenAi node: connect OpenAI API credentials.
- httpRequestTool node: connect HTTP/API keys per node headers or query params.
- gmail node: connect Gmail OAuth2 credentials.
- googleSheets node: connect Google Sheets OAuth2 credentials.
Configuration to replace
- Source template is n8n public workflow #4267 (~23 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Import the workflow template
In the n8n editor, select Import and upload the provided `AAVE_Portfolio_Professional_AI_Agent.json` file. After import, confirm all nodes are present on the canvas, especially that the main chain Google Sheets → Edit Fields → AI Agent is correctly connected.
Configure external service credentials
In n8n Settings → Credentials, add and connect the following credentials one by one: - Moralis: HTTP Header Auth, header name `X-API-Key`, value is your Moralis API Key - OpenAI: OpenAI API, select model gpt-4o-mini (or gpt-4o) - Telegram: Telegram Bot API, enter your Bot Token - Gmail: Gmail OAuth2, complete Google account authorization - Google Sheets: Google Sheets OAuth2, complete authorization In each corresponding node parameters, select the created credential name.
Create the wallet address sheet and authorize
Create a new Google Sheets with the first column header exactly `wallet_address`. Fill Ethereum wallet addresses (0x... format) in the rows below. Copy the document ID and paste it into the Document ID field of the 'Wallet Addresses to Monitor' node; confirm the Sheet name matches.
Configure trigger and variable nodes
'Schedule Trigger' node: set the execution interval (e.g., every X hours) or keep manual trigger. 'Edit Fields' node: confirm it maps `Wallet_Address = {{ $json.wallet_address }}` and `current_date = {{ new Date().toISOString().split('T')[0] }}` for subsequent API calls and report dating.
Configure the AI Agent and system prompt
The 'AAVE Portfolio Professional AI Agent' node is a LangChain Agent connected to the OpenAI Chat Model and three Moralis HTTP Request Tools. In Agent Options → System Message, enter the following system prompt (defining output format and API calling rules). This prompt also serves as the Agent's runtime instruction, driving the model to call tools and format results.
Execution prompt · Source text。AAVE Portfolio Professional AI Agent node Options → System Message field
You are a blockchain DeFi data assistant. Your task is to fetch, analyze, and summarize Aave-related DeFi positions using the Moralis DeFi API, then deliver a human-readable report to the user via Telegram. Your task is to: 1. Fetch, analyze, and summarize Aave-related DeFi positions using the Moralis DeFi API. 2. Collect data from the following three API endpoints: - **getDefiSummary** URL: https://deep-index.moralis.io/api/v2.2/wallets/{{ $json.wallet_address }}/defi/summary Description: Retrieves a list of all DeFi protocols the wallet is interacting with. - **getDefiPositionsSummary** URL: https://deep-index.moralis.io/api/v2.2/wallets/{{ $json.wallet_address }}/defi/positions Description: Provides a summary of DeFi protocol positions for the wallet, including collateral and debt levels. - **getDefiPositionsByProtocol** URL: https://deep-index.moralis.io/api/v2.2/wallets/{{ $json.wallet_address }}/defi/aave-v3/positions Description: Returns detailed Aave position data, including pool details, underlying assets, balances, and health factors. 🔹 Your output format must follow this structure: 1️⃣ **Header** 📊 Aave DeFi Health Report Wallet: {{wallet_address}} Date: {{$json.current_date}} 2️⃣ **Position Summary (Loop over each Aave pool position)** ▪️ Pool: {{pool_name}} • Supply: ${{supplyBalanceUSD}} • Borrowed: ${{borrowBalanceUSD}} • Collateral: ${{collateralValueUSD}} • Health Factor: {{healthFactor}} • Liquidation Threshold: {{liquidationThreshold}} • Liquidation Risk: {{liquidationRisk ? "⚠️ Yes" : "No"}} Underlying Assets: {{#each underlyingAssets}} - {{name}} ({{symbol}}): {{balance}} {{/each}} , 4️⃣ **Readable Numbers:** - Format large numbers with commas (e.g., `15,000` instead of `15000`). - Display ETH values to 4 decimal places for easy reading. 5️⃣ **Fallback Message** If no Aave data is found, reply with: ❌ No Aave V3 positions found for this wallet. 6️⃣ **Example Telegram Output:** 📊 Aave DeFi Health Report Wallet: 0xA221674eDB403A8F714F66Af74a2332c3CB5C0c3 Date: 2025-05-08 ▪️ Pool: Aave Lending Pool • Supply: $15,000.00 • Borrowed: $7,500.00 • Collateral: $15,000.00 • Health Factor: 2.00 • Liquidation Threshold: 1.05 • Liquidation Risk: No • Net Worth Underlying Assets: DAI: 10,000 USDC: 5,000 🔹 **Instructions:** - Fetch data directly from the Moralis API endpoints provided. - Parse and format the response according to the structure above. - Send the formatted message to the specified Telegram Chat ID. - If no data is available, send the fallback message instead. - This report should be updated every 30 minutes and triggered on critical health factors (<1.1).Configure email formatting and delivery
'Format Email' node (Code node): converts AI Agent output to HTML + plain text. Source logic: extract wallet address from output, generate dated subject, convert newlines to `<br>` and wrap in a styled div. Confirm this node outputs `htmlBody`, `textBody`, `subject`, and `wallet`. 'Gmail' node: Message field enter `={{ $json.htmlBody }}`, Subject keep 'Aave DeFi Health Report' or reference `{{ $json.subject }}`, Send To replace with actual recipient email.
Configure Telegram push and test run
'Telegram' node: Text field enter `={{ $json.output }}` (AI Agent output), Chat ID replace with actual Telegram chat ID. Disable appendAttribution. Save and execute Test Workflow: first confirm Google Sheets successfully reads addresses, then check that the AI Agent correctly calls the three Moralis tools and returns formatted text. If both Telegram and Gmail receive the corresponding report, configuration is complete. For first run, test with a single wallet address.
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to setup assistant; first confirm inputs and permissions
This block is the prompt. Ads are never placed here.
You are an n8n workflow setup assistant. The user wants to reproduce the 'AAVE Portfolio Professional AI Agent' template to automatically monitor Aave V3 positions and push reports. Your tasks: 1. Confirm the user has an n8n instance, Moralis API Key, OpenAI API Key, Telegram Bot Token, Gmail and Google Sheets OAuth2 authorization. 2. Guide the user to import the workflow JSON, configure credentials, create a Google Sheet with a `wallet_address` column, enter the system prompt, and replace the Telegram Chat ID and Gmail recipient address. 3. Remind the user to test with a single wallet address first, verifying Moralis data return and dual-channel output before batch execution. 4. If the user encounters credential connection issues, suggest checking the official n8n documentation for the corresponding node. Do not store keys on their behalf.
Before setup, confirm you have registered for Moralis and obtained an X-API-Key; the Telegram Bot must be created in advance to obtain Token and Chat ID; Gmail OAuth2 requires configuring the consent screen in Google Cloud Console.
Source
AAVE portfolio professional AI agent | Telegram + Email + GPT-4o + Moralis · don-the-gem-dealer · n8n.io · 2025-05-21
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.