Skip to main content
Get direct access to the complete prediction market database for advanced analytics and complex queries.

Getting Started

Already have credentials? Jump to Connection Methods. New to Probalytics? Create ClickHouse credentials in app.probalytics.io → ClickHouse Credentials section. See Quickstart for setup. Connection Details
  • Host: clickhouse.probalytics.io
  • Port: 9440 (Secure TCP) or 8443 (Secure HTTPS)
  • Database: probalytics
  • Authentication: Username and password from dashboard
All connections are secured with TLS encryption. Use the --secure flag for CLI or enable TLS/SSL in your client.

Quick Exploration

SQL Workspace (Browser)

The fastest way to explore and test queries. Visit app.probalytics.io/sql and start querying immediately—no setup required.
Large result sets will crash your browser. Keep queries focused and use LIMIT to restrict results. For bulk exports or large analytics, use programmatic connections instead.

Connection Methods

For production applications and large-scale analysis, use one of these programmatic connections:
Native ClickHouse driver for best performance.Install: pip install clickhouse-driver
from clickhouse_driver import Client

client = Client(
    host='clickhouse.probalytics.io',
    port=9440,
    user='YOUR_USERNAME',
    password='YOUR_PASSWORD',
    database='probalytics',
    secure=True
)

# Test connection
result = client.execute('SELECT count() FROM markets;')
print(f"Total markets: {result[0][0]}")

Exploring the Database

List All Tables

SHOW TABLES FROM probalytics;

Describe Table Structure

DESCRIBE TABLE probalytics.markets;
DESCRIBE TABLE probalytics.trades;

Test Your Connection

SELECT
    'markets' as table_name,
    count() as row_count
FROM markets
UNION ALL
SELECT
    'trades' as table_name,
    count() as row_count
FROM trades;

Understanding ReplacingMergeTree

Tables use the ReplacingMergeTree engine for efficient updates and deduplication. How it works:
  • New versions of the same row replace old versions
  • Deduplication is based on the indexed_at column (highest value wins)
  • Background merges consolidate duplicates asynchronously
  • Queries may return duplicates until merges complete
The FINAL Keyword Use FINAL to force immediate deduplication:
-- May include duplicates (fast)
SELECT count() FROM markets;

-- Guaranteed deduplicated (slower)
SELECT count() FROM markets FINAL;
FINAL triggers synchronous deduplication which is significantly slower. Use it only when you need guaranteed unique results. For most analytics, skip FINAL and rely on background merges.

Access Tiers & Limits

Your tier determines available data, query limits, and resource quotas:
FeatureStarterProCustom
Tablesmarkets, tradesAll tablesAll tables
Historical DataLast 30 daysFull historyFull history
Queries/hour1001,000Unlimited
Max Execution Time5 minutes1 hourUnlimited
Max Memory4 GB32 GBUnlimited
Max Result Rows100,0001 billionUnlimited
Your tier is set when creating ClickHouse credentials in the dashboard. Upgrade your plan to access higher tiers.

Available Tables

markets

Primary table for prediction market metadata.
  • Available to: All tiers
  • Records: One per market across platforms
  • Key fields: platform, title, description, outcomes, dates, status
  • See Tables reference for complete schema

trades

Individual trade records on each market.
  • Available to: All tiers
  • Records: One per trade executed
  • Key fields: market_id, price, volume, side, trader_id, timestamps
  • Note: Partitioned monthly by created_at for performance
  • See Tables reference for complete schema

chain_events

Raw blockchain events (internal use).
  • Available to: Pro and Custom tiers only
  • Records: Low-level chain events from smart contracts
  • Use case: Advanced on-chain analysis
  • Not recommended for typical market analysis

Next Steps

Tables Reference

Complete field definitions and data types

Common Queries

Ready-to-run query examples

SQL Tips

Performance optimization strategies