{
  "name": "AAVE portfolio professional AI agent | Telegram + Email + GPT-4o + Moralis",
  "nodes": [
    {
      "id": "8b4dd2cc-ecb4-46bb-bf3e-7715cf88a108",
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2760,
        0
      ]
    },
    {
      "id": "6506d454-1cd2-44b7-8207-9797141dce5a",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        620,
        0
      ]
    },
    {
      "id": "94d3ce0c-fafd-4ca0-a767-a164a5b2c160",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1320,
        320
      ]
    },
    {
      "id": "51b04d71-e0fa-48bd-a6bb-80021478010b",
      "name": "getDefiSummary",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1600,
        320
      ]
    },
    {
      "id": "981c2af0-b001-4f82-903a-b7c843fa0df9",
      "name": "getDefiPositionsSummary",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1900,
        320
      ]
    },
    {
      "id": "4f95523b-4877-4f29-a9f1-21c2d153bbb6",
      "name": "getDefiPositionsByProtocol",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2180,
        320
      ]
    },
    {
      "id": "1df5e729-f892-4a1e-8c4a-f50af0fc318e",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2780,
        260
      ]
    },
    {
      "id": "60badfca-b47c-4e07-abc4-be75e2297a71",
      "name": "Format Email",
      "type": "n8n-nodes-base.code",
      "position": [
        2480,
        260
      ]
    },
    {
      "id": "cf7e92d5-5201-4273-a65d-bb80f2d1f993",
      "name": "AAVE Portfolio Professional AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1740,
        0
      ]
    },
    {
      "id": "b57ddee3-7b92-4e89-9f58-37855a86ab31",
      "name": "Wallet Addresses to Monitor",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        980,
        0
      ]
    },
    {
      "id": "16293754-9aa6-4c6c-b9c5-e630e0ccbe25",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1340,
        0
      ]
    },
    {
      "id": "40cde5ac-8e8c-4e34-8ed8-24f2e13933cd",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        -240
      ],
      "parameters": {
        "width": null,
        "height": 420,
        "content": "## ⏰ Scheduler\n\n🔁 Triggers the workflow at fixed intervals (default: every X hours)\n\n✅ Used for automatic periodic scanning of all wallets in the sheet.\n"
      }
    },
    {
      "id": "72748224-3c09-4cc0-8607-d64788b35c0f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        900,
        -340
      ],
      "parameters": {
        "width": 260,
        "height": 520,
        "content": "## 📄 Google Sheets Wallet Loader\n\n📌 Purpose: Loads wallet addresses from a Google Sheet\n\n➕ Add wallet: Insert a new row\n➖ Remove wallet: Delete the row\n\n⚠️ Required column: `wallet_address`\n🗂️ Source "
      }
    },
    {
      "id": "e1b4d506-5859-466b-8754-2e2bd2630685",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        -260
      ],
      "parameters": {
        "width": null,
        "height": 440,
        "content": "## 🧩 Set Variables\n\n🪪 `Wallet_Address` – used in all API calls and report labels  \n📅 `current_date` – dynamically generates today's date in `YYYY-MM-DD` format\n\n✅ Enables personalized reporting per wa"
      }
    },
    {
      "id": "d2494da5-0196-438a-8da8-02fba036ab3b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1620,
        -340
      ],
      "parameters": {
        "width": 500,
        "height": 520,
        "content": "## 🤖 Aave AI Report Generator\n\n🧠 Uses LangChain + GPT to generate a DeFi health report for Aave V3 positions\n\n📥 Input: `Wallet_Address`, `current_date`\n📊 Fetches data from Moralis API:\n  - /defi/summa"
      }
    },
    {
      "id": "b27d9c2c-853c-4aad-891d-eb1722089b17",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        280
      ],
      "parameters": {
        "width": null,
        "height": 460,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n## 📡 Moralis API – DeFi Summary\n\n🔎 URL (dynamic): /wallets/{{$json.Wallet_Address}}/defi/summary  \n📋 Description: Fetches protocols wallet is using  \n⚠️ Requires valid Moralis API Key (HTT"
      }
    },
    {
      "id": "956ddef2-e2cb-4203-8aa1-e1bed07895f7",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1820,
        280
      ],
      "parameters": {
        "width": null,
        "height": 460,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## 📡 Moralis API – Position Summary\n\n🔎 URL (dynamic): /wallets/{{$json.Wallet_Address}}/defi/positions  \n📋 Description: Gets protocol-level position data (supply, borrow, collateral)  \n"
      }
    },
    {
      "id": "30a23bfd-ea48-473d-b72c-0164c278d7b4",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2100,
        280
      ],
      "parameters": {
        "width": null,
        "height": 460,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n## 📡 Moralis API – Aave V3 Details\n\n🔎 URL (dynamic): /wallets/{{$json.Wallet_Address}}/defi/aave-v3/positions  \n📋 Description: Gets pool-level breakdown (assets, health factor, risk)  \n🚨"
      }
    },
    {
      "id": "5ca1a63a-c5a3-4a96-a1b4-9942ef73467d",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2700,
        200
      ],
      "parameters": {
        "width": 260,
        "height": 560,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## 📧 Send Aave Report via Gmail\n\n📤 Sends formatted HTML email report  \n📥 Input: `htmlBody`, `subject` from code node  \n📌 To: <<Replace Email>>\n\n✅ Requires Gmail OAuth2 credential\n"
      }
    },
    {
      "id": "45ee0bc1-5c11-4b18-9f2f-8b09d015e6e8",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2400,
        200
      ],
      "parameters": {
        "width": 260,
        "height": 560,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## 📨 Format Email Report\n\n🧾 Converts report to HTML + plain text for Gmail delivery  \n🪪 Uses: `Wallet_Address`, `current_date`  \n📅 Date is auto-formatted on each run\n\n⚠️ Replace sta"
      }
    },
    {
      "id": "9b5d76f4-2e46-4847-a360-f4f2b3927e43",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2700,
        -300
      ],
      "parameters": {
        "width": null,
        "height": 480,
        "content": "## 📲 Telegram Message Delivery\n\n📤 Sends Aave summary message to Telegram chat  \n📥 Input: AI output in Markdown/HTML format  \n✅ Used for real-time updates and alerts\n\n📌 Chat ID: <<Replace ChatId>>\n"
      }
    },
    {
      "id": "7384fbd5-7964-4b2a-a0bd-fa715217cac0",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1220,
        280
      ],
      "parameters": {
        "width": 260,
        "height": 560,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n## 🧠 OpenAI Chat Model\n\n📌 Model: `gpt-4o-mini` (high-speed, multi-modal optimized)\n\n🎯 Role: Processes prompts and generates DeFi summaries and insights  \n🔗 Connected to LangChain Agent no"
      }
    },
    {
      "id": "9baa4c9d-2cb0-40bb-bdb8-cea460451024",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3240,
        -1400
      ],
      "parameters": {
        "width": 1280,
        "height": 2180,
        "content": "# 🧠 AAVE Portfolio Professional AI Agent – Full System Documentation\n\nA next-generation AI-powered DeFi portfolio analyzer built to monitor **multiple wallet addresses** and generate structured Aave V"
      }
    }
  ],
  "connections": {
    "Edit Fields": {
      "main": [
        [
          {
            "node": "AAVE Portfolio Professional AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Email": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "getDefiSummary": {
      "ai_tool": [
        [
          {
            "node": "AAVE Portfolio Professional AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Wallet Addresses to Monitor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AAVE Portfolio Professional AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "getDefiPositionsSummary": {
      "ai_tool": [
        [
          {
            "node": "AAVE Portfolio Professional AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "getDefiPositionsByProtocol": {
      "ai_tool": [
        [
          {
            "node": "AAVE Portfolio Professional AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Wallet Addresses to Monitor": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AAVE Portfolio Professional AI Agent": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          },
          {
            "node": "Format Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}