AutomationFlowsAI & RAG › Automate Solana Trading with Gemini Ai, Multi-timeframe Analysis & Afk Crypto

Automate Solana Trading with Gemini Ai, Multi-timeframe Analysis & Afk Crypto

ByAFK Crypto @afkcrypto on n8n.io

The SOL/USDT Multi-Timeframe AI Market Analyzer and Trader with Telegram Approval is your fully automated Solana trading assistant powered by AI, AFK Crypto, and Telegram.

Cron / scheduled trigger★★★★★ complexityAI-powered56 nodesHTTP RequestTelegramAgentGoogle Gemini Chat
AI & RAG Trigger: Cron / scheduled Nodes: 56 Complexity: ★★★★★ AI nodes: yes Added:
Automate Solana Trading with Gemini Ai, Multi-timeframe Analysis & Afk Crypto — n8n workflow card showing HTTP Request, Telegram, Agent integration

This workflow corresponds to n8n.io template #9691 — we link there as the canonical source.

This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "TDhvdJh7HyOMRo6k",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "SOL/USDT Multi-Timeframe AI Market Analyzer and Trader with Telegram Approval",
  "tags": [],
  "nodes": [
    {
      "id": "63af3727-3774-4117-ba4d-6d28e0ff3c92",
      "name": "Transcribe",
      "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": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        448,
        -208
      ],
      "parameters": {
        "numberInputs": 3
      },
      "typeVersion": 3.2
    },
    {
      "id": "2567ad21-a7e9-42d8-9fa9-a1c9ba6f223c",
      "name": "Fetch_1m",
      "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": "Fetch_5m",
      "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": "Fetch_1h",
      "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": "Parse AI Output",
      "type": "n8n-nodes-base.code",
      "position": [
        1472,
        -192
      ],
      "parameters": {
        "jsCode": "// 1\ufe0f\u20e3 Get raw text from AI Agent output\nconst rawOutput = $node[\"AI Agent\"].json.output;\n\n// 2\ufe0f\u20e3 Validate that something exists\nif (!rawOutput) {\n  throw new Error(\"AI Agent output is empty or undefined.\");\n}\n\n// 3\ufe0f\u20e3 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\ufe0f\u20e3 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\ufe0f\u20e3 Return as parsed object for downstream nodes (e.g., Telegram)\nreturn [parsedData];"
      },
      "typeVersion": 2
    },
    {
      "id": "59b2ec89-e7f6-4dfc-a016-60a5b8ed9a97",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1696,
        -192
      ],
      "parameters": {
        "text": "=\ud83d\udcca *Multi-Timeframe Analysis*\n\n\ud83d\udcb2 *Symbol*: {{ $json.symbol }}\n\ud83d\udcb0 *Current Price*: ${{ $('Transcribe').item.json.price }}\n\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\ud83d\udd50 *1-Minute Analysis*\n\u2022 *Price Momentum:* {{ $json.analysis['1m'].price_momentum }}\n\u2022 *Volume Patterns:* {{ $json.analysis['1m'].volume_patterns }}\n\u2022 *Support/Resistance:* {{ $json.analysis['1m'].support_resistance }}\n\u2022 *Trend Direction:* {{ $json.analysis['1m'].trend_direction }}\n\u2022 *Moving Averages:* {{ $json.analysis['1m'].moving_averages }}\n\u2022 *Momentum Indicators:* {{ $json.analysis['1m'].momentum_indicators }}\n\u2022 *Volatility:* {{ $json.analysis['1m'].volatility }}\n\n",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c3841dcf-b7d3-4bc0-9ff7-9179b1b76ef9",
      "name": "Hourly",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -16,
        -192
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b3e4d111-b90b-45fd-b275-1c0659979b76",
      "name": "If",
      "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": "If1",
      "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": "Get Wallet Balance",
      "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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a4dc8e55-4ffb-436c-9fe6-80c8b2d29c1b",
      "name": "Buy Confirmation",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3264,
        -608
      ],
      "parameters": {
        "text": "=\u2705 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "926d8714-72c4-412b-ad4b-9318ea4c233f",
      "name": "Sell Confirmation",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3488,
        -176
      ],
      "parameters": {
        "text": "=\u2611\ufe0f 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8e83181b-4229-4766-8616-addaa9e8e56c",
      "name": "If2",
      "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": "Send a text message2",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3264,
        32
      ],
      "parameters": {
        "text": "\ud83d\udd14 No transaction found \ud83d\udd14",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f9344a7d-1dfe-48ff-97e8-574d15fd9ce8",
      "name": "Approved/Disapproved",
      "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": "Send a text message3",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2816,
        -96
      ],
      "parameters": {
        "text": "\u274c Transaction cancelled \u274c",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c8f87634-7cc4-4b63-8c8e-60a27fcf5d40",
      "name": "If3",
      "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": "SELL 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6a18378e-7eac-4ba4-9486-9bdd10e6a206",
      "name": "BUY 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b934df6d-b0e4-4b15-95af-823a32f53145",
      "name": "If4",
      "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": "SELL 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4971f17e-6479-40bd-8ddf-4ae162fe50cb",
      "name": "Send a text message4",
      "type": "n8n-nodes-base.telegram",
      "position": [
        5056,
        -288
      ],
      "parameters": {
        "text": "=\u2705 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "45616c25-62f1-4365-94a7-781dfedea485",
      "name": "Send a text message5",
      "type": "n8n-nodes-base.telegram",
      "position": [
        5280,
        -80
      ],
      "parameters": {
        "text": "=\u274c 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b3a66e36-f0cf-4d97-a51d-3679ce856942",
      "name": "BUY 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "47bae529-aab5-4d18-af0e-f43dac0bce4f",
      "name": "SELL 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "aa3b9322-d886-44cf-a4b9-5ed2a987ffd0",
      "name": "Send a text message6",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4832,
        -720
      ],
      "parameters": {
        "text": "=\u2705 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7a69556e-abc5-4369-a573-641995edc95b",
      "name": "Send a text message7",
      "type": "n8n-nodes-base.telegram",
      "position": [
        5056,
        -512
      ],
      "parameters": {
        "text": "=\u274c 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "42bbe94f-cd46-41f3-bdce-674dcfa7c856",
      "name": "If5",
      "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": "Check SOL Price1",
      "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": "BUY 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e3a33ad6-b834-4b92-adfe-65ac4e211191",
      "name": "Convert Price to Int2",
      "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": "Wait 15s",
      "type": "n8n-nodes-base.wait",
      "position": [
        3488,
        -608
      ],
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "a47f29b7-2f34-46e0-821b-f2279928b6f9",
      "name": "Wait 15s_1",
      "type": "n8n-nodes-base.wait",
      "position": [
        3712,
        -176
      ],
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "23f9cb2f-aaa5-4dcc-82f0-0560cfa4bc67",
      "name": "Convert Price to Int3",
      "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": "Send a text message8",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -192
      ],
      "parameters": {
        "text": "=\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\u23f1 *5-Minute Analysis*\n\u2022 *Price Momentum:* {{ $('Parse AI Output').item.json.analysis['5m'].price_momentum }}\n\u2022 *Volume Patterns:* {{ $('Parse AI Output').item.json.analysis['5m'].volume_patterns }}\n\u2022 *Support/Resistance:* {{ $('Parse AI Output').item.json.analysis['5m'].support_resistance }}\n\u2022 *Trend Direction:* {{ $('Parse AI Output').item.json.analysis['5m'].trend_direction }}\n\u2022 *Moving Averages:* {{ $('Parse AI Output').item.json.analysis['5m'].moving_averages }}\n\u2022 *Momentum Indicators:* {{ $('Parse AI Output').item.json.analysis['5m'].momentum_indicators }}\n\u2022 *Volatility:* {{ $('Parse AI Output').item.json.analysis['5m'].volatility }}",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f6466d67-5678-4af3-9bb2-9a6375a56ec1",
      "name": "HTTP Request",
      "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 Request1",
      "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 Request2",
      "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 Request3",
      "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": "Send message and wait for response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2368,
        -192
      ],
      "parameters": {
        "chatId": "CHAT_ID",
        "message": "=\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\ud83d\udcc8 *Market Structure*\n\u2022 *Trend Alignment:* {{ $('Parse AI Output').item.json.market_structure.trend_alignment }}{{ $('Parse AI Output').item.json.analysis.market_structure.trend_alignment }}\n\u2022 *Confluence Zones:* {{ $('Parse AI Output').item.json.market_structure.confluence_zones }}{{ $('Parse AI Output').item.json.analysis.market_structure.confluence_zones }}\n\u2022 *Candlestick Patterns:* {{ $('Parse AI Output').item.json.market_structure.candlestick_patterns }}{{ $('Parse AI Output').item.json.analysis.market_structure.candlestick_patterns }}\n\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\ud83c\udfaf *Trading Recommendation*\n\u2022 *Action:* {{ $('Parse AI Output').item.json.analysis.trading_recommendation.action }}{{ $('Parse AI Output').item.json.trading_recommendation.action }}\n\u2022 *Immediate Action:* {{ $('Parse AI Output').item.json.analysis.trading_recommendation.immediate_action }}{{ $('Parse AI Output').item.json.trading_recommendation.immediate_action }}\n\u2022 *Entry Strategy:* {{ $('Parse AI Output').item.json.analysis.trading_recommendation.entry_strategy }}{{ $('Parse AI Output').item.json.trading_recommendation.entry_strategy }}\n\u2022 *Stop-Loss:* {{ $('Parse AI Output').item.json.analysis.trading_recommendation.stop_loss }}{{ $('Parse AI Output').item.json.trading_recommendation.stop_loss }}\n\u2022 *Take-Profits:*\n   \u2022 TP1 \u2192 {{ $('Parse AI Output').item.json.analysis.trading_recommendation.take_profit.tp1 }}{{ $('Parse AI Output').item.json.trading_recommendation.take_profit.tp1 }}\n\u2022 *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\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\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\u26a0\ufe0f *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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "52a8f39a-536f-4dc9-8cad-1a3356e51b0c",
      "name": "Send a text message9",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2144,
        -192
      ],
      "parameters": {
        "text": "=\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\u23f1 *1-Hour Analysis*\n\u2022 *Price Momentum:* {{ $('Parse AI Output').item.json.analysis['1hr'].price_momentum }}\n\u2022 *Volume Patterns:* {{ $('Parse AI Output').item.json.analysis['1hr'].volume_patterns }}\n\u2022 *Support/Resistance:* {{ $('Parse AI Output').item.json.analysis['1hr'].support_resistance }}\n\u2022 *Trend Direction:* {{ $('Parse AI Output').item.json.analysis['1hr'].trend_direction }}\n\u2022 *Moving Averages:* {{ $('Parse AI Output').item.json.analysis['1hr'].moving_averages }}\n\u2022 *Momentum Indicators:* {{ $('Parse AI Output').item.json.analysis['1hr'].momentum_indicators }}\n\u2022 *Volatility:* {{ $('Parse AI Output').item.json.analysis['1hr'].volatility }}",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b9f3362c-8cc5-473c-9b9a-129fc0a3d836",
      "name": "AI Agent",
      "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\u2022\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\u2022\tAssume a maximum risk of 1% of the balance per trade.\nrisk_amount_SOL = balance_lamports \u00d7 0.01.\n\t\u2022\tUse this formula: position_size = risk_amount_SOL / |entry_price \u2212 stop_loss|.\n\t\u2022\tConvert the result to lamports:\nposition_size_lamports = position_size \u00d7 1,000,000,000\n\t\u2022\tSeparate both lamports and SOL in the output.\t\u2022\tposition_size: formatted like: \"128965000\"\n\t\u2022\tposition_amount: formatted like: \"(0.128965 SOL)\"\n\t\u2022\tIf entry_price or stop_loss is missing, or if (entry_price \u2212 stop_loss) \u2264 0, set \"position_size\": \"Not applicable.\"\n\t\u2022\tIf the calculated position_size exceeds the available balance, cap it at (balance_lamports \u00d7 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  \u201cThis is general information only and not financial advice. For personal guidance, please talk to a licensed professional.\u201d"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "1769ee10-57ea-4cac-ba03-ddf2c2482f57",
      "name": "Check SOL Price",
      "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 Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1200,
        32
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "17740cc3-d0ec-44c3-9413-f3f2e03fe5ba",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -432
      ],
      "parameters": {
        "width": 256,
        "height": 592,
        "content": "### Schedule Trigger  \nExecutes the workflow automatically every hour.  \nThis node initiates a full SOL/USDT analysis cycle \u2014 fetching data, running AI evaluation, and preparing a trade signal.  \nModify the interval for higher or lower trading frequency as needed.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a4576bad-8c80-4400-9af8-1053b1c13beb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -560
      ],
      "parameters": {
        "color": 2,
        "width": 672,
        "height": 720,
        "content": "### Market Data Aggregator (Crypto Compare)  \nFetches multi-timeframe OHLCV data for SOL/USDT using the Crypto Compare API.  \nTimeframes: 1m, 5m, and 1h \u2014 combined for momentum and volatility analysis.  \nData includes:\n- Open, High, Low, Close  \n- Volume and % Change  \nThis data feeds directly into the AI Analyzer for technical interpretation.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "af9be015-8daf-4c80-b884-258893b8eb4d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        -464
      ],
      "parameters": {
        "color": 4,
        "width": 336,
        "height": 624,
        "content": "### Multi-Timeframe Market Analyzer  \nProcesses the aggregated SOL/USDT data through an AI model (Gemini or OpenAI).  \nExtracts:\n- Market Sentiment (Bullish / Bearish / Neutral)  \n- Trade Recommendation (LONG / SHORT / HOLD)  \n- Stop-Loss and Take-Profit levels  \n- Confidence Rating and Reasoning  \nActs as the core intelligence module of the trading system.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "092bc523-7bc1-4e38-aa4e-31929dc42ef7",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -448
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 608,
        "content": "### Wallet Balance Verifier  \nQueries your AFK Crypto Wallet balance using:\nGET /v1/wallets/balances?chain=solana  \nEnsures there are sufficient funds before trade execution.  \nCalculates position size based on your 1% risk parameter relative to current balance.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e55b3b88-e28c-4888-aeac-cda127c2dea6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        -528
      ],
      "parameters": {
        "color": 5,
        "width": 208,
        "height": 688,
        "content": "### Trade Message Composer  \nGenerates a Telegram-ready message containing AI insights and trade details.  \nMessage includes:\n- Market Sentiment  \n- Suggested Position (LONG / SHORT)  \n- Entry, TP, SL  \n- Confidence Score  \nThis structured message is then sent to Telegram for approval.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e28d7b83-2748-45dc-81dd-38e027c16a42",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1664,
        -352
      ],
      "parameters": {
        "color": 6,
        "width": 864,
        "height": 512,
        "content": "### Telegram Approval Request  \nSends interactive message to your Telegram channel or chat with two buttons:\n\u2705 Approve \u2014 Execute Trade  \n\u274c Decline \u2014 Ignore Signal  \nEnsures you maintain manual control over trade execution decisions.  \nRequires Telegram Bot Token and Chat ID credentials.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9ddfa07b-afb8-42ba-8f25-36a6b09d22a8",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2544,
        -416
      ],
      "parameters": {
        "color": 7,
        "width": 208,
        "height": 576,
        "content": "### Approval Condition Filter  \nEvaluates your Telegram response.  \nIf response = \u2705 Approve \u2192 continue to Trade Execution node.  \nIf response = \u274c Decline \u2192 send cancellation message and end flow.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7add2bfe-1621-47b7-bf79-0004a0db9153",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2768,
        -800
      ],
      "parameters": {
        "width": 672,
        "height": 960,
        "content": "### AFK Crypto Trade Executor  \nExecutes trade instantly via:\nPOST /v1/trade/swap  \nUses AI\u2019s recommended parameters:\n- Pair: SOL/USDT  \n- Type: Buy/Sell  \n- Amount: Calculated 1% risk size  \nHandles all on-chain execution automatically through your AFK Crypto Wallet.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "94ea6047-2c12-434d-b50e-89cfc8b381b1",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3456,
        -832
      ],
      "parameters": {
        "color": 3,
        "width": 1536,
        "height": 992,
        "content": "### Active Position Watcher  \nContinuously monitors live SOL price after trade execution.  \nEvaluates TP and SL conditions in real-time using latest market data.  \nOnce target is hit:\n- Live monitoring of SOL price\n- Position auto-closes via AFK Crypto API.  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "0552f986-694e-4b9d-97ed-1e8e85c77ebd",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5008,
        -672
      ],
      "parameters": {
        "color": 4,
        "width": 464,
        "height": 832,
        "content": "### Post-Trade Summary Message  \nSends Telegram notification summarizing the completed trade:  \n- Entry and Exit Prices  \n- Result (Profit / Loss)  \n- Updated Wallet Balance  \nKeeps you informed of all closed trades in real time.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fa217657-4748-46bc-ab0b-6a0aa3a51900",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5488,
        -944
      ],
      "parameters": {
        "width": 768,
        "height": 1104,
        "content": "## SOL/USDT Multi-Timeframe AI Market Analyzer and Trader with Telegram Approval  \n\n### Try It Out!  \nAn intelligent AI-powered Solana trading assistant that merges multi-timeframe market analysis, Telegram approvals, and on-chain AFK Crypto execution.  \nGives you full automation with manual approval control.\n\n### How It Works  \n1. Hourly trigger starts analysis.  \n2. Fetches SOL/USDT data (1m, 5m, 1h).  \n3. AI generates trade suggestion + TP/SL.  \n4. Wallet balance verified.  \n5. Telegram message sent for approval.  \n6. Upon approval, executes trade.  \n7. Monitors open position and closes automatically upon TP/SL.  \n8. Sends Telegram report after each trade.\n\n### How to Use  \n- Import into n8n workspace.  \n- Set AFK Crypto API key, Telegram Bot Token, and Chat ID.  \n- Adjust timeframes or risk allocation in config nodes.  \n- Deploy and activate.  \n\n### (Optional) Extend This Workflow  \n- Auto-Trade if Confidence > 90%.  \n- Sync trades to Notion or Airtable for PnL tracking.  \n- Dynamic risk adjuster based on balance and volatility.  \n- Add ETH/USDT or BTC/USDT pairs for diversification.\n\n### Requirements  \n- AFK Crypto Wallet + API Key  \n- Telegram Bot Token + Chat ID  \n- Crypto Compare API Key  \n- Active n8n instance with HTTP Request, AI, and Telegram nodes enabled  \n\n### AFK APIs Used  \n- GET https://api.afkcrypto.com/v1/wallets/balances?chain=solana  \n- POST https://api.afkcrypto.com/v1/trade/swap  \n\n### Summary  \nA complete AI-integrated Solana trading system with real-time analysis, Telegram approvals, and automated execution \u2014 balancing AI precision with trader control.\n\n## AFK Crypto Website: afkcrypto.com\n## Join our Discord server! https://discord.com/invite/v4DgTEUUJJ"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "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": [
        [
          {
            "nod

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

The SOL/USDT Multi-Timeframe AI Market Analyzer and Trader with Telegram Approval is your fully automated Solana trading assistant powered by AI, AFK Crypto, and Telegram.

Source: https://n8n.io/workflows/9691/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Author: Nguyen Thieu Toan Category: Community & Knowledge Automation Tags: Telegram, Reddit, n8n Forum, AI Summarization, Gemini, Groq

Groq Chat, Output Parser Structured, Memory Mongo Db Chat +5
AI & RAG

This workflow is for beauty salons who want consistent, high‑quality social media content without writing every post manually. It also suits agencies and automation builders who manage multiple beauty

Telegram, Google Sheets Trigger, Agent +26
AI & RAG

Who Is This For?

Telegram, Google Sheets Trigger, Lm Chat Mistral Cloud +17
AI & RAG

This workflow automates the creation of a daily sports podcast from your favorite news sources. It fetches articles, uses AI to write a digest and a two-person dialogue, and produces a single, merged

Google Gemini Chat, RSS Feed Read, Execute Command +4
AI & RAG

This workflow is perfect for digital marketers, brand managers, or data analysts and Busy people, seeking to monitor real-time trends and competitor activity without manual effort. The workflow is tri

HTTP Request, Telegram, Agent +2