A Hex-native "prediction markets newspaper" that feels like BBC/Yahoo. MarketPress transforms live Kalshi market data into a scannable front page with raw-fact headlines, interactive filters, and an AI "Editor Desk" powered by Hex Threads.
Visit the MarketPress Landing Page
This is the judge-friendly landing page. The Hex project link is inside.
📸 Screenshot Placeholder: See assets/frontpage_placeholder.md for what will be captured
Shows: Lead Story, Top Stories, Category Sections (Politics/Business/Tech/Culture/Sports), Developing, and Most Read
📸 Screenshot Placeholder: See assets/drilldown_placeholder.md for what will be captured
Shows: Detailed fact box with market statistics, 7-day timeline, and all computed signals
📸 Screenshot Placeholder: See assets/editor_desk_placeholder.md for what will be captured
Shows: AI-powered Q&A using Hex Threads with semantic model integration
For now, see the live demo at the public Hex link below.
Want to see it in action? Two options:
- Open the public Hex project: MarketPress - Prediction Markets Newspaper
- Click "Run All"
- Explore the interactive front page with live prediction market data
- Try the AI Editor Desk in Threads
- Follow the HEX_GUIDE.md step-by-step instructions
- Paste 8 cells from
hex_cells/folder - Click "Run All"
- Total time: 5-10 minutes
A judge-proof, BBC-style prediction markets front page with:
- Lead Story - The most newsworthy market right now
- Top Stories - Highest-ranked markets across all categories
- Section Pages - Politics, Business, Tech, Culture, Sports
- Developing - High-volatility markets with accelerating attention
- Most Read - Highest-attention markets (volume/OI proxy)
Each headline includes:
- Implied probability
- Δ24h / Δ7d movement
- Volume / attention proxy
- Spread / confidence proxy
- Last updated timestamp
Plus:
- Filters - Category, time window, min liquidity
- Drill-down - Click headline → timeline + fact box
- AI Editor Desk - Hex Threads integration for natural language queries
MarketPress presents what the crowd believes, not what pundits think. Every headline is a prediction market with:
- Real money on the line
- Transparent probability
- Trackable changes over time
No commentary. No hot takes. Just the wisdom (or madness) of crowds.
MarketPress transforms raw prediction market data into a scannable newspaper through computed signals:
A composite metric that ranks markets by editorial importance:
- Delta 24h (30%): Recent probability changes signal breaking developments
- Volatility (25%): Standard deviation of prices indicates uncertainty and debate
- Attention (25%): Combined volume and open interest shows crowd engagement
- Confidence (20%): Inverse of spread reflects market conviction
Markets with the highest newsworthiness become "Lead Story" and "Top Stories."
How certain the market is about the outcome:
- Tight spread (< 2%): High confidence—market makers agree on the price
- Normal spread (2-5%): Moderate confidence—typical market conditions
- Wide spread (> 5%): Low confidence—disagreement or low liquidity
Confidence helps distinguish "serious desk" high-conviction markets from speculative noise.
A proxy for "most read" (engagement and trading activity):
- Volume: Total contracts traded (direct activity measure)
- Open Interest: Outstanding positions (sustained interest)
- Composite: Weighted combination reflecting total market engagement
High attention markets are the "most watched" stories.
Price instability over rolling windows:
- 7-day standard deviation: How much the probability bounces around
- Developing stories: Markets with both high volatility AND accelerating attention
- Stable markets: Low volatility signals consensus
Volatile markets with rising attention surface as "Developing" stories.
- Lead Story - Single most newsworthy market
- Top Stories - Top 5 across all categories
- Category Sections - Politics, Business, Tech, Culture, Sports
- Developing - High volatility + accelerating attention
- Most Read - Highest attention scores
- Fetches real-time market data from Kalshi's public API
- Enriches data with orderbook and trade information
- Automatic rate limiting and error handling
Three core tables:
- Markets: Core market information (ticker, title, category, status, prices)
- Snapshots: Time-series price and volume data for trend analysis
- Liquidity/Spread: Orderbook depth, spreads, and confidence metrics
Computes key trading signals:
- Probability Changes: Δ24h and Δ7d price movements
- Volatility: Standard deviation of prices over time windows
- Attention: Volume and open interest-based engagement scores
- Confidence: Spread-based market confidence metrics
- Newsworthiness: Composite score ranking market importance
Organized sections like a real newspaper:
- Top Stories: Highest newsworthiness across all categories
- Politics: Elections, government, policy markets
- Business: Economics, finance, trade markets
- Tech: Technology, AI, innovation markets
- Culture: Entertainment, arts, cultural events
- Sports: Sports betting and competition markets
- Developing: High-volatility markets with recent changes
- ASCII/Unicode sparklines for 24h price trends
- SVG sparklines for richer visualizations
- Trend arrows (↑/↓/→) and color coding
Intelligent summarization and Q&A:
- Generates executive summaries of the front page
- Identifies biggest movers and most-watched markets
- Answers natural language queries about market data
- Semantic model for deep market understanding
All sections include "Updated: [time]" timestamps for freshness
# Clone the repository
git clone https://github.com/wildhash/marketpress.git
cd marketpress
# Install dependencies
pip install -r requirements.txtfrom marketpress import create_marketpress_app
# Initialize and fetch data
app = create_marketpress_app(limit=100)
# Display the front page
print(app.generate_front_page())
# Get AI editor summary
print(app.get_editor_summary())
# Ask questions
print(app.ask_editor("What's the biggest mover today?"))
# Access specific sections
politics_df = app.get_section_dataframe('Politics')
print(politics_df.head())The Hex-first approach: See HEX_GUIDE.md for complete instructions.
Quick summary:
- Create a new Hex notebook
- Create 8 Python cells, paste code from
hex_cells/folder in order:01_setup.py- Config and constants02_fetch_kalshi.py- Data fetching03_normalize.py- Table normalization04_signals.py- Signal computation05_sections.py- Section organization06_frontpage.py- Front page layout07_drilldown.py- Drill-down details08_editor.py- Editor Desk functions
- Run All
- Arrange in grid layout
The AI Editor Desk is powered by Hex Threads with a semantic model (semantic_model.yaml).
Once your Hex project is running, open the Threads panel and try these starter prompts:
- "Write today's front page in 8 headlines" - Get a concise executive summary of top markets
- "What's the biggest belief shift since yesterday?" - Find markets with the largest 24h probability changes
- "Show me the fun desk: weird movers with real liquidity" - Discover unusual markets with actual trading activity
- "Which categories are most unstable right now?" - Identify which sections (Politics/Business/Tech/etc.) have highest volatility
These prompts work reliably because they align with the computed signals and section organization in the data model.
Available Functions:
summarize_front_page() # Executive summary
biggest_belief_shifts() # Top movers
most_unstable_markets() # High volatility
fun_desk() # Weird movers with liquidity
serious_desk() # High-stakes markets
answer_query(question) # Natural language Q&A✅ Core Features (Production Ready)
- Kalshi public API ingestion with pagination
- Three normalized tables (markets, snapshots, liquidity)
- Signal computation (Δ24h, Δ7d, volatility, attention, confidence, newsworthiness)
- Newspaper-style section organization
- Front page layout with Lead Story, Top Stories, and 5 category sections
- Developing stories (high volatility detection)
- Most Read proxy (attention scoring)
- Drill-down fact boxes with full market details
- AI Editor Desk with Hex Threads integration
- Semantic model for natural language queries
- Demo mode for testing without API
- Hex-first packaging (8 cells, paste and run)
✅ Hex Integration
- Cell-by-cell code organization (
hex_cells/folder) - Complete deployment guide
- Thread-ready semantic model
- Interactive filters and displays
🚧 Planned Enhancements
- Multi-source enrichment: News headlines, Twitter sentiment, Google Trends correlation
- Alerting system: Email/Slack notifications for significant market moves
- Premium x402 paywall integration: Monetization layer for advanced features
- Persistent historical storage: Database backend for long-term trend analysis
- Advanced volatility models: GARCH, realized volatility, implied volatility
- Multi-exchange support: Polymarket, PredictIt, Manifold Markets
- User-customizable sections: Create your own market categories
- Real-time WebSocket updates: Live price ticking without refresh
- Mobile-optimized layout: Responsive design for phones/tablets
MarketPress is designed for Hex Projects, not traditional applications. The architecture reflects this:
User Opens Hex Project → Runs 8 Cells → Interactive Front Page
Cell 1: Setup → Configuration, constants, category mappings
Cell 2: Fetch → Kalshi API or demo data
Cell 3: Normalize → Markets, snapshots, liquidity tables
Cell 4: Signals → Δ24h, Δ7d, volatility, attention, confidence, newsworthiness
Cell 5: Sections → Organize into Lead, Top, Politics, Business, Tech, Culture, Sports, Developing, Most Read
Cell 6: Front Page → Display-ready dataframes with formatting
Cell 7: Drill-Down → Fact boxes and timeline data
Cell 8: Editor Desk → Threads functions for Q&A
Kalshi API → Raw Markets → Normalized Tables → Signal Computation
↓
Section Organization
↓
┌──────────────────────┐
│ Front Page Layout │
├──────────────────────┤
│ - Lead Story │
│ - Top Stories │
│ - Category Sections │
│ - Developing │
│ - Most Read │
│ - Editor Desk │
└──────────────────────┘
↓
Hex Display + Threads
For standalone Python usage, the codebase includes:
MarketPress
├── hex_cells/ # Hex-first cell code (8 files)
├── kalshi_api.py # Kalshi API client
├── data_normalization.py # Data table schemas
├── signals.py # Signal computation
├── visualization.py # Sparklines and formatting
├── layout.py # Section organization
├── editor.py # AI Editor with semantic model
├── marketpress.py # Main application orchestrator
├── demo_data.py # Demo data generator
├── hex_app.py # Legacy Hex template
└── semantic_model.yaml # Threads semantic model spec
Main application class that coordinates all components.
Methods:
fetch_data(limit): Fetch fresh data from Kalshicompute_signals(): Calculate all trading signalsorganize_sections(): Organize markets into sectionsgenerate_front_page(): Create formatted front page textget_section_dataframe(section_name): Get specific section dataget_editor_summary(): Get AI editor's summaryask_editor(query): Ask editor a questionrefresh(limit): Complete refresh cycle
Client for Kalshi's public API.
Methods:
get_markets(limit, status): Fetch marketsget_orderbook(ticker): Get orderbook for a marketget_trades(ticker, limit): Get recent tradesget_events(limit, status): Get events
AI-powered editor for summarization and Q&A.
Methods:
summarize_front_page(): Generate executive summaryanswer_query(query): Answer questions about markets
No configuration required! The app uses Kalshi's public API endpoints by default.
Optional customization:
# Adjust fetch limits
app.fetch_data(limit=200)
# Adjust top stories count
from signals import rank_top_stories
top_stories = rank_top_stories(markets_df, n=20)
# Customize section categories
from layout import CATEGORY_MAPPINGS
CATEGORY_MAPPINGS['YourSection'] = ['keyword1', 'keyword2']app = create_marketpress_app(limit=100)
top_stories = app.get_section_dataframe('Top Stories')
print(top_stories[['title', 'yes_price', 'delta_24h']].head(10))market = app.get_market_details('TICKER-SYMBOL')
sparkline = app.get_market_sparkline('TICKER-SYMBOL')
print(f"{market['title']}: {sparkline}")developing = app.get_section_dataframe('Developing')
print(developing[['title', 'volatility', 'attention_score']])Recommended Method: Use the hex_cells/ folder approach documented in HEX_GUIDE.md.
Quick summary:
- Create Hex Project: New Python notebook
- Create 8 Python Cells: Paste code from
hex_cells/01_setup.pythroughhex_cells/08_editor.py - Run All: Click "Run All" to execute all cells
- Grid Layout: Arrange outputs in newspaper-style columns
- Schedule: Set auto-refresh (e.g., every 15 minutes)
- Publish: Share with team or make public
hex_app.py file is a legacy single-file template from earlier development. It is kept for historical reference only.
Use the hex_cells/ method above instead (Option A or B in HEX_GUIDE.md).
┌─────────────────┬─────────────────┐
│ Top Stories │ AI Editor │
│ (3 rows) │ Summary │
├─────────────────┼─────────────────┤
│ Politics │ Business │
│ (3 rows) │ (3 rows) │
├─────────────────┼─────────────────┤
│ Tech │ Culture │
│ (3 rows) │ (3 rows) │
├─────────────────┼─────────────────┤
│ Developing Stories (full width) │
│ (3 rows) │
└───────────────────────────────────┘
- Initial fetch: ~10-30 seconds for 100 markets
- Signal computation: <1 second
- Layout generation: <1 second
- Refresh cycle: ~15-45 seconds total
- Uses Kalshi's public API (no authentication required)
- Rate limited to avoid overloading the API
- Historical data accumulated during runtime only
- Sparklines require multiple snapshots over time
Problem: Kalshi API is unavailable, rate-limited, or returns errors.
Solution: The application includes automatic demo fallback. When the API fails, it will:
- Automatically load cached sample market data from
demo_data/ - Display a banner:
"Demo mode: using cached sample markets (Kalshi unavailable)" - Continue functioning normally with realistic sample data
To manually enable demo mode, set USE_DEMO_DATA = True in hex_cells/01_setup.py.
Problem: Some sections show no markets or missing data.
Solution:
- Ensure all cells run in order (1-8)
- Check for error messages in cell outputs
- Try reducing
MARKET_LIMITin Cell 1 (default is 100) - Verify demo mode is working if API is unavailable
Problem: Data fetching or signal computation takes too long.
Solution:
- Reduce
MARKET_LIMITin Cell 1 (try 50 markets) - Increase refresh interval in Hex schedule
- Use demo data for testing layouts before going live
Problem: Editor Desk queries return unexpected results.
Solution:
- Verify
semantic_model.yamlis properly loaded - Ensure all data tables (
markets_df,snapshots_df,liquidity_df) are populated - Check that column names match the semantic model definitions
- Try the starter prompts listed in the Threads demo section
- Persistent storage for historical snapshots
- More sophisticated volatility models
- User-customizable sections
- Email/Slack notifications for significant changes
- Enhanced Plotly visualizations
- Multi-exchange support (beyond Kalshi)
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details
Built with:
- Kalshi API: Live prediction market data
- Pandas: Data manipulation
- Hex: Notebook deployment platform
Created for prediction market enthusiasts who want a clean, news-style view of market movements.
Questions? Open an issue on GitHub or contact the maintainer.
MarketPress - Turning prediction markets into news since 2026 📰📈