Trade Crypto via Telegram Bot

OpenAItelegram_bot_apiGoogle MailNotion

Automate crypto spot trading on Bitget through a Telegram bot. Execute trades, check balances, and get real-time notifications via Telegram, email, and Notion.

Crypto TradingTelegram BotBitget APITrade Notifications

What This Workflow Does

This workflow template enables automated cryptocurrency spot trading on Bitget using an AI-powered assistant accessible through Telegram. It processes user commands securely, interacts with the Bitget API for account management and trade execution, and sends notifications through Telegram, email, and Notion.

It handles five core tasks:

  1. Listens for incoming Telegram webhook messages from the user.
  2. Parses message content and authenticates the sender by Telegram user ID.
  3. Configures Bitget API credentials and trading parameters.
  4. Invokes an AI trading agent that interprets commands and interacts with Bitget's spot trading functions.
  5. Sends trade updates and account info via Telegram, email, and Notion.

What You Need

  • A Telegram bot with a webhook URL configured
  • Bitget API key, secret key, and API passphrase with appropriate permissions
  • A Needle platform account to run the workflow
  • Your Telegram user ID whitelisted for authentication
  • Optional: Email and Notion connectors configured for receiving notifications

How the Flow Works

StepNodeDescription
1Webhook TriggerReceives incoming Telegram updates as webhook events.
2Telegram Message Parser & AuthParses the Telegram message, extracts sender details, and authenticates the user by Telegram ID.
3Bitget API ConfigurationPrepares Bitget API keys, passphrase, and base URL along with user and message context.
4Trading Context BuilderAdds trading parameters like supported pairs, order types, and size limits to the trading context.
5AI Trader AgentUses an AI model to interpret user commands, execute trading operations, query account info, and compose responses.
6Response ParserExtracts structured trade data from the AI response and splits long messages into Telegram-friendly chunks.
7aTelegram ReplySends the response back to the user's Telegram chat.
7bGmail NotificationSends an HTML email summarizing the trade or query.
7cNotion Trading LogCreates a new page in a Notion database as a trading journal entry.

Supported Trading Features

  • Account & Wallet Management — Check balances, assets, deposit addresses, and transfer records.
  • Spot Order Trading — Place market or limit buy/sell orders, check order status, and cancel orders.
  • Trigger/Plan Orders — Set stop-loss and take-profit orders with configurable trigger types.
  • Market Data — Get ticker prices, orderbook depth, candlestick data, and recent trades.
  • Web Research — Search the internet for crypto market news and analysis.

Supported Trading Pairs

BTCUSDT, ETHUSDT, SOLUSDT, XRPUSDT, DOGEUSDT, ADAUSDT, AVAXUSDT, DOTUSDT, LINKUSDT, MATICUSDT

You can customize this list in the Trading Context Builder node.

Required Variables

VariableDescription
BITGET_API_KEYYour Bitget API key
BITGET_SECRET_KEYYour Bitget secret key (store as a secret variable)
BG_PASSPHRASEYour Bitget API passphrase (store as a secret variable)
BITGET_BASE_URLBitget API base URL (default: https://api.bitget.com)
AUTHORIZED_TELEGRAM_IDYour Telegram user ID for authentication
TELEGRAM_CHAT_IDThe Telegram chat ID where replies are sent
NOTIFICATION_EMAILEmail address for trade notification emails
NOTION_TRADING_DB_IDNotion database ID for the trading log

Built-in Risk Management

The AI agent follows these safety rules when executing trades:

  • Always checks the current ticker price before placing any order.
  • Always checks available balance before placing orders.
  • Warns and requires confirmation if an order exceeds $500 USD equivalent.
  • Limits a single order to 50% of available balance.
  • Caps "all in" requests at 90% of balance with a warning.
  • Verifies limit order prices are within 5% of market price unless explicitly overridden.

Output

At the end of the workflow, you receive real-time responses and trade execution results directly in your Telegram chat. Email and Notion notifications provide a persistent record of trading activity, orders, and account balances without any manual effort.

Notes

  • Store your Bitget API credentials as secret variables for security.
  • The bot only responds to the authorized Telegram user ID — all other users are rejected.
  • Test the workflow with the provided dummy inputs before connecting real API keys.
  • Adjust supported pairs and order parameters in the Trading Context Builder to match your trading preferences.
  • Familiarity with Bitget's official API documentation and Telegram bot setup will help you customize and troubleshoot this workflow.

Want to showcase your own workflows?

Become a Needle workflow partner and turn your expertise into recurring revenue.

Try Needle today

Streamline AI productivity at your company today

Join thousands of people who have transformed their workflows.

Agentic workflowsAutomations, meet AI agents
AI SearchAll your data, searchable
Chat widgetsDrop-in widget for your website
Developer APIMake your app talk to Needle
    Needle LogoNeedle
    Like many websites, we use cookies to enhance your experience, analyze site traffic and deliver personalized content while you are here. By clicking "Accept", you are giving us your consent to use cookies in this way. Read our more on our cookie policy .