QuickPredict is a Telegram bot that serves as a mobile-first trading interface for DeepBook Predict — the institutional-grade on-chain binary options protocol on Sui.
Users can discover markets, calculate option metrics (implied probability, premium, net payouts), and execute real-time on-chain trades directly within Telegram — all while maintaining full non-custodial ownership of their funds through a secure, locally-encrypted wallet architecture.
DeepBook Predict is technically superior to competing prediction markets — sub-400ms settlement, institutional SVI pricing, composability with Margin and Spot. Yet it has zero consumer-facing distribution. The friction between “I think BTC is going up” and “I have a live on-chain position” requires a Sui wallet, testnet tokens, and browser. This gates out most potential users.
QuickPredict closes both gaps — bringing prediction markets to Telegram where the audience already exists, while keeping funds non-custodial and trades on-chain.
/wallet create <password>. Keypairs are encrypted with
AES-256-GCM, derived via PBKDF2 (310,000 iterations + unique salt), stored in
SQLite. Password prompts use Telegram ForceReply and are deleted instantly.src/ai/ — DeepSeek AI context client integrationsrc/common/ — shared config, context, i18n, error handlingsrc/db/ — Drizzle/SQLite database schema and migrationssrc/helpers/ — logger and helper utilitiessrc/keeper/ — polling settlement keepersrc/middlewares/ — session and logging middlewaresrc/modules/ — Telegram bot commands, callbacks, dialogssrc/predict/ — DeepBook Predict client APIs and risk queriessrc/sui/ — cryptography, PBKDF2/AES wallet routines, PTB builderssrc/bootstrap.ts — bot and middleware registrationsrc/index.ts — app startup entry pointdocs/prd.md — Product Requirements DocumentThe app is a single long-running process (Telegram long-polling + 20s settlement keeper) with a local SQLite file holding encrypted wallet keys.
>=1.0cp .env.example .env
bun install
bunx drizzle-kit push
bun run dev
The bot starts polling for Telegram messages via long-polling (no public HTTP needed).
Useful commands:
bun run dev # start with live reload
bun run start # production build
bun run typecheck # TypeScript type checking
bun run db:generate # generate Drizzle migrations
bun run db:migrate # run database migrations
| Variable | Description | Required |
|---|---|---|
BOT_TOKEN |
Telegram Bot API token | Yes |
SUI_RPC_URL |
Sui RPC node URL (default: testnet) | No |
PREDICT_SERVER_URL |
Predict API server URL | No |
SPONSOR_PRIVATE_KEY |
Faucet treasury private key (testnet) | Yes |
DEEPSEEK_API_KEY |
DeepSeek API key for market context | No |
DEEPSEEK_MODEL |
DeepSeek model (default: deepseek-v4-flash) |
No |
bun test src/sui/wallets.test.ts # verify cryptographic routines
bun run typecheck # TypeScript validation
/wallet create mypassword — create secure wallet, receive faucet credits/wallet balance — verify 0.1 SUI + 1,000 dUSDC credited/markets — browse active prediction markets/up BTC 85000 10 100 — submit a tradeQuickPredict is designed for a single instance with a persistent volume (one Telegram poller per token, one SQLite writer). Serverless platforms do not fit this architecture.
See DEPLOY.md for full deployment documentation.
fly launch --no-deploy --copy-config --name <your-app-name>
fly volumes create data --size 1 --region fra
fly secrets set BOT_TOKEN=...
fly deploy --remote-only
git clone <repo> && cd QuickPredict
cp .env.example .env # fill: BOT_TOKEN, LITESTREAM_* (bucket + creds)
docker compose up -d --build
Backups use Litestream as a sidecar, streaming SQLite changes to S3/B2/R2.
| Workflow | Trigger | What it does |
|---|---|---|
ci.yml |
every PR | typecheck + Docker image build |
deploy.yml |
push to main |
typecheck → push image to GHCR → deploy to Fly |
BOT_TOKEN set as a secret (never in repo/image)DB_PATH=/data/quick-predict.dbSUI_GRPC_URL) — public nodes are rate-limitedNETWORK=testnet until DeepBook Predict ships mainnet IDsMIT