feat: add fake trading module with crypto, stocks, forex and gold

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.
This commit is contained in:
2026-04-14 15:16:53 +07:00
parent e752548733
commit c9270764f2
20 changed files with 1841 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ compatibility_date = "2025-10-01"
# Enabled modules at runtime. Comma-separated. Must match static-map keys in src/modules/index.js.
# Also duplicate this value into .env.deploy so scripts/register.js derives the same public command list.
[vars]
MODULES = "util,wordle,loldle,misc"
MODULES = "util,wordle,loldle,misc,trading"
# KV namespace holding all module state. Each module auto-prefixes its keys via createStore().
# Create with: