16 Commits

Author SHA1 Message Date
John Doe d12c744741 fix: filter sentinel buckets in top_signals build loop 2026-04-18 21:50:37 +08:00
John Doe 418d56aafa fix: remove balance guard in bet_size and place_buy_order — execute on signal regardless of balance for full pipeline consistency 2026-04-18 20:44:55 +08:00
John Doe c0ff2b5d76 fix: skip sentinel buckets in skip-reason logging too 2026-04-18 20:40:28 +08:00
John Doe 562838da83 fix: skip sentinel buckets (t_high=999/t_low=-999) that inflate EV 2026-04-18 20:38:50 +08:00
John Doe b2d4ad4fbc fix: guard against invalid ECMWF temps (e.g. -999°C) in scan and top_signals 2026-04-18 20:36:26 +08:00
John Doe e4d7513561 fix: use raw eth_call for USDC balance (web3 7.x ABI bug) 2026-04-18 19:57:25 +08:00
John Doe 9c85a538de fix: resolve city_market_data undefined, p/Kelly order, best_signal None bugs 2026-04-18 19:55:25 +08:00
John Doe 69f57a9ff9 feat: detailed Telegram scan reports with open positions and EV signals 2026-04-18 19:28:46 +08:00
John Doe 1698f09ad0 Fix bucket_prob: bounded ranges now use proper Gaussian CDF (was returning 0 for all finite ranges) 2026-04-18 17:23:15 +08:00
John Doe cd976bc812 Add self-learning system, timeout wrappers, and fix Atlanta hang
- Self-learning: trade_log.json + model.json track winrate/PnL per city/bucket
- Adaptive Kelly: lowers fraction if winrate < 45% or PnL negative
- Adaptive EV floor: raises threshold when performance poor
- Timeout wrapper (_timeout_call): 10s limit on CLOB auth + order calls
- Timeout on get_condition_id: 8s limit per market
- Fix: DATA_DIR referenced before assignment (moved LEARNING_DIR to BOT_DIR)
- Add debug timing logs per city and per D+N fetch
- [LIVE] output format for successful orders
- Fix print flow: 'ok' + newline after each city regardless of signal
- record_trade() called on every successful order (outcome=pending)
2026-04-18 17:19:19 +08:00
John Doe f82721a9ef Revert proxy complexity: TUN mode handles all routing at OS level
- start_bot_v3.sh: unset ALL_PROXY/all_proxy so TUN VPN handles all traffic
- Revert _direct_session and _tg_session proxy config
- All requests now use standard requests module (goes through TUN)
- Keep Telegram notification functions (tg_signal, tg_scan_summary)
- Keep config.json with bot token and chat ID
2026-04-18 16:59:25 +08:00
John Doe c1d026d988 Fix proxy routing: use direct session for Polymarket/Open-Meteo, SOCKS only for Telegram
- Remove duplicate import requests
- Add _direct_session (trust_env=False) for gamma-api.polymarket.com and open-meteo.com
- Replace all requests.get/post calls with _direct_session
- _tg_session still uses SOCKS5h proxy for Telegram API
- Closes gamma-api timeout issue caused by ALL_PROXY routing it through SOCKS
2026-04-18 16:56:08 +08:00
John Doe f19655cb08 Add Telegram notifications for trade signals and scan summaries
- Add requests + logging imports
- Add TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID to config
- Add send_telegram(), tg_signal(), tg_scan_summary() functions
- Configure SOCKS5h proxy (socks5h://127.0.0.1:6922) for Telegram API
- Send tg_signal() on order filled/failed in scan_and_trade()
- Send tg_scan_summary() after each scan cycle
- Update config.json with bot token and chat ID
2026-04-18 16:53:02 +08:00
John Doe 3722cf2ffd ii 2026-04-18 15:27:39 +08:00
alteregoeth-ai 7e48a5d499 Delete bot_v3.py 2026-03-10 13:40:29 -05:00
alteregoeth-ai 60cfeaa81c Rename bot_v3 (1).py to bot_v3.py 2026-03-09 02:25:39 -05:00