8
n8n 中文网amn8n.com

SOL/USDT多时间框架AI市场分析器与交易系统(含Telegram审批)

高级

这是一个Crypto Trading, AI Summarization领域的自动化工作流,包含 56 个节点。主要使用 If, Code, Wait, Merge, Telegram 等节点。 使用Gemini AI、多时间框架分析和AFK Crypto自动化Solana交易

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "TDhvdJh7HyOMRo6k",
  "meta": {
    "instanceId": "c4eae34af81eeff658410c97c38d8a485e4c73ba5cea5b25eef189aa5e5a73b9",
    "templateCredsSetupCompleted": true
  },
  "name": "SOL/USDT 多时间框架AI市场分析器与交易系统(含Telegram审批)",
  "tags": [],
  "nodes": [
    {
      "id": "63af3727-3774-4117-ba4d-6d28e0ff3c92",
      "name": "转录",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        -192
      ],
      "parameters": {
        "jsCode": "return {\n  json: {\n    symbol: \"SOLUSDT\",\n    price: $node[\"Fetch_1m\"].json.Data.Data.slice(-1)[0].close,\n    data_1m: $node[\"Fetch_1m\"].json.Data.Data,\n    data_5m: $node[\"Fetch_5m\"].json.Data.Data,\n    data_1h: $node[\"Fetch_1h\"].json.Data.Data\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "26be9798-3f0c-4086-8a53-a07d516c7ad8",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        448,
        -208
      ],
      "parameters": {
        "numberInputs": 3
      },
      "typeVersion": 3.2
    },
    {
      "id": "2567ad21-a7e9-42d8-9fa9-a1c9ba6f223c",
      "name": "获取1分钟数据",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        -384
      ],
      "parameters": {
        "url": "https://min-api.cryptocompare.com/data/v2/histominute?fsym=SOL&tsym=USDT&limit=60",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "5e067079-4be8-444d-a35e-e8aa193cf533",
      "name": "获取5分钟数据",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        -192
      ],
      "parameters": {
        "url": "https://min-api.cryptocompare.com/data/v2/histominute?fsym=SOL&tsym=USDT&limit=60&aggregate=5",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "b02873ec-79b0-4488-82aa-2d605d107d0a",
      "name": "获取1小时数据",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        0
      ],
      "parameters": {
        "url": "https://min-api.cryptocompare.com/data/v2/histohour?fsym=SOL&tsym=USDT&limit=60",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "590d5cfa-b7f3-43a2-8487-e3ff18fb044b",
      "name": "解析AI输出",
      "type": "n8n-nodes-base.code",
      "position": [
        1472,
        -192
      ],
      "parameters": {
        "jsCode": "// 1️⃣ Get raw text from AI Agent output\nconst rawOutput = $node[\"AI Agent\"].json.output;\n\n// 2️⃣ Validate that something exists\nif (!rawOutput) {\n  throw new Error(\"AI Agent output is empty or undefined.\");\n}\n\n// 3️⃣ Extract the JSON portion between ```json ... ```\nconst jsonMatch = rawOutput.match(/```json([\\s\\S]*?)```/);\n\nif (!jsonMatch) {\n  throw new Error(\"No valid JSON found in AI Agent output. Make sure the AI returns data inside ```json ... ```\");\n}\n\n// 4️⃣ Parse the extracted JSON content\nlet parsedData;\ntry {\n  parsedData = JSON.parse(jsonMatch[1].trim());\n} catch (err) {\n  throw new Error(\"Failed to parse JSON from AI Agent output: \" + err.message);\n}\n\n// 5️⃣ Return as parsed object for downstream nodes (e.g., Telegram)\nreturn [parsedData];"
      },
      "typeVersion": 2
    },
    {
      "id": "59b2ec89-e7f6-4dfc-a016-60a5b8ed9a97",
      "name": "发送文本消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1696,
        -192
      ],
      "webhookId": "1a1dfa33-b29d-4bea-baac-9a49a5f2d21b",
      "parameters": {
        "text": "=📊 *Multi-Timeframe Analysis*\n\n💲 *Symbol*: {{ $json.symbol }}\n💰 *Current Price*: ${{ $('Transcribe').item.json.price }}\n\n━━━━━━━━━━━━━━\n🕐 *1-Minute Analysis*\n• *Price Momentum:* {{ $json.analysis['1m'].price_momentum }}\n• *Volume Patterns:* {{ $json.analysis['1m'].volume_patterns }}\n• *Support/Resistance:* {{ $json.analysis['1m'].support_resistance }}\n• *Trend Direction:* {{ $json.analysis['1m'].trend_direction }}\n• *Moving Averages:* {{ $json.analysis['1m'].moving_averages }}\n• *Momentum Indicators:* {{ $json.analysis['1m'].momentum_indicators }}\n• *Volatility:* {{ $json.analysis['1m'].volatility }}\n\n",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c3841dcf-b7d3-4bc0-9ff7-9179b1b76ef9",
      "name": "每小时触发",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -16,
        -192
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b3e4d111-b90b-45fd-b275-1c0659979b76",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        2816,
        -288
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "74e970ea-4d82-4266-86f1-8cf0d3fb2fe9",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "LONG"
            },
            {
              "id": "a383d2f6-bfe7-4c11-81a8-ebc13b31ec05",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "Buy"
            },
            {
              "id": "4c2ac1da-631e-410a-8daa-f66d516e6024",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "Long"
            },
            {
              "id": "3be4941c-75dc-4c79-bc19-dd94957b12c8",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "buy"
            },
            {
              "id": "c9a6d9ea-1649-44fe-b99b-244ab1d96176",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "long"
            },
            {
              "id": "ba701b46-5b73-4e38-8af4-7f83d2a26fbf",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "Buy (Long)"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c30d5737-0aa0-4362-8b29-a0fe4e81df85",
      "name": "条件判断1",
      "type": "n8n-nodes-base.if",
      "position": [
        3040,
        -80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "85750594-99d7-4aca-88e5-90bf5ba8575d",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "SHORT"
            },
            {
              "id": "c3e9608a-7840-4c35-9d36-01755a6f4aa0",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "Sell"
            },
            {
              "id": "a7f4868b-2f3f-4587-9946-e6e21b1a9788",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "Short"
            },
            {
              "id": "bb80da00-3211-4ea4-8069-17ef42819de7",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "sell"
            },
            {
              "id": "bbf716e4-1557-4543-b75f-d31c22fdb342",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "short"
            },
            {
              "id": "e7426c1d-81b3-4ccf-87d5-211eafb98cb6",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}",
              "rightValue": "Sell (Short)"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8b7240b6-81bc-43cf-9231-b7a9771ca35a",
      "name": "获取钱包余额",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        912,
        -192
      ],
      "parameters": {
        "url": "https://api.afkcrypto.com/v1/wallets/balances?chain=solana",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "nnx8yhW5BkW736Dl",
          "name": "AFK_Crypto_API_Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a4dc8e55-4ffb-436c-9fe6-80c8b2d29c1b",
      "name": "买入确认",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3264,
        -608
      ],
      "webhookId": "37bc8b4b-c462-481b-b231-9e592305ade6",
      "parameters": {
        "text": "=✅ Successful\n\nPair: SOL/USDT\nAction: {{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}\nAmount: {{ $('Parse AI Output').item.json.trading_recommendation.position_amount }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_amount }}\nHash: {{ $json.hash }}\nDate: {{ $now }}",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "926d8714-72c4-412b-ad4b-9318ea4c233f",
      "name": "卖出确认",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3488,
        -176
      ],
      "webhookId": "47c5fab0-50c2-42c7-9ae3-d277fe55cba8",
      "parameters": {
        "text": "=☑️ Successful\n\nPair: SOL/USDT\nAction: {{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}\nAmount: {{ $('Parse AI Output').item.json.trading_recommendation.position_amount }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_amount }}\nHash: {{ $json.hash }}\nDate: {{ $now }}",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8e83181b-4229-4766-8616-addaa9e8e56c",
      "name": "条件判断2",
      "type": "n8n-nodes-base.if",
      "position": [
        4160,
        -672
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "fc37abe0-9ce2-46f2-9671-e41eff7b10c9",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.price }}",
              "rightValue": "={{ $('Parse AI Output').item.json.analysis.trading_recommendation.take_profit.tp1 }}{{ $('Parse AI Output').item.json.trading_recommendation.take_profit.tp1 }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "eef75327-e40b-4846-b3a8-b935297b5094",
      "name": "发送文本消息2",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3264,
        32
      ],
      "webhookId": "b1b16336-a2cc-444e-8bf7-d79577711dce",
      "parameters": {
        "text": "🔔 No transaction found 🔔",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f9344a7d-1dfe-48ff-97e8-574d15fd9ce8",
      "name": "批准/拒绝",
      "type": "n8n-nodes-base.if",
      "position": [
        2592,
        -192
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6adb07b1-38f3-4a13-bbc5-725cd3e0b4ef",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4a356019-3c61-4d2a-afe8-1e393249c290",
      "name": "发送文本消息3",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2816,
        -96
      ],
      "webhookId": "61378de0-919b-4687-9bb6-52f5ab777cf2",
      "parameters": {
        "text": "❌ Transaction cancelled ❌",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c8f87634-7cc4-4b63-8c8e-60a27fcf5d40",
      "name": "条件判断3",
      "type": "n8n-nodes-base.if",
      "position": [
        4384,
        -240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "fc37abe0-9ce2-46f2-9671-e41eff7b10c9",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json.price }}",
              "rightValue": "={{ $('Parse AI Output').item.json.analysis.trading_recommendation.take_profit.tp1 }}{{ $('Parse AI Output').item.json.trading_recommendation.take_profit.tp1 }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "01550883-d791-42c7-8b48-1b69f77e63d8",
      "name": "卖出SOL/USDC1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4384,
        -720
      ],
      "parameters": {
        "url": "https://api.afkcrypto.com/v1/trade/swap",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "chain",
              "value": "solana"
            },
            {
              "name": "fromToken",
              "value": "So11111111111111111111111111111111111111112"
            },
            {
              "name": "toToken",
              "value": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
            },
            {
              "name": "amount",
              "value": "={{ $('Parse AI Output').item.json.trading_recommendation.position_size }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_size }}"
            },
            {
              "name": "slippage",
              "value": "1"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Idempotency-Key",
              "value": "={{ $execution.id + '-tp' }}"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "nnx8yhW5BkW736Dl",
          "name": "AFK_Crypto_API_Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6a18378e-7eac-4ba4-9486-9bdd10e6a206",
      "name": "买入SOL/USDC1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4608,
        -288
      ],
      "parameters": {
        "url": "https://api.staging.afkcrypto.com/v1/trade/swap",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "chain",
              "value": "solana"
            },
            {
              "name": "fromToken",
              "value": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
            },
            {
              "name": "toToken",
              "value": "So11111111111111111111111111111111111111112"
            },
            {
              "name": "amount",
              "value": "={{ $('Parse AI Output').item.json.trading_recommendation.position_size }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_size }}"
            },
            {
              "name": "slippage",
              "value": "1"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Idempotency-Key",
              "value": "={{ $execution.id + '-tp' }}"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "nnx8yhW5BkW736Dl",
          "name": "AFK_Crypto_API_Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b934df6d-b0e4-4b15-95af-823a32f53145",
      "name": "条件判断4",
      "type": "n8n-nodes-base.if",
      "position": [
        4384,
        -512
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "9acbe266-8770-46f0-9169-1facd0f28f77",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json.price }}",
              "rightValue": "={{ $('Parse AI Output').item.json.analysis.trading_recommendation.stop_loss }}{{ $('Parse AI Output').item.json.trading_recommendation.stop_loss }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "861d10b8-c2e5-4b81-a0c0-79424ce9a5c0",
      "name": "卖出SOL/USDC2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4608,
        -512
      ],
      "parameters": {
        "url": "https://api.afkcrypto.com/v1/trade/swap",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "chain",
              "value": "solana"
            },
            {
              "name": "fromToken",
              "value": "So11111111111111111111111111111111111111112"
            },
            {
              "name": "toToken",
              "value": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
            },
            {
              "name": "amount",
              "value": "={{ $('Parse AI Output').item.json.trading_recommendation.position_size }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_size }}"
            },
            {
              "name": "slippage",
              "value": "1"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Idempotency-Key",
              "value": "={{ $execution.id + '-sl' }}"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "nnx8yhW5BkW736Dl",
          "name": "AFK_Crypto_API_Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4971f17e-6479-40bd-8ddf-4ae162fe50cb",
      "name": "发送文本消息4",
      "type": "n8n-nodes-base.telegram",
      "position": [
        5056,
        -288
      ],
      "webhookId": "33973b30-5041-4442-bea7-8528f57b6b72",
      "parameters": {
        "text": "=✅ Take Profit Hit\n\nPair: SOL/USDT\nAction: {{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}\nAmount: {{ $('Parse AI Output').item.json.trading_recommendation.position_amount }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_amount }} SOL\nBalance: {{ $json.balances[0].raw }}\nHash: {{ $json.hash }}\nDate: {{ $now }}",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "45616c25-62f1-4365-94a7-781dfedea485",
      "name": "发送文本消息5",
      "type": "n8n-nodes-base.telegram",
      "position": [
        5280,
        -80
      ],
      "webhookId": "33973b30-5041-4442-bea7-8528f57b6b72",
      "parameters": {
        "text": "=❌ Stop Loss Hit\n\nPair: SOL/USDT\nAction: {{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}\nAmount: {{ $('Parse AI Output').item.json.trading_recommendation.position_amount }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_amount }} SOL\nBalance: {{ $json.balances[0].raw }}\nHash: {{ $json.hash }}\nDate: {{ $now }}",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b3a66e36-f0cf-4d97-a51d-3679ce856942",
      "name": "买入SOL/USDT",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3040,
        -608
      ],
      "parameters": {
        "url": "https://api.afkcrypto.com/v1/trade/swap",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "chain",
              "value": "solana"
            },
            {
              "name": "fromToken",
              "value": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
            },
            {
              "name": "toToken",
              "value": "So11111111111111111111111111111111111111112"
            },
            {
              "name": "amount",
              "value": "={{ $('Parse AI Output').item.json.trading_recommendation.position_size }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_size }}"
            },
            {
              "name": "slippage",
              "value": "1"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Idempotency-Key",
              "value": "={{ $execution.id }}"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "nnx8yhW5BkW736Dl",
          "name": "AFK_Crypto_API_Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "47bae529-aab5-4d18-af0e-f43dac0bce4f",
      "name": "卖出SOL/USDT",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3264,
        -176
      ],
      "parameters": {
        "url": "https://api.afkcrypto.com/v1/trade/swap",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "chain",
              "value": "solana"
            },
            {
              "name": "fromToken",
              "value": "So11111111111111111111111111111111111111112"
            },
            {
              "name": "toToken",
              "value": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
            },
            {
              "name": "amount",
              "value": "={{ $('Parse AI Output').item.json.trading_recommendation.position_size }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_size }}"
            },
            {
              "name": "slippage",
              "value": "1"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Idempotency-Key",
              "value": "={{ $execution.id }}"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "nnx8yhW5BkW736Dl",
          "name": "AFK_Crypto_API_Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "aa3b9322-d886-44cf-a4b9-5ed2a987ffd0",
      "name": "发送文本消息6",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4832,
        -720
      ],
      "webhookId": "33973b30-5041-4442-bea7-8528f57b6b72",
      "parameters": {
        "text": "=✅ Take Profit Hit\n\nPair: SOL/USDT\nAction: {{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}\nAmount: {{ $('Parse AI Output').item.json.trading_recommendation.position_amount }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_amount }} SOL\nBalance: {{ $json.balances[0].raw }}\nHash: {{ $json.hash }}\nDate: {{ $now }}",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7a69556e-abc5-4369-a573-641995edc95b",
      "name": "发送文本消息7",
      "type": "n8n-nodes-base.telegram",
      "position": [
        5056,
        -512
      ],
      "webhookId": "33973b30-5041-4442-bea7-8528f57b6b72",
      "parameters": {
        "text": "=❌ Stop Loss Hit\n\nPair: SOL/USDT\nAction: {{ $('Parse AI Output').item.json.trading_recommendation.action }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}\nAmount: {{ $('Parse AI Output').item.json.trading_recommendation.position_amount }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_amount }} SOL\nBalance: {{ $json.balances[0].raw }}\nHash: {{ $json.hash }}\nDate: {{ $now }}",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "42bbe94f-cd46-41f3-bdce-674dcfa7c856",
      "name": "条件判断5",
      "type": "n8n-nodes-base.if",
      "position": [
        4608,
        -80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "fc37abe0-9ce2-46f2-9671-e41eff7b10c9",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.price }}",
              "rightValue": "={{ $('Parse AI Output').item.json.analysis.trading_recommendation.take_profit.tp1 }}{{ $('Parse AI Output').item.json.trading_recommendation.take_profit.tp1 }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "2f3eb1d3-3ac0-4bd6-83b3-aaf294aa02b3",
      "name": "检查SOL价格1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3936,
        -240
      ],
      "parameters": {
        "url": "https://www.okx.com/api/v5/market/ticker?instId=SOL-USDT",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "fc70de7a-f30a-419c-bd3f-a194f057f868",
      "name": "买入SOL/USDC2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4832,
        -80
      ],
      "parameters": {
        "url": "https://api.afkcrypto.com/v1/trade/swap",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "chain",
              "value": "solana"
            },
            {
              "name": "fromToken",
              "value": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
            },
            {
              "name": "toToken",
              "value": "So11111111111111111111111111111111111111112"
            },
            {
              "name": "amount",
              "value": "={{ $('Parse AI Output').item.json.trading_recommendation.position_size }}{{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_size }}"
            },
            {
              "name": "slippage",
              "value": "1"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Idempotency-Key",
              "value": "={{ $execution.id + '-sl' }}"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "nnx8yhW5BkW736Dl",
          "name": "AFK_Crypto_API_Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e3a33ad6-b834-4b92-adfe-65ac4e211191",
      "name": "价格转整数2",
      "type": "n8n-nodes-base.code",
      "position": [
        3936,
        -672
      ],
      "parameters": {
        "jsCode": "// Get the price as a string\nconst data = $json[\"data\"][0];\nconst lastPriceString = data.last;\n\n// Convert it to a Number (float)\nconst lastPrice = parseFloat(lastPriceString);\n\n// Return clean numeric output\nreturn [\n  {\n    json: {\n      symbol: data.instId,\n      price: lastPrice,\n    },\n  },\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "f9285afe-efa5-4b19-92fa-032e9f888ce3",
      "name": "等待15秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        3488,
        -608
      ],
      "webhookId": "9dfb401c-5cf4-4c9d-bd35-bbc0e41c2d21",
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "a47f29b7-2f34-46e0-821b-f2279928b6f9",
      "name": "等待15秒_1",
      "type": "n8n-nodes-base.wait",
      "position": [
        3712,
        -176
      ],
      "webhookId": "9dfb401c-5cf4-4c9d-bd35-bbc0e41c2d21",
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "23f9cb2f-aaa5-4dcc-82f0-0560cfa4bc67",
      "name": "价格转整数3",
      "type": "n8n-nodes-base.code",
      "position": [
        4160,
        -240
      ],
      "parameters": {
        "jsCode": "// Get the price as a string\nconst data = $json[\"data\"][0];\nconst lastPriceString = data.last;\n\n// Convert it to a Number (float)\nconst lastPrice = parseFloat(lastPriceString);\n\n// Return clean numeric output\nreturn [\n  {\n    json: {\n      symbol: data.instId,\n      price: lastPrice,\n    },\n  },\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "c1ea14ca-bec4-463f-9d16-12ac32f0e6d8",
      "name": "发送文本消息8",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -192
      ],
      "webhookId": "1a1dfa33-b29d-4bea-baac-9a49a5f2d21b",
      "parameters": {
        "text": "=━━━━━━━━━━━━━━\n⏱ *5-Minute Analysis*\n• *Price Momentum:* {{ $('Parse AI Output').item.json.analysis['5m'].price_momentum }}\n• *Volume Patterns:* {{ $('Parse AI Output').item.json.analysis['5m'].volume_patterns }}\n• *Support/Resistance:* {{ $('Parse AI Output').item.json.analysis['5m'].support_resistance }}\n• *Trend Direction:* {{ $('Parse AI Output').item.json.analysis['5m'].trend_direction }}\n• *Moving Averages:* {{ $('Parse AI Output').item.json.analysis['5m'].moving_averages }}\n• *Momentum Indicators:* {{ $('Parse AI Output').item.json.analysis['5m'].momentum_indicators }}\n• *Volatility:* {{ $('Parse AI Output').item.json.analysis['5m'].volatility }}",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f6466d67-5678-4af3-9bb2-9a6375a56ec1",
      "name": "HTTP请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4608,
        -720
      ],
      "parameters": {
        "url": "https://api.afkcrypto.com/v1/wallets/balances?chain=solana",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "307c506a-eb1a-4223-8912-2336eef9e80c",
      "name": "HTTP请求1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4832,
        -512
      ],
      "parameters": {
        "url": "https://api.afkcrypto.com/v1/wallets/balances?chain=solana",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "7b5c810a-30d5-4874-8f50-16656e43c148",
      "name": "HTTP请求2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4832,
        -288
      ],
      "parameters": {
        "url": "https://api.afkcrypto.com/v1/wallets/balances?chain=solana",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "e56caf8c-060b-4dd0-8f17-f69ff1c683d3",
      "name": "HTTP请求3",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5056,
        -80
      ],
      "parameters": {
        "url": "https://api.afkcrypto.com/v1/wallets/balances?chain=solana",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "6ea3dd48-4c5e-4f0b-8b98-8e19b8cb73b4",
      "name": "发送消息并等待回复",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2368,
        -192
      ],
      "webhookId": "d4fbeaff-b087-4666-8eb7-65f49dd30308",
      "parameters": {
        "chatId": "CHAT_ID",
        "message": "=━━━━━━━━━━━━━━\n📈 *Market Structure*\n• *Trend Alignment:* {{ $('Parse AI Output').item.json.market_structure.trend_alignment }}{{ $('Parse AI Output').item.json.analysis.market_structure.trend_alignment }}\n• *Confluence Zones:* {{ $('Parse AI Output').item.json.market_structure.confluence_zones }}{{ $('Parse AI Output').item.json.analysis.market_structure.confluence_zones }}\n• *Candlestick Patterns:* {{ $('Parse AI Output').item.json.market_structure.candlestick_patterns }}{{ $('Parse AI Output').item.json.analysis.market_structure.candlestick_patterns }}\n\n━━━━━━━━━━━━━━\n🎯 *Trading Recommendation*\n• *Action:* {{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}{{ $('Parse AI Output').item.json.trading_recommendation.action }}\n• *Immediate Action:* {{ $('Parse AI Output').item.json.analysis.trading_recommendation.immediate_action }}{{ $('Parse AI Output').item.json.trading_recommendation.immediate_action }}\n• *Entry Strategy:* {{ $('Parse AI Output').item.json.analysis.trading_recommendation.entry_strategy }}{{ $('Parse AI Output').item.json.trading_recommendation.entry_strategy }}\n• *Stop-Loss:* {{ $('Parse AI Output').item.json.analysis.trading_recommendation.stop_loss }}{{ $('Parse AI Output').item.json.trading_recommendation.stop_loss }}\n• *Take-Profits:*\n   • TP1 → {{ $('Parse AI Output').item.json.analysis.trading_recommendation.take_profit.tp1 }}{{ $('Parse AI Output').item.json.trading_recommendation.take_profit.tp1 }}\n• *Position Size:* {{ $('Parse AI Output').item.json.analysis.trading_recommendation.position_size }}{{ $('Parse AI Output').item.json.trading_recommendation.position_size }} lamports {{ $('Parse AI Output').item.json.trading_recommendation.position_amount }}\n\n━━━━━━━━━━━━━━\n*Do you want to execute the trade?* {{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}{{ $('Parse AI Output').item.json.trading_recommendation.action }}\n\n⚠️ *Disclaimer:* AI can make mistakes. ALWAYS double check the trade especially the POSITION SIZE. {{ $('Parse AI Output').item.json.disclaimer }}",
        "options": {},
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "52a8f39a-536f-4dc9-8cad-1a3356e51b0c",
      "name": "发送文本消息9",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2144,
        -192
      ],
      "webhookId": "1a1dfa33-b29d-4bea-baac-9a49a5f2d21b",
      "parameters": {
        "text": "=━━━━━━━━━━━━━━\n⏱ *1-Hour Analysis*\n• *Price Momentum:* {{ $('Parse AI Output').item.json.analysis['1hr'].price_momentum }}\n• *Volume Patterns:* {{ $('Parse AI Output').item.json.analysis['1hr'].volume_patterns }}\n• *Support/Resistance:* {{ $('Parse AI Output').item.json.analysis['1hr'].support_resistance }}\n• *Trend Direction:* {{ $('Parse AI Output').item.json.analysis['1hr'].trend_direction }}\n• *Moving Averages:* {{ $('Parse AI Output').item.json.analysis['1hr'].moving_averages }}\n• *Momentum Indicators:* {{ $('Parse AI Output').item.json.analysis['1hr'].momentum_indicators }}\n• *Volatility:* {{ $('Parse AI Output').item.json.analysis['1hr'].volatility }}",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "P5PVPL3oGa7q3l59",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b9f3362c-8cc5-473c-9b9a-129fc0a3d836",
      "name": "AI智能体",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1136,
        -192
      ],
      "parameters": {
        "text": "=Perform a full Multi-Timeframe Technical Analysis and Trading Recommendation using the following real market data.\n\nSymbol: {{$node[\"Transcribe\"].json[\"symbol\"]}}\nCurrent Price: {{$node[\"Transcribe\"].json[\"price\"]}}\n\n1-Minute Candlestick Data:\n{{$node[\"Transcribe\"].json[\"data_1m\"]}}\n\n5-Minute Candlestick Data:\n{{$node[\"Transcribe\"].json[\"data_5m\"]}}\n\n1-Hour Candlestick Data:\n{{$node[\"Transcribe\"].json[\"data_1h\"]}}\n\nAnalyze all timeframes, identify confluence between trends, support/resistance zones, and likely scenarios.\n\nWhen calculating position_size, follow these rules:\n\t•\tThe current account balance is {{ $json.balances[0].raw }} lamports.\nConvert it to SOL using:\n{{ $json.balances[0].raw }} = balance_lamports / 1,000,000,000\n\t•\tAssume a maximum risk of 1% of the balance per trade.\nrisk_amount_SOL = balance_lamports × 0.01.\n\t•\tUse this formula: position_size = risk_amount_SOL / |entry_price − stop_loss|.\n\t•\tConvert the result to lamports:\nposition_size_lamports = position_size × 1,000,000,000\n\t•\tSeparate both lamports and SOL in the output.\t•\tposition_size: formatted like: \"128965000\"\n\t•\tposition_amount: formatted like: \"(0.128965 SOL)\"\n\t•\tIf entry_price or stop_loss is missing, or if (entry_price − stop_loss) ≤ 0, set \"position_size\": \"Not applicable.\"\n\t•\tIf the calculated position_size exceeds the available balance, cap it at (balance_lamports × 0.99) to prevent over-allocation.\n\nReturn your final answer in valid JSON format, enclosed in triple backticks like this:\n\n```json\n{\n  \"symbol\": \"{{$node['Transcribe'].json['symbol']}}\",\n  \"analysis\": {\n    \"1m\": {\n      \"price_momentum\": \"\",\n      \"volume_patterns\": \"\",\n      \"support_resistance\": \"\",\n      \"trend_direction\": \"\",\n      \"moving_averages\": \"\",\n      \"momentum_indicators\": \"\",\n      \"volatility\": \"\"\n    },\n    \"market_structure\": {\n      \"trend_alignment\": \"\",\n      \"confluence_zones\": \"\",\n      \"candlestick_patterns\": \"\"\n    \"5m\": {\n      \"price_momentum\": \"\",\n      \"volume_patterns\": \"\",\n      \"support_resistance\": \"\",\n      \"trend_direction\": \"\",\n      \"moving_averages\": \"\",\n      \"momentum_indicators\": \"\",\n      \"volatility\": \"\"\n    },\n    \"market_structure\": {\n      \"trend_alignment\": \"\",\n      \"confluence_zones\": \"\",\n      \"candlestick_patterns\": \"\"\n     \"1hr\": {\n      \"price_momentum\": \"\",\n      \"volume_patterns\": \"\",\n      \"support_resistance\": \"\",\n      \"trend_direction\": \"\",\n      \"moving_averages\": \"\",\n      \"momentum_indicators\": \"\",\n      \"volatility\": \"\"\n    },\n    \"market_structure\": {\n      \"trend_alignment\": \"\",\n      \"confluence_zones\": \"\",\n      \"candlestick_patterns\": \"\"\n    },\n    \"trading_recommendation\": {\n      \"action\": \"LONG, SHORT, or HOLD\",\n      \"immediate_action\": \"\",\n      \"entry_strategy\": \"\",\n      \"stop_loss\": \"\",\n      \"stop_loss_reason\": \"\",\n      \"take_profit\": {\n        \"tp1\": \"\",\n        \"tp2\": \"\",\n        \"tp3\": \"\"\n      },\n      \"position_amount\": \"\"\n      \"position_size\": \"\"\n    }\n  },\n  \"disclaimer\": \"This is general information only and not financial advice. For personal guidance, please talk to a licensed professional.\"\n}",
        "options": {
          "systemMessage": "You are a professional quantitative crypto trading analyst.\n\nYour task is to perform structured, multi-timeframe technical analysis using real market data. Use professional trading terminology and objective, data-driven reasoning.\n\nAlways produce your report in this exact structure:\n\n1. **1-Minute Analysis**\n   - Price Momentum\n   - Volume Patterns and Spikes\n   - Support/Resistance Levels\n   - Short-Term Trend Direction\n   - Moving Averages\n   - Momentum Indicators\n   - Volatility\n\n2. **Market Structure Analysis**\n   - Trend Alignment Across Timeframes\n   - Confluence Zones\n   - Candlestick Patterns\n\n3. **Trading Recommendation**\n   - Action\n   - Immediate Action\n   - Entry Strategy\n   - Stop-Loss\n   - Take-Profit (TP1, TP2, TP3)\n   - Position Size\n\nGuidelines:\n- Only use the data provided. Do not assume or fabricate values.\n- Identify key support/resistance, trend strength, and momentum shifts.\n- Be concise, professional, and avoid emotional language.\n- End with this disclaimer:\n  “This is general information only and not financial advice. For personal guidance, please talk to a licensed professional.”"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "1769ee10-57ea-4cac-ba03-ddf2c2482f57",
      "name": "检查SOL价格",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3712,
        -672
      ],
      "parameters": {
        "url": "https://www.okx.com/api/v5/market/ticker?instId=SOL-USDT",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "328e30db-6733-4d75-a6d2-26f83b23dc70",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1200,
        32
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "rJzDGbm8eDazr9g5",
          "name": "Google Gemini API"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "17740cc3-d0ec-44c3-9413-f3f2e03fe5ba",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -432
      ],
      "parameters": {
        "width": 256,
        "height": 592,
        "content": "### 定时触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "a4576bad-8c80-4400-9af8-1053b1c13beb",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -560
      ],
      "parameters": {
        "color": 2,
        "width": 672,
        "height": 720,
        "content": "### 市场数据聚合器(Crypto Compare)"
      },
      "typeVersion": 1
    },
    {
      "id": "af9be015-8daf-4c80-b884-258893b8eb4d",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        -464
      ],
      "parameters": {
        "color": 4,
        "width": 336,
        "height": 624,
        "content": "### 多时间框架市场分析器"
      },
      "typeVersion": 1
    },
    {
      "id": "092bc523-7bc1-4e38-aa4e-31929dc42ef7",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -448
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 608,
        "content": "### 钱包余额验证器"
      },
      "typeVersion": 1
    },
    {
      "id": "e55b3b88-e28c-4888-aeac-cda127c2dea6",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        -528
      ],
      "parameters": {
        "color": 5,
        "width": 208,
        "height": 688,
        "content": "### 交易消息编辑器"
      },
      "typeVersion": 1
    },
    {
      "id": "e28d7b83-2748-45dc-81dd-38e027c16a42",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1664,
        -352
      ],
      "parameters": {
        "color": 6,
        "width": 864,
        "height": 512,
        "content": "### Telegram审批请求"
      },
      "typeVersion": 1
    },
    {
      "id": "9ddfa07b-afb8-42ba-8f25-36a6b09d22a8",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2544,
        -416
      ],
      "parameters": {
        "color": 7,
        "width": 208,
        "height": 576,
        "content": "### 审批条件过滤器"
      },
      "typeVersion": 1
    },
    {
      "id": "7add2bfe-1621-47b7-bf79-0004a0db9153",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2768,
        -800
      ],
      "parameters": {
        "width": 672,
        "height": 960,
        "content": "### AFK Crypto交易执行器"
      },
      "typeVersion": 1
    },
    {
      "id": "94ea6047-2c12-434d-b50e-89cfc8b381b1",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3456,
        -832
      ],
      "parameters": {
        "color": 3,
        "width": 1536,
        "height": 992,
        "content": "### 活跃持仓监控器"
      },
      "typeVersion": 1
    },
    {
      "id": "0552f986-694e-4b9d-97ed-1e8e85c77ebd",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5008,
        -672
      ],
      "parameters": {
        "color": 4,
        "width": 464,
        "height": 832,
        "content": "### 交易后总结消息"
      },
      "typeVersion": 1
    },
    {
      "id": "fa217657-4748-46bc-ab0b-6a0aa3a51900",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5488,
        -944
      ],
      "parameters": {
        "width": 768,
        "height": 1104,
        "content": "## SOL/USDT多时间框架AI市场分析器与交易系统(含Telegram审批)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "351ee0d9-6bb5-4afb-822a-a2a062da1e2c",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "BUY SOL/USDT",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "SELL SOL/USDT",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a text message2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "SELL SOL/USDC1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If3": {
      "main": [
        [
          {
            "node": "BUY SOL/USDC1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If4": {
      "main": [
        [
          {
            "node": "SELL SOL/USDC2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 15s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If5": {
      "main": [
        [
          {
            "node": "BUY SOL/USDC2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 15s_1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Transcribe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hourly": {
      "main": [
        [
          {
            "node": "Fetch_1m",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch_5m",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch_1h",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Parse AI Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch_1h": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Fetch_1m": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch_5m": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Wait 15s": {
      "main": [
        [
          {
            "node": "Check SOL Price",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe": {
      "main": [
        [
          {
            "node": "Get Wallet Balance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 15s_1": {
      "main": [
        [
          {
            "node": "Check SOL Price1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BUY SOL/USDT": {
      "main": [
        [
          {
            "node": "Buy Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Send a text message6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BUY SOL/USDC1": {
      "main": [
        [
          {
            "node": "HTTP Request2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BUY SOL/USDC2": {
      "main": [
        [
          {
            "node": "HTTP Request3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Send a text message7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request2": {
      "main": [
        [
          {
            "node": "Send a text message4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request3": {
      "main": [
        [
          {
            "node": "Send a text message5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SELL SOL/USDT": {
      "main": [
        [
          {
            "node": "Sell Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SELL SOL/USDC1": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SELL SOL/USDC2": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check SOL Price": {
      "main": [
        [
          {
            "node": "Convert Price to Int2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Output": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buy Confirmation": {
      "main": [
        [
          {
            "node": "Wait 15s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check SOL Price1": {
      "main": [
        [
          {
            "node": "Convert Price to Int3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sell Confirmation": {
      "main": [
        [
          {
            "node": "Wait 15s_1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Wallet Balance": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a text message": {
      "main": [
        [
          {
            "node": "Send a text message8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approved/Disapproved": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a text message3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a text message8": {
      "main": [
        [
          {
            "node": "Send a text message9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a text message9": {
      "main": [
        [
          {
            "node": "Send message and wait for response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Price to Int2": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Price to Int3": {
      "main": [
        [
          {
            "node": "If3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Send message and wait for response": {
      "main": [
        [
          {
            "node": "Approved/Disapproved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 加密货币交易, AI 摘要总结

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量56
分类2
节点类型10
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者

Automation expert and founder of AFK Crypto with over 5 years of experience in crypto automations.

外部链接
在 n8n.io 查看

分享此工作流