APIs, Bots & Automation

How to Use the Open-Source Quote.Trade Telegram Trading Bot

Run the official Telegram bot in paper mode first. Keep each user’s API credentials encrypted and isolated, connect keys only in a private chat, and require confirmation before any AI-generated trade or trigger is submitted.

60 minutesAdvancedDevelopers and technical operators

What you will accomplish

  • Build and run the official bot
  • Protect Telegram and exchange credentials
  • Use paper mode and private-chat onboarding
  • Understand confirmation and local-trigger behavior

Before you begin

  • Node.js and npm
  • A Telegram bot token from BotFather
  • A server with encrypted storage and process monitoring
  • A Quote.Trade key only after paper-mode testing
Confirm paymentCurrency before real mode

The current CLI and Telegram repositories may default DEFAULT_PAYMENT_CURRENCY to USD, while the authenticated order reference treats paymentCurrency as a separate field and illustrates stablecoins such as USDT. Before enabling real mode, use the value accepted by the current account and order schema. Do not infer the funding asset from quoteAsset=USD.

Initial modePaper
CredentialsPer-user, encrypted, private chat
AI behaviorDraft and confirm; never direct submission
Chat scopePrivate chat only for account or trading workflows
Advanced triggersLocal bot behavior unless the venue documentation says otherwise
paymentCurrencyCheck the current live order fields before real mode
Step-by-step

Clone and review the official repository

Use the Quote.Trade GitHub organization. Review the README, sample configuration, dependency lockfile, and current security behavior before deployment.

Quote.Trade documentation link to the full open-source Telegram Bot project on GitHub
The official documentation links directly to the open-source Telegram Bot repository.
bash
git clone https://github.com/quoteTrade/quote-trade-telegram-trading-bot.git
cd quote-trade-telegram-trading-bot
cp sample.env .env
npm install
npm run build
npm test
Expected result

A successful build and test run exits without errors.

Configure endpoints and paper mode

Set the Telegram token through a secret manager. Use the official Quote.Trade production bases and MODE=paper. Generate a strong TELEGRAM_SESSION_ENCRYPTION_KEY and never commit .env.

dotenv
TELEGRAM_BOT_TOKEN=<secret-manager-value>
API_BASE_URL=https://app.quote.trade/api
LIQUIDITY_WS_URL=wss://app.quote.trade/ws/liquidity
LISTEN_KEY_WS_URL=wss://app.quote.trade/ws/listenKey
MODE=paper
TELEGRAM_SESSION_ENCRYPTION_KEY=<strong-random-secret>
DEFAULT_PAYMENT_CURRENCY=USDT
POSITIONS_ENDPOINT=/positions
Expected result

The bot starts in paper mode and can reach public Quote.Trade data. Replace USDT only when the current account and order schema accept another supported payment currency.

Connect credentials only in private chat

The repository documents per-user isolated credentials and a private /connectkey flow. Restrict the command to direct messages, delete sensitive messages when possible, encrypt stored values, and tell users to rotate any credential pasted in the wrong place.

text
/connectkey <api-key> <api-secret> [sha256|ed25519] [account]
Expected result

The session is stored under that user’s isolated state and is not returned to other users or group chats.

Test account, positions, and risk without live orders

Use read-only permissions first. Run the bot’s account, positions, and risk commands and compare the output with the Quote.Trade app. Confirm logs contain no secrets.

Expected result

The bot displays account and risk data while paper mode does not submit orders.

Treat AI output as a pending draft

The bot’s AI planner should translate natural language into a proposed command, validate it, and save it pending confirmation. The language model must never send the order directly. Show symbol, side, quantity, USD price, USD notional, account, payment currency, and leverage before confirmation.

Expected result

AI-generated trades remain drafts until the user confirms them.

Monitor the bot, streams, and local triggers

Like the CLI, local triggers require the process to remain running and connected. Add health checks, restart policy, alerting, backups for encrypted state, key rotation, and a kill switch before real mode.

Expected result

A stopped process or disconnected stream raises an alert and blocks unsafe actions.

Troubleshooting

Common problems and fixes

An API secret was posted in a group chat

Delete the message where possible and revoke and rotate the Quote.Trade key immediately. Never connect credentials in a group chat.

The bot restarts and loses trigger state

Restore the encrypted local state, reload current positions and orders, and verify every trigger before resuming real mode.

Telegram shows a successful message but exchange state differs

Use Quote.Trade account, order, and private-event data to confirm what actually happened.

Primary sources

Ready for the next step?

Open the Telegram bot repository

Open the Telegram bot repository