██╗ ██╗███████╗███████╗ ██╗ ███╗ ██╗ ██████╗ ╚██╗ ██╔╝██╔════╝██╔════╝ ██╔╝ ████╗ ██║██╔═══██╗ ╚████╔╝ █████╗ ███████╗ ██╔╝ ██╔██╗ ██║██║ ██║ ╚██╔╝ ██╔══╝ ╚════██║ ██╔╝ ██║╚██╗██║██║ ██║ ██║ ███████╗███████║██╔╝ ██║ ╚████║╚██████╔╝ ╚═╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═════╝

Polymarket Quant Terminal for Prediction Market Traders

The most reliable way to research & trade prediction markets

Python 3.12+ 100+ API Functions 17 TUI Screens Local AI (Ollama) MIT License
OPEN SOURCE Fork it. Modify it. Make it yours. MIT Licensed.

Project Overview

105
MB Disk Space
~75
MB RAM Usage
100+
API Functions
6
API Integrations
17
TUI Screens
~18K
Lines of Code

Terminal Interface

YES/NO.EVENTS - python app.py
╔══════════════════════════════════════════════════════════════════════════════╗ YES/NO.EVENTS - Polymarket Quant Terminal ● CONNECTED ╚══════════════════════════════════════════════════════════════════════════════╝ 1 MARKETS 2 TRADING 3 PORTFOLIO Browse & Search Buy & Sell Positions & P&L > Trending markets > Place orders > Holdings > Search by keyword > Open orders > Trade history 4 ELON LAB 5 RESEARCH 6 ANALYTICS Tweet Analytics Market Discovery Quant Analysis > 2,198 tweets/31d > Top traders > Spread analysis > Hourly heatmap > Tag volume > Price momentum 9 EDGE SCANNER 0 AUTOMATION - QUANT AI-Powered Analysis Spike Detection Forecasting > Local LLM (llama3.2) > Volume spikes > Model ensemble > Edge detection > Auto-trading > Backtesting Press 1-9,0,- navigate | ? help | q quit

Features

1 Markets

Browse and search all Polymarket markets

  • Trending markets feed
  • Full-text search via Polyrouter
  • Orderbook visualization
  • Real-time price updates

2 Trading

Execute trades with full order management

  • Limit and market orders
  • Bracket orders (both sides)
  • Ladder orders (multiple levels)
  • Cancel orders (single/all)

3 Portfolio

Track positions and P&L

  • Open positions with cost basis
  • Realized/unrealized P&L
  • Trade history
  • Activity feed

4 Elon Lab

Twitter analytics for Elon markets

  • 31 days of tweet data (2,198 tweets)
  • Hourly activity heatmap
  • Day-of-week patterns
  • Peak activity detection

5 Research

Market discovery and analysis

  • Top traders leaderboard
  • Tag volume analytics
  • Market correlations
  • Trend detection

6 Analytics

Quantitative market analysis

  • Spread analysis (bid-ask)
  • Price momentum scanner
  • Volume leaders
  • Trading signals (AI-scored)

9 Edge Scanner + AI

Powered by Ollama llama3.2

AI-powered edge detection

  • Local LLM analysis (no API costs)
  • Edge assessment (HIGH/MED/LOW)
  • Direction signals (BUY YES/NO)
  • Risk factor analysis

0 Automation

Automated spike detection and trading

  • Volume spike detection
  • Liquidity spike detection
  • Dry-run mode for testing
  • Auto-trade on spikes

Elon Lab: Tweet Analytics

Pre-computed analytics from 31 days of Elon Musk's Twitter activity. No API calls needed.

Why Elon Tweets Matter

Elon Musk's tweeting patterns correlate with Polymarket activity on related markets. High tweet volume often precedes market movements. Track patterns to find edges.

Data Period

December 19, 2024 - January 18, 2025 (31 days)

  • 2,198 total tweets analyzed
  • 70.9 average tweets per day
  • 124 peak daily tweets (Jan 16)
  • 10-12 UTC peak activity hours
HOURLY ACTIVITY HEATMAP (UTC)
Mon
Tue
Wed
Thu
Fri
Sat
Sun
048121620

Green = Peak | Darker = More Activity

Architecture

+-----------------------------------------------------------------------------+
|                              YES/NO.EVENTS                                  |
+-----------------------------------------------------------------------------+
|  app.py (TUI)              |  dashboard4all.py (Web)  |  trading.py (API)  |
|  ~6,200 lines              |  ~8,500 lines            |  ~3,700 lines      |
|  17 Screens                |  Single-file server      |  100+ Functions    |
|  Textual framework         |  HTTP + HTML/CSS/JS      |  6 API integrations|
+-----------------------------------------------------------------------------+
                                       |
          +----------------------------+----------------------------+
          |                            |                            |
          v                            v                            v
   +--------------+           +--------------+           +--------------+
   |  Polymarket  |           |   Ollama     |           |   Local      |
   |    APIs      |           |  (llama3.2)  |           |   Cache      |
   |              |           |              |           |              |
   | - CLOB       |           | - Edge AI    |           | - Markets    |
   | - Gamma      |           | - Analysis   |           | - Prices     |
   | - Data       |           | - Signals    |           | - History    |
   | - Polyrouter |           |              |           |              |
   +--------------+           +--------------+           +--------------+
                

Methodology

All algorithms, calculations, and data sources are fully documented. No black boxes.

Price Calculations

YES/NO prices are complementary values between 0.00 and 1.00. Spread is ask minus bid.

YES_PRICE = value (0.00 - 1.00) NO_PRICE = 1.00 - YES_PRICE SPREAD = ASK - BID

Edge Calculation

Edge is the difference between your estimated probability and market probability.

Edge = Your_Prob - Market_Prob >5% edge = High confidence 3-5% edge = Medium confidence <3% edge = Low / noise

Kelly Criterion

Optimal bet sizing based on your edge and the odds. Use fractional Kelly (25%) for safety.

f* = (bp - q) / b b = odds - 1 p = your probability q = 1 - p

Correlation Coefficient

Pearson correlation (r) measures relationship between two market price movements.

r = SUM((x-x')(y-y')) / SQRT(SUM(x-x')^2 * SUM(y-y')^2) 0.7-1.0 = Strong positive -0.3-0.3 = Weak/None

Momentum Score

Detects overbought/oversold conditions by comparing price to neighbors and volume.

Momentum = (Price - Expected)*100 + (Vol_Ratio - 1)*5 Expected = (Prev + Next) / 2 Vol_Ratio = Vol / Avg_Vol

Tweet Projection

Monte Carlo simulation projects tweet counts using random walk with mean reversion.

Parameters: volatility: 0.15 mean_reversion: 0.05 simulations: 10,000

Not Financial Advice

This software is for educational and research purposes only. It is NOT investment advice, trading signals, or professional trading software. Trade at your own risk. Past performance does not guarantee future results.

50+ API Endpoints

Comprehensive access to all Polymarket data sources. Fully documented with examples.

15
CLOB API
12
Gamma API
10
Data API
2
Polyrouter
4
Ollama AI
12
Quant Tools

API Integrations

API Endpoint Functions Purpose
CLOB clob.polymarket.com 15 Trading, orderbook, prices, orders
Gamma gamma-api.polymarket.com 12 Markets, events, profiles, comments
Data data-api.polymarket.com 10 Positions, leaderboard, holders
Polyrouter api-v2.polyrouter.io 2 Fast search, trending markets
Ollama localhost:11434 4 Local AI edge detection (llama3.2)
Quant Local 12 Models, backtesting, forecasting

Two Interfaces, Same Power

TUI (Terminal)

Classic terminal interface with vim-like navigation. Perfect for power users and SSH sessions.

./yesno.sh

Web Dashboard

Browser-based interface with charts. Access from any device on your network.

./run.sh # localhost:8888

CLI Examples

Power user commands for market scanning, quant analysis, and tweet tracking

trade.sh - Market Operations
# Scan all Elon tweet markets ./trade.sh scan # Find EV opportunities ./trade.sh ev --edge 0.05 # Get orderbook depth ./trade.sh book 1148943 # Search markets ./trade.sh find "bitcoin" # View distribution ./trade.sh dist --event jan13_20
tracker.sh - Tweet Analytics
# View tweet calendar ./tracker.sh cal --days 7 # Full dashboard ./tracker.sh dash # Export data ./tracker.sh export --format json # Add tweet count ./tracker.sh add 2026-01-18 --hour 14 --count 5
quant.sh - Quantitative Models
# Monte Carlo projection ./quant.sh mc 450 72 --sims 50000 ==================================== MONTE CARLO TWEET PROJECTION ==================================== Current: 450 tweets in 72h Rate: 6.2 tweets/hour Remaining: 96 hours ------------------------------------ Projections (50,000 simulations): Mean: 1057 Median: 1052 80% CI: 881-1236 # Kelly Criterion ./quant.sh kelly 1148943 0.20 --bankroll 1000 Edge: +14.6% 25% Kelly: 0.8% Bet Size: $8.00
search.sh - Vector Search
# Search markets by description ./search.sh markets "high volume 500 tweets" # Search strategies ./search.sh strats "momentum entry" # Find similar brackets ./search.sh similar 1148943

Local AI Integration

Ollama + llama3.2

Edge detection powered by local LLM - no API costs, full privacy.

# Install Ollama brew install ollama # Start server ollama serve # Pull model ollama pull llama3.2 # API endpoint http://localhost:11434
  • Analyzes market data for trading edges
  • Provides direction signals (BUY YES/NO)
  • Confidence scoring (0-100%)
  • Risk factor identification
  • Usage tracking (tokens in/out)

Roadmap

What's live, what's coming soon, and what's planned

LIVE

17-Screen Terminal (TUI + Web)

Full terminal with Markets, Trading, Portfolio, Elon Lab, Research, Analytics, API Explorer, Settings, Edge Scanner, Automation

LIVE

Pre-computed Elon Analytics

31 days of tweet data with heatmaps, patterns, and daily charts. Instant loading, no API calls.

LIVE

Local AI Edge Detection

Ollama + llama3.2 integration for AI-powered analysis without API costs

LIVE

WebSocket Real-time Streaming

Live price updates, trade feed, and orderbook via rtds_client.py

Q1 2026

Automated Strategy Execution

Define entry/exit rules, auto-execute trades based on signals

PLANNED

Backtesting Framework

Complete price history for all markets. Test strategies on historical data.

Quick Installation

Terminal - Installation
# Clone the repository git clone https://github.com/your-repo/yesno-events.git cd yesno-events # Create virtual environment python3.12 -m venv .venv source .venv/bin/activate # Install dependencies pip install py-clob-client textual rich pyyaml numpy scikit-learn # Make scripts executable chmod +x *.sh # Run Terminal UI ./yesno.sh # Or run Web Dashboard ./run.sh # Open http://localhost:8888 in your browser # Optional: Enable AI Edge Detection brew install ollama ollama serve ollama pull llama3.2
View on GitHub Full Documentation

Project Files

File Lines Purpose
app.py ~6,200 TUI application (Textual framework)
trading.py ~3,700 API layer (100+ functions)
dashboard4all.py ~8,500 Web dashboard (single-file server)
quant.py ~800 Quantitative models
search.py ~400 TF-IDF vector search
rtds_client.py ~600 WebSocket real-time streaming