mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-04-17 19:22:09 +00:00
Paper trading system with 5 commands (trade_topup, trade_buy, trade_sell, trade_convert, trade_stats). Supports VN stocks via TCBS, crypto via CoinGecko, forex via ER-API, and gold via PAX Gold proxy. Per-user portfolio stored in KV with 60s price caching. 54 new tests.
1.5 KiB
1.5 KiB
phase, title, status, priority, effort, depends_on
| phase | title | status | priority | effort | depends_on | |
|---|---|---|---|---|---|---|
| 5 | Integration Wiring | Pending | P2 | 15m |
|
Phase 5: Integration Wiring
Overview
Two one-line edits to register the trading module in the bot framework.
File changes
src/modules/index.js
Add one line to moduleRegistry:
export const moduleRegistry = {
util: () => import("./util/index.js"),
wordle: () => import("./wordle/index.js"),
loldle: () => import("./loldle/index.js"),
misc: () => import("./misc/index.js"),
trading: () => import("./trading/index.js"), // <-- add
};
wrangler.toml
Append trading to MODULES var:
[vars]
MODULES = "util,wordle,loldle,misc,trading"
.env.deploy (manual — not committed)
User must also add trading to MODULES in .env.deploy for the register script to pick up public commands.
Implementation steps
- Edit
src/modules/index.js— addtradingentry - Edit
wrangler.toml— append,tradingto MODULES - Run
npm run lintto verify - Run
npm testto verify existing tests still pass (trading tests in Phase 6)
Verification
npm test— all 56 existing tests passnpm run lint— no errorsnpm run register:dry— trading commands appear in output
Rollback
Remove trading from both files. Existing KV data becomes inert (never read).
Success criteria
src/modules/index.jshas trading entrywrangler.tomlMODULES includes trading- Existing tests pass unchanged
- Lint passes