n8nflow.net logo

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

by Don Jayamaha Jrβ€’Updated: Last update 8 days agoβ€’Source: n8n.io
Loading workflow viewer...

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:
Click to Watch


🧩 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 AgentCore orchestrator. Handles user Telegram commands, routes to correct sub-agents, and formats all responses.
Account and Wallet Agent ToolRetrieves Bitget account info, balances, and deposit addresses using authenticated endpoints /api/v2/spot/account/*.
Spot Order Trading Agent ToolPlaces, cancels, and queries spot orders (/trade/place-order, /cancel-order, /orderInfo, /unfilled-orders).
Trigger Order Agent ToolManages conditional β€œplan” (trigger) orders β€” place, modify, cancel, and list them (/trade/place-plan-order, /modify-plan-order, etc.).
Webhook HTTP Request NodesSecurely 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