Skip to main content

Unified SDK for prediction market data aggregation across Polymarket, Kalshi, Manifold, Metaculus, and PredictIt

Project description

PolyPoll SDK

Unified SDK for prediction market data aggregation across multiple platforms.

Supported Platforms

  • Polymarket - Crypto prediction markets on Polygon
  • Kalshi - US regulated prediction markets
  • Manifold Markets - Play-money forecasting
  • Metaculus - Expert forecasting
  • PredictIt - US political markets

Installation

pip install polypoll-sdk

Quick Start

import asyncio
from polypoll_sdk import PolyPollSDK

async def main():
    # Initialize SDK (no API keys needed for core features)
    sdk = PolyPollSDK()

    # Get markets from all platforms
    markets = await sdk.get_all_markets()
    print(f"Found {len(markets)} markets")

    # Get markets from specific platform
    polymarket = await sdk.get_markets(platform="polymarket")

    # Search for markets
    trump_markets = await sdk.search_markets("trump")

    # Find similar markets across platforms
    if markets:
        similar = await sdk.get_similar_markets(
            market_id=markets[0].market_id,
            platform=markets[0].platform
        )

    # Detect arbitrage opportunities
    arbitrage = await sdk.get_arbitrage_opportunities()
    for opp in arbitrage[:5]:
        print(f"Arbitrage: {opp.profit_pct:.1f}% profit")
        print(f"  {opp.strategy}")

asyncio.run(main())

Features

Layer 1: Data Aggregation

# Get all markets from all platforms
markets = await sdk.get_all_markets()

# Get markets from specific platform
kalshi = await sdk.get_markets(platform="kalshi")

# Search markets by keyword
crypto = await sdk.search_markets("bitcoin", platforms=["polymarket", "kalshi"])

Layer 2: Cross-Platform Matching

# Find markets on other platforms similar to a given market
similar = await sdk.get_similar_markets(
    market_id="abc123",
    platform="polymarket",
    min_similarity=70
)

for match in similar:
    print(f"{match.market.platform}: {match.similarity_score:.0f}%")

Layer 3: AI Research (Coming Soon)

# Coming in future release:
# research = await sdk.deep_research("Will GPT-5 be released?")
# ai_odds = await sdk.get_ai_odds(market_id="...")

Layer 4: Validation (Coming Soon)

# Coming in future release:
# validation = await sdk.validate(question="Will BTC hit $100k?")
# status = await sdk.check_status(market_id="...")

Layer 5: Arbitrage Detection

# Find cross-platform arbitrage opportunities
opportunities = await sdk.get_arbitrage_opportunities(
    min_profit=1.0,  # Minimum 1% profit
    min_similarity=80  # High similarity threshold
)

for opp in opportunities:
    print(f"{opp.profit_pct:.1f}% profit: {opp.strategy}")

UnifiedMarket Schema

All markets are normalized to a common schema:

@dataclass
class UnifiedMarket:
    # Core
    platform: str       # polymarket, kalshi, etc.
    market_id: str
    title: str
    url: str

    # Pricing (0-1)
    yes_price: float
    no_price: float

    # Volume
    volume: float
    volume_24h: float
    liquidity: Optional[float]

    # Status
    status: MarketStatus  # open, closed, resolved
    is_resolved: bool
    close_time: Optional[datetime]

    # Metadata
    category: Optional[str]
    description: Optional[str]
    image_url: Optional[str]

Coming Soon: AI Features

Note: AI features are planned but not yet implemented in v0.1.0.

The following features will require API keys when implemented:

# Planned for future release:
sdk = PolyPollSDK(
    exa_api_key="your-exa-key",
    groq_api_key="your-groq-key"
)

# Deep research (coming soon)
# research = await sdk.deep_research("Will GPT-5 be released in 2025?")

# AI odds prediction (coming soon)
# ai_odds = await sdk.get_ai_odds(market_id="...")

# Market validation (coming soon)
# validation = await sdk.validate(question="Will BTC hit $100k?")

Development

# Clone repository
git clone https://github.com/OpenOracleWeb3/polypoll-sdk.git
cd polypoll-sdk

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polypoll_sdk-0.1.0.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polypoll_sdk-0.1.0-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file polypoll_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: polypoll_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for polypoll_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c5644d0a58f7dfdb958b41d78f2d2b2d0a205c9498404d7c2799ffd111ac1743
MD5 24df342314af5ec6920fe53d9032c9e5
BLAKE2b-256 f6d26ce3b8b3b1722b11c6e12bf746e4d268a63b350bc12478e848da8820888d

See more details on using hashes here.

File details

Details for the file polypoll_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: polypoll_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for polypoll_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a7a213feb24b3120a2c69ca21a731f60ca8076728c80177cf4e3fc97588f512
MD5 fab92162bb2086204791d3173c56ea51
BLAKE2b-256 0af20a7f4478a7c6800f9ad8564d587f8d568a572cd22f6782313ca10a353bb1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page