Automated Telegram → Bybit signal-copying and trade-management bot.
- Requirements (source of truth):
docs/ - Architecture & approved assumptions:
ARCHITECTURE.md
npm install
cp .env.example .env # fill in Bybit + Telegram credentials
npx tsx src/presentation/generateTelegramSession.ts # one-time MTProto loginBusiness constants (leverage rules, thresholds, SL ladder, poll interval) live in
config/trading.config.json — no magic numbers in code.
| Command | Purpose |
|---|---|
npm run dev |
Run the bot from source |
npm run build / npm start |
Compile and run |
npm test |
Unit + integration tests (vitest) |
npm run lint |
ESLint |
npm run typecheck |
TypeScript strict check |
- Bybit is the single source of truth — every state transition is confirmed against live Bybit data before the bot accepts it; on mismatch the trade halts with an error notification until Bybit state is re-verified.
- No order without full validation — signal format, leverage, margin, TP/SL geometry, duplicates, and the docs/17 blocking rules all run first.
- Crash-safe — trades are event-sourced into SQLite; on restart the bot rehydrates and reconciles everything against Bybit (trailing stops never loosen).
BYBIT_TESTNET=trueuntil go-live is explicitly approved.
- Provide 3–5 REAL signal messages from the monitored groups and tune the parser fixtures (assumption Q1 — patterns are currently the assumed format).
- Re-confirm the re-entry trigger mechanics (assumption Q5) and the leverage formula (Q8) against real expectations.
- Fill
.envwith real credentials; run the session generator; verify the account supports hedge mode on linear USDT perpetuals. - Supervised testnet run: watch one full trade lifecycle (open → TP → SL move → trailing → close → summary) in your Telegram channel.
- Native Swedish read-through of
templates.sv.tsif SV notifications are used. - Only then flip
BYBIT_TESTNET=false.