Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
RL agent fusing real-time Binance futures data into Polymarket prediction markets. On-device training with MLX on Apple Silicon.
| Date | Stars |
|---|---|
| 2026-07-31 | 384 |
| 2026-08-06 | 384 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Cross-Market State Fusion RL agents that exploit information lag between fast markets (Binance futures) and slow markets (Polymarket prediction markets) through real-time multi-source state fusion. **[View the presentation (PDF)](cross-market-state-fusion.pdf)** | **[LACUNA visual writeup](https://humanplane.com/lacuna)** ## What This Is A PPO (Proximal Policy Optimization) agent that paper trades Polymarket's 15-minute binary crypto markets. The agent observes live data from Binance futures and Polymarket's orderbook, then learns to predict short-term price direction. **Current status**: Paper trading only. The agent trains and makes decisions on live market data, but doesn't execute real orders. ### Setup - **Markets**: 4 concurrent 15-min binary crypto markets (BTC, ETH, SOL, XRP) on Polymarket - **Position size**: $5–$500 per trade (configurable via `--size`) - **Max exposure**: Position size × 4 markets - **Data sources**: Binance futures (order flow, returns) + Polymarket CLOB (orderbook) - **Training**: Online PPO with MLX on Apple Silicon, learns from live market data - **Reward**: Share-based PnL on position close (sparse signal) ## What This Proves 1. **RL can learn from sparse PnL signals** - The agent only gets reward when positions close. No intermediate feedback during the 15-minute window. Despite this sparsity, it learns profitable patterns (~$50K PnL, 2,500% ROI in Phase 5 with temporal architecture). 2. **Multi-source data fusion works** - Combining Binance futures order flow and Polymarket orderbook state into a single 18-dim observation gives the agent useful signal. 3. **Low win rate can be profitable** - The agent wins only 23% of trades but profits because binary markets have asymmetric payoffs. Buy at 0.40, win pays 0.60; lose costs 0.40. 4. **On-device training is viable** - MLX on Apple Silicon handles real-time PPO updates during live market hours without cloud GPU costs. 5. **Temporal context helps** - Processing the last 5 market states through a TemporalEncoder improves decision quality by capturing momentum and trend patterns. **Important caveat**: Training uses share-based PnL, not actual binary outcomes. See Phase 4 below for why this matters. ## What This Doesn't Prove 1. **Live profitability** - Paper trading assumes instant fills at mid-price. Real trading faces latency, slippage, and market impact. Expect 20-50% performance degradation. 2. **Statistical significance** - A single session isn't enough to confirm edge. Could be variance. Needs weeks of out-of-sample testing. 3. **Scalability** - $500 positions already show some market impact. At larger sizes the agent's orders would move prices and consume liquidity faster than it can trade. 4. **Persistence of edge** - Markets adapt. If this strategy worked, others would copy it and arbitrage it away. ## Path to Live Trading To move from paper to real: 1. **Execution layer** - Integrate Polymarket CLOB API for order placement 2. **Slippage modeling** - Simulate walking the book at realistic sizes 3. **Latency compensation** - Account for 50-200ms round-trip to Polymarket 4. **Risk management** - Position limits, drawdown stops, exposure caps 5. **Extended validation** - Weeks of paper trading across market regimes See [TRAINING_JOURNAL.md](TRAINING_JOURNAL.md) for detailed training analysis. --- ## Training Evolution The agent evolved through 5 phases, each fixing problems discovered in the previous: | Phase | What Changed | Size | PnL | ROI | |-------|--------------|------|-----|-----| | 1 | Shaped rewards (failed - entropy collapsed) | $5 | $3.90 | - | | 2 | Sparse PnL only, simplified actions (7→3) | $5 | $10.93 | 55% | | 3 | Scaled up 10x | $50 | $23.10 | 12% | | 4 | Share-based PnL (matches actual market economics) | $500 | $3,392 | 170% | | 5 | Temporal architecture + feature normalization | $500 | ~$50K | 2,500% | **Key insight**: Phase 4's switch from `pnl = (exit - entry) × dollars` to `pnl = (exit - entr
Excerpt of 8,281 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:a876a9c8b5ff1831, llm:Description: 'RL agent fusing real-time Binance futures data into Polymarket prediction markets. On-device training with MLX on Apple Silicon.' Language: Python
matched fp:a876a9c8b5ff1831, llm:Description: 'RL agent fusing real-time Binance futures data into Polymarket prediction markets. On-device training with MLX on Apple Silicon.' Language: Python
matched fp:a876a9c8b5ff1831, llm:Description: 'RL agent fusing real-time Binance futures data into Polymarket prediction markets. On-device training with MLX on Apple Silicon.' Language: Python
matched fp:a876a9c8b5ff1831, llm:Description: 'RL agent fusing real-time Binance futures data into Polymarket prediction markets. On-device training with MLX on Apple Silicon.' Language: Python