Async Telegram bot prototype that tracks user-declared PolyMarket positions using only public data.
- Install Python 3.11+ and dependencies:
pip install -r requirements.txt
python -m playwright install chromium # per lo scraping headless
- Set your bot token (BotFather):
export TELEGRAM_BOT_TOKEN=<your_token>
Oppure crea un file .env nella root del progetto:
TELEGRAM_BOT_TOKEN=<your_token>
# opzionale
TRADES_FILE=trades.json
- Run:
python -m app.main
Env overrides:
TRADES_FILE(defaulttrades.json): where trades are persisted locally.
Format:
/add_trade <id> <side> <entry_price> <quantity> <market_url>
Example:
/add_trade eth_yes YES 0.42 150 https://polymarket.com/market/...
Behavior:
- Validates args (id pattern, side YES/NO, numeric fields > 0, polymarket.com URL).
- Stores trades to a local JSON file (auto-loaded at startup; auto-saved on each change; starts empty if file is missing/invalid).
- Replies with confirmation when added or an error message on bad input.
- Lists all trades saved so far (from the JSON store).