explaingit

sugusdaddy/phoenixchan-bot

0TypeScriptAudience · developerComplexity · 4/5ActiveLicenseSetup · hard

TLDR

A Telegram bot that lets users trade perpetual futures on the Solana-based Phoenix exchange through chat commands, with custodial wallets per user.

Mindmap

mindmap
  root((phoenixchan-bot))
    Inputs
      Telegram commands
      Phoenix invite code
      Solana RPC URL
    Outputs
      Filled orders
      Live notifications
      PnL and balance
    Use Cases
      Trade perps from Telegram
      Set price alerts
      Self-host a trading bot
    Tech Stack
      TypeScript
      grammY
      Phoenix Rise SDK
      Solana Kit
      better-sqlite3

Things people build with this

USE CASE 1

Self-host a Telegram bot that places perpetual futures orders on Phoenix

USE CASE 2

Send price and liquidation alerts to a private Telegram chat

USE CASE 3

Manage a custodial multi-user trading wallet with encrypted key storage

USE CASE 4

Deploy a Solana trading bot to Fly.io with persistent SQLite storage

Tech stack

TypeScriptgrammYSolanaSQLiteNode

Getting it running

Difficulty · hard Time to first run · 1h+

Needs a Phoenix beta invite, a private Solana RPC like Helius or Triton because public RPC will not work, plus BotFather token and a generated 32-byte master key.

MIT license, so you can use, modify, and redistribute the code freely as long as you keep the copyright notice.

In plain English

Phoenixchan Bot is a Telegram bot that lets users trade perpetual futures on a Solana-based exchange called Phoenix. Perpetual futures are a kind of crypto derivative that lets traders bet on a token going up or down with borrowed money. The bot wraps the whole trading workflow inside Telegram chat commands, so a user can place orders, check positions, and receive live alerts without leaving the messenger. The README notes that Phoenix itself is in private beta and needs an invite code. The command list is wide. You can open market or limit orders with commands like /long, /short, and /limit, including inline take-profit and stop-loss values on the same line. You can close part or all of a position with /close, cancel orders with /cancel, and check your balance, open orders, recent profit and loss, and current funding rates with separate commands. The bot also pushes live notifications when orders fill, when liquidation happens, when collateral drops sharply, and when new USDC deposits land in the wallet. Custom price alerts are available with a /alert command. The custody model is important to understand. The bot is custodial, which means it creates a fresh Solana wallet for each user when they type /start, holds the encrypted private key in its own database, and signs trades on the user's behalf. The README states the private key is encrypted with AES-GCM using a master key stored in an environment variable, that there is per-user rate limiting and a notional cap, and that users can export their private key via /exportkey to take full self-custody, with the message self-destructing after 90 seconds. The tech stack is TypeScript, the grammY framework for the Telegram side, the Phoenix Rise SDK for trading, the @solana/kit library for wallet operations, and better-sqlite3 for storage with write-ahead logging. The README explains how to self-host: clone the repo, copy the example env file, fill in tokens from BotFather and from Phoenix's Flight builder portal, generate a 32-byte master key, point it at a private Solana RPC such as Helius or Triton (public RPC will not work), then run npm install and npm start. A Fly.io deployment recipe with a 1 GB volume is included. The README describes the project as early beta, working end-to-end on Phoenix mainnet but not audited, and warns that trading perpetual futures carries liquidation risk. It is released under the MIT license.

Copy-paste prompts

Prompt 1
Walk me through self-hosting phoenixchan-bot including BotFather setup and the Phoenix Flight builder portal
Prompt 2
Generate a 32-byte master key for AES-GCM encryption and add it to my .env safely
Prompt 3
Explain how the /long, /short, and /limit commands handle inline take-profit and stop-loss arguments
Prompt 4
Deploy phoenixchan-bot to Fly.io with a 1 GB volume and a private Helius RPC endpoint
Prompt 5
Show me how the custodial wallet model works and how /exportkey lets a user move to self-custody
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.