Automate Bitget Spot Trading with GPT-4o-mini AI Agent via Telegram

Go to Workflow
0 views
Built by Don Jayamaha Jr Don Jayamaha Jr
Created on June 05, 2026

Description

A professional-grade AI trading orchestration system for Bitget Spot Market automation via Telegram.

This agent integrates Bitget REST APIs, authenticated order management, and real-time reasoning with GPT-4o-mini, allowing direct Telegram-based execution of spot and trigger orders β€” all within your self-hosted n8n environment.


πŸŽ₯ Watch Tutorial:

🧩 Required Workflows

You must install and activate all of the following workflows for the system to function correctly:

| βœ… Workflow Name | πŸ“Œ Function Description |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Bitget AI Trader Agent | Core orchestrator. Handles user Telegram commands, routes to correct sub-agents, and formats all responses. |
| Account and Wallet Agent Tool | Retrieves Bitget account info, balances, and deposit addresses using authenticated endpoints /api/v2/spot/account/*. |
| Spot Order Trading Agent Tool | Places, cancels, and queries spot orders (/trade/place-order, /cancel-order, /orderInfo, /unfilled-orders). |
| Trigger Order Agent Tool | Manages conditional β€œplan” (trigger) orders β€” place, modify, cancel, and list them (/trade/place-plan-order, /modify-plan-order, etc.). |
| Webhook HTTP Request Nodes | Securely handle REST calls for each sub-agent via n8n webhooks. All endpoints authenticated using the Bitget Sign system. |

βš™οΈ Installation Instructions

Step 1: Import Workflows

Open your n8n Editor UI
Import the Bitget AI Trader Agent (Finished).json file
Ensure all sub-agents are visible in the canvas and linked properly

Step 2: Set Credentials

Configure your Bitget API Key, Secret, and Passphrase inside your n8n credentials
Add your OpenAI API Key (recommended: GPT-4o-mini)
Set Telegram bot token (from @BotFather)

Step 3: Configure Webhook Endpoints

Make sure all downstream webhooks (e.g., Get-Account-Information, Place-Order, Cancel-Order, etc.) are accessible via HTTPS.
Each must use Basic Auth credentials named:
Bitget Authentication for Webhooks

Step 4: Authorize Telegram Access

Replace the placeholder Telegram ID in:

if ($input.first().json.message.from.id !== <<Replace>>) { ... }

with your Telegram user ID.
This ensures only you can issue trading commands.

Step 5: Test & Deploy

Trigger the Telegram bot command (e.g. /balance or /order) to verify:

Authenticated data fetch
Correct REST routing
Safe GPT-based reasoning
Telegram delivery with formatted markdown

πŸ’¬ Telegram Output Examples

βœ… BTCUSDT limit buy placed @ 23222.5, size 0.01 (orderId: 123456)

❌ Rejected: price tick invalid for BTCUSDT. Provide price with correct step.

πŸ’° Balance Summary:
β€’ USDT: 1250.34 (Available)
β€’ BTC: 0.023 (In Trade)

🧩 System Overview

[Telegram Trigger]
β†’ [User Authentication]
β†’ [Bitget AI Trader Agent]
β†’ [Account/Wallet Tool] + [Spot Order Tool] + [Trigger Order Tool]
β†’ [Webhook Execution Layer]
β†’ [GPT-4o-mini Reasoning + Message Split Logic]
β†’ [Telegram Output]

πŸ”’ Safety & Compliance

All API calls use Bitget Sign authentication
Orders cannot be spoofed or simulated
No keys or signatures ever exposed in chat
Strict input validation and confirmation per action

🧾 Licensing & Attribution

Β© 2025 Treasurium Capital Limited Company
All architecture, prompt structures, and Telegram formatting are IP-protected.
No unauthorized resale, repackaging, or rebranding permitted.

πŸ”— For support: LinkedIn – Don Jayamaha

Nodes Used (12)

AI Agent
@n8n/n8n-nodes-langchain.agent
AI Agent Tool
@n8n/n8n-nodes-langchain.agentTool
Calculator
@n8n/n8n-nodes-langchain.toolCalculator
Code
n8n-nodes-base.code
Crypto
n8n-nodes-base.crypto
Edit Image
n8n-nodes-base.editImage
HTTP Request
n8n-nodes-base.httpRequest
OpenAI
@n8n/n8n-nodes-langchain.openAi
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow
Telegram
n8n-nodes-base.telegram
Think Tool
@n8n/n8n-nodes-langchain.toolThink