Telegram control
status, PnL and the kill switch from a private chat.
With the operator's Telegram bot connected, each user can link their private chat and use it for notifications and for commands: status, PnL, bots, trades, positions, alerts, the kill switch and close-all, with confirmation codes for the dangerous ones.
01Create the bot (operator)
- Open BotFather, Telegram's official bot for creating bots, and send
/newbot. Choose a name and a username ending inbot. - Copy the token BotFather gives you.
- In the console, Integrations: paste it into Telegram bot token and save. Set your own chat id under Delivery and press Test to receive a test message.
Or set TELEGRAM_BOT_TOKEN in .env. The server reads updates by long polling, so no webhook or public port is needed for Telegram. One bot serves notifications, channel signals and control for every user.
Creating and running a Telegram bot is free.
02Link a chat (user)
Settings, Notification settings, Connect Telegram. Open the link on the phone and press Start in the bot chat. The link works once and for 10 minutes; a newer link cancels the older one. One chat controls one account: linking a chat to another account unlinks it from the first.
The bot answers only the user's own linked private chat. Any other chat gets no account data, and groups get nothing at all.
03Commands
| Command | What it does |
|---|---|
/help | The list of commands |
/status | Kill switch, running bots, open Smart Trades, total portfolio in USD from real balances (accounts that cannot be read are named, not counted) |
/pnl [today|week|month] | Realised PnL from the exchanges' fills since UTC midnight, Monday or the 1st (fees not deducted) |
/bots | Up to 20 bots with their status, with Pause and Resume buttons |
/trades | Open Smart Trades, with a Close button (market-close, cancels the rest) |
/positions | Open futures positions per account |
/alerts | Active and paused price alerts |
/kill | Confirm button, then the kill switch turns on |
/unkill | Confirm button, then a 6-digit code (or, with two-factor on, your authenticator code) typed back within 60 seconds, 3 tries; then the kill switch turns off |
/closeall | Confirm button and the same code check; then the kill switch turns on first, every live Smart Trade is closed and every futures position market-closed reduce-only, and a report follows. Use /unkill to trade again. |
04Why it is safe
- Buttons are signed for the user and the action, expire after 5 minutes and work once, even across a server restart. A forwarded button fails in any other chat.
- An authenticator code works once for Telegram actions.
- Each chat may send at most 30 commands and button presses a minute; the rest are dropped.
- Every action (not the read-only commands) is written to the user's audit log with source "telegram" and creates a notification in the app.
- A user the operator disabled can no longer control anything from Telegram.