PolyTutor Phase 1 #8 — clean-room educational project (v0.1.0)
Telegram-style PAPER/DEMO prediction-market learning lab:
deterministic demo markets → synthetic order book → paper orders / fills / positions / PnL → educational UX.
This is NOT live trading. There is no wallet, no private key, no CLOB authenticated client, and no live mode toggle.
An independent PolyTutor clean-room lab for teaching:
- How prediction-market order books look (best bid/ask/spread/depth)
- How paper market and limit orders behave under simple deterministic rules
- How portfolio cash, positions, and realized/unrealized PnL relate
- How fail-closed allowlist authorization gates privileged actions
- Not a fork or sanitized continuation of any rejected live-trading bot
- Not a Polymarket production client
- Not a profitability tool
- Not connected to blockchain wallets or authenticated exchange APIs
cd polymarket-telegram-trading-lab
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
export ALLOWED_DEMO_USER_IDS=1001,1002
export STARTING_PAPER_CASH=10000
python -m polytutor_telegramSingle command:
python -m polytutor_telegram -c "/markets"
python -m polytutor_telegram -c "/buy demo-btc-100k Yes 100" --user 1001| Command | Purpose |
|---|---|
/help |
Help |
/markets |
List synthetic markets |
/market <id> |
Market detail |
/book <id> <outcome> |
Demo order book |
/portfolio |
Paper cash, positions, PnL |
/orders |
Paper orders |
/history |
Paper journal |
/buy <id> <outcome> <amount> |
Paper market buy |
/sell <id> <outcome> <shares> |
Paper market sell |
/limit <id> <outcome> <BUY|SELL> <shares> <price> |
Paper limit |
/cancel <order_id> |
Cancel OPEN paper order |
Privileged commands (/buy, /sell, /limit, /cancel) require an allowlisted demo user id (fail-closed).
v0.1.0 uses a local Telegram-like command simulator (no bot token, offline). Real Telegram transport is intentionally absent in this release for safety.
See .env.example. Allowed keys:
STARTING_PAPER_CASHALLOWED_DEMO_USER_IDS
Never set PRIVATE_KEY, MNEMONIC, CLOB secrets, or ENCRYPTION_KEY — they are not supported and must not appear.
python -m compileall -q src tests scripts
ruff check src tests scripts
pytest -q
python scripts/security/check_secrets.py
python scripts/quality/check.py.github/workflows/quality.yml runs the local quality runner on pull requests. Security gates remain in .github/workflows/security.yml.
- DISCLAIMER.md
- SECURITY.md
- CLEAN_ROOM.md
- docs/architecture.md
- docs/paper-trading.md
- docs/authorization.md
MIT — see LICENSE.