Skip to main content

A terminal-based monitoring app for PolyMarket shifts

Project description

PolyTerm ๐Ÿ“Š

A powerful, terminal-based monitoring and analytics tool for PolyMarket prediction markets. Track market shifts, whale activity, insider patterns, arbitrage opportunities, and AI-powered predictionsโ€”all from your command line.

a nytemode project

Python 3.8+ License: MIT PyPI version Live Data


What's New in v0.4.0

Major Feature Release - PolyTerm is now a comprehensive trading analytics platform:

  • SQLite Database - Persistent local storage for wallets, trades, alerts, and market data
  • Individual Whale Tracking - Track specific wallets via WebSocket maker_address
  • Insider Detection Engine - Risk scoring system (0-100) to identify suspicious patterns
  • Smart Money Identification - Find wallets with >70% win rates
  • Arbitrage Scanner - Cross-market and cross-platform (Kalshi) arbitrage detection
  • Order Book Analysis - ASCII depth charts, iceberg detection, slippage calculator
  • AI-Powered Predictions - Multi-factor signals with confidence scoring
  • Market Correlation Engine - Find related markets and correlation breaks
  • Multi-Channel Alerts - Telegram, Discord, system notifications, email, sound
  • JSON Output Mode - All commands support --format json for scripting
  • 5 New CLI Commands - arbitrage, predict, orderbook, wallets, alerts
  • 5 New TUI Screens - Premium features accessible from interactive menu

Quick Start

Option 1: Install from PyPI (Recommended)

pipx install polyterm

Option 2: One-Command Install

curl -sSL https://raw.githubusercontent.com/NYTEMODEONLY/polyterm/main/install.sh | bash

Option 3: Manual Install

git clone https://github.com/NYTEMODEONLY/polyterm.git
cd polyterm
pip install -e .

Launch PolyTerm:

polyterm

Features Overview

Core Features (Free)

Feature Command Description
Market Monitoring polyterm monitor Real-time market tracking with live updates
Live Monitor polyterm live-monitor Dedicated terminal window for focused monitoring
Whale Activity polyterm whales Volume-based whale detection
Watch Markets polyterm watch Track specific markets with alerts
Export Data polyterm export Export to JSON/CSV
Historical Replay polyterm replay Replay market history

Premium Features (v0.4.0)

Feature Command Description
Arbitrage Scanner polyterm arbitrage Find cross-market profit opportunities
AI Predictions polyterm predict Multi-factor market predictions
Order Book Analysis polyterm orderbook Depth charts, slippage, icebergs
Wallet Tracking polyterm wallets Smart money & whale wallet analysis
Alert Management polyterm alerts Multi-channel notification system

CLI Commands

Market Monitoring

# Monitor top markets
polyterm monitor --limit 20

# Monitor with JSON output (for scripting)
polyterm monitor --format json --limit 10 --once

# Sort by different criteria
polyterm monitor --sort volume
polyterm monitor --sort probability
polyterm monitor --sort recent

Whale Activity

# Find high-volume markets
polyterm whales --hours 24 --min-amount 50000

# JSON output
polyterm whales --format json

Arbitrage Scanner

# Scan for arbitrage opportunities
polyterm arbitrage --min-spread 0.025 --limit 10

# Include Kalshi cross-platform arbitrage
polyterm arbitrage --include-kalshi

# JSON output for automation
polyterm arbitrage --format json

What it detects:

  • Intra-market: YES + NO prices < $1.00 (guaranteed profit)
  • Correlated markets: Similar events with price discrepancies
  • Cross-platform: Polymarket vs Kalshi price differences

AI Predictions

# Generate predictions for top markets
polyterm predict --limit 10 --horizon 24

# Predict specific market
polyterm predict --market <market_id>

# High-confidence predictions only
polyterm predict --min-confidence 0.7

# JSON output
polyterm predict --format json

Prediction signals include:

  • Price momentum (trend analysis)
  • Volume acceleration
  • Whale behavior patterns
  • Smart money positioning
  • Technical indicators (RSI)
  • Time to resolution

Order Book Analysis

# Analyze order book
polyterm orderbook <market_token_id>

# Show ASCII depth chart
polyterm orderbook <market_token_id> --chart

# Calculate slippage for large order
polyterm orderbook <market_token_id> --slippage 10000 --side buy

# Full analysis with depth
polyterm orderbook <market_token_id> --depth 50 --chart

What you get:

  • Best bid/ask and spread
  • Bid/ask depth visualization
  • Support/resistance levels
  • Large order detection (icebergs)
  • Slippage calculations
  • Liquidity imbalance warnings

Wallet Tracking

# View whale wallets (by volume)
polyterm wallets --type whales

# View smart money (>70% win rate)
polyterm wallets --type smart

# View suspicious wallets (high risk score)
polyterm wallets --type suspicious

# Analyze specific wallet
polyterm wallets --analyze <wallet_address>

# Track a wallet for alerts
polyterm wallets --track <wallet_address>

# JSON output
polyterm wallets --format json

Alert Management

# View recent alerts
polyterm alerts --limit 20

# View only unread alerts
polyterm alerts --unread

# Filter by type
polyterm alerts --type whale
polyterm alerts --type insider
polyterm alerts --type arbitrage
polyterm alerts --type smart_money

# Acknowledge an alert
polyterm alerts --ack <alert_id>

# Test notification channels
polyterm alerts --test-telegram
polyterm alerts --test-discord

Watch Specific Markets

# Watch with price threshold alerts
polyterm watch <market_id> --threshold 5

# Watch with custom interval
polyterm watch <market_id> --threshold 3 --interval 30

Export Data

# Export to JSON
polyterm export --market <market_id> --format json --output data.json

# Export to CSV
polyterm export --market <market_id> --format csv --output data.csv

Configuration

# List all settings
polyterm config --list

# Get specific setting
polyterm config --get alerts.probability_threshold

# Set a value
polyterm config --set alerts.probability_threshold 10.0

Interactive TUI

Launch the interactive terminal interface:

polyterm

Main Menu

   1 ๐Ÿ“Š Monitor Markets - Real-time market tracking
   2 ๐Ÿ”ด Live Monitor - Dedicated terminal window
   3 ๐Ÿ‹ Whale Activity - High-volume markets
   4 ๐Ÿ‘  Watch Market - Track specific market
   5 ๐Ÿ“ˆ Market Analytics - Trends and predictions
   6 ๐Ÿ’ผ Portfolio - View your positions
   7 ๐Ÿ“ค Export Data - Export to JSON/CSV
   8 โš™๏ธ  Settings - Configuration

   9 ๐Ÿ’ฐ Arbitrage - Scan for arbitrage opportunities
  10 ๐Ÿค– Predictions - AI-powered market predictions
  11 ๐Ÿ‘› Wallets - Smart money tracking
  12 ๐Ÿ”” Alerts - Manage notifications
  13 ๐Ÿ“– Order Book - Analyze market depth

   h โ“ Help - View documentation
   q ๐Ÿšช Quit - Exit PolyTerm

Navigation

  • Numbers: Press 1-13 for features
  • Shortcuts: m (monitor), l (live), w (whales), a (analytics), p (portfolio), e (export), s (settings)
  • New shortcuts: arb (arbitrage), pred (predictions), wal (wallets), alert (alerts), ob (orderbook)
  • Help: Press h or ?
  • Quit: Press q

Notification Setup

Telegram Notifications

  1. Create a bot via @BotFather
  2. Get your chat ID via @userinfobot
  3. Configure in PolyTerm:
polyterm config --set notification.telegram.enabled true
polyterm config --set notification.telegram.bot_token "YOUR_BOT_TOKEN"
polyterm config --set notification.telegram.chat_id "YOUR_CHAT_ID"

Discord Notifications

  1. Create a webhook in your Discord server (Server Settings โ†’ Integrations โ†’ Webhooks)
  2. Configure in PolyTerm:
polyterm config --set notification.discord.enabled true
polyterm config --set notification.discord.webhook_url "YOUR_WEBHOOK_URL"

Test Notifications

polyterm alerts --test-telegram
polyterm alerts --test-discord

JSON Output Mode

All commands support --format json for scripting and automation:

# Get markets as JSON
polyterm monitor --format json --limit 5 --once | jq '.markets[] | select(.probability > 0.8)'

# Get arbitrage opportunities
polyterm arbitrage --format json | jq '.opportunities[] | select(.net_profit > 2)'

# Get predictions
polyterm predict --format json | jq '.predictions[] | select(.confidence > 0.7)'

# Get wallet data
polyterm wallets --format json --type smart | jq '.wallets[] | select(.win_rate > 0.8)'

Database & Storage

PolyTerm stores data locally in SQLite:

  • Location: ~/.polyterm/data.db
  • Tables: wallets, trades, alerts, market_snapshots, arbitrage_opportunities

Data Tracked

  • Wallet profiles with win rates and tags
  • Trade history with maker/taker addresses
  • Alert history with severity scoring
  • Market snapshots for historical analysis
  • Arbitrage opportunities log

Configuration

Configuration stored in ~/.polyterm/config.toml:

[api]
gamma_base_url = "https://gamma-api.polymarket.com"
clob_rest_endpoint = "https://clob.polymarket.com"
clob_endpoint = "wss://clob.polymarket.com/ws"

[whale_tracking]
min_whale_trade = 10000
min_smart_money_win_rate = 0.70
min_smart_money_trades = 10

[arbitrage]
min_spread = 0.025
fee_rate = 0.02

[notification]
[notification.telegram]
enabled = false
bot_token = ""
chat_id = ""

[notification.discord]
enabled = false
webhook_url = ""

[notification.system]
enabled = true

[notification.sound]
enabled = true
critical_only = true

[alerts]
probability_threshold = 5.0
check_interval = 60

[display]
refresh_rate = 2
max_markets = 20

Architecture

polyterm/
โ”œโ”€โ”€ api/              # API clients
โ”‚   โ”œโ”€โ”€ gamma.py          # Gamma REST API
โ”‚   โ”œโ”€โ”€ clob.py           # CLOB REST + WebSocket
โ”‚   โ””โ”€โ”€ aggregator.py     # Multi-source aggregator
โ”œโ”€โ”€ core/             # Business logic
โ”‚   โ”œโ”€โ”€ whale_tracker.py  # Whale & insider detection
โ”‚   โ”œโ”€โ”€ notifications.py  # Multi-channel alerts
โ”‚   โ”œโ”€โ”€ arbitrage.py      # Arbitrage scanner
โ”‚   โ”œโ”€โ”€ orderbook.py      # Order book analysis
โ”‚   โ”œโ”€โ”€ predictions.py    # AI predictions
โ”‚   โ”œโ”€โ”€ correlation.py    # Market correlations
โ”‚   โ”œโ”€โ”€ historical.py     # Historical data API
โ”‚   โ””โ”€โ”€ portfolio.py      # Portfolio analytics
โ”œโ”€โ”€ db/               # Database layer
โ”‚   โ”œโ”€โ”€ database.py       # SQLite manager
โ”‚   โ””โ”€โ”€ models.py         # Data models
โ”œโ”€โ”€ cli/              # CLI commands
โ”‚   โ”œโ”€โ”€ main.py           # Entry point
โ”‚   โ””โ”€โ”€ commands/         # Individual commands
โ”œโ”€โ”€ tui/              # Terminal UI
โ”‚   โ”œโ”€โ”€ controller.py     # Main loop
โ”‚   โ”œโ”€โ”€ menu.py           # Main menu
โ”‚   โ””โ”€โ”€ screens/          # TUI screens
โ””โ”€โ”€ utils/            # Utilities
    โ”œโ”€โ”€ config.py         # Configuration
    โ”œโ”€โ”€ json_output.py    # JSON formatting
    โ””โ”€โ”€ formatting.py     # Rich formatting

Testing

# Full test suite (184 tests)
pytest

# Specific test categories
pytest tests/test_core/ -v          # Core logic tests
pytest tests/test_db/ -v            # Database tests
pytest tests/test_cli/ -v           # CLI tests
pytest tests/test_tui/ -v           # TUI tests
pytest tests/test_live_data/ -v     # Live API tests

Development

Setup

git clone https://github.com/NYTEMODEONLY/polyterm.git
cd polyterm
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Build & Publish

rm -rf dist/ build/ *.egg-info
python -m build
python -m twine upload dist/*

Known Limitations

  • Portfolio tracking: Limited due to Subgraph API deprecation (uses local trade history)
  • Individual trades: WebSocket required for real-time individual trade data
  • Kalshi integration: Requires Kalshi API key for cross-platform features

Roadmap

Completed in v0.4.0

  • โœ… SQLite persistent database
  • โœ… Individual whale/wallet tracking
  • โœ… Insider detection engine
  • โœ… Smart money identification
  • โœ… Cross-market arbitrage scanner
  • โœ… Kalshi cross-platform arbitrage
  • โœ… Order book analysis with ASCII charts
  • โœ… AI-powered predictions
  • โœ… Market correlation engine
  • โœ… Multi-channel notifications
  • โœ… JSON output for all commands
  • โœ… Historical data API

Future

  • ๐Ÿ”„ Python SDK for programmatic access
  • ๐Ÿ”„ Custom dashboard builder
  • ๐Ÿ”„ Webhook API for external integrations
  • ๐Ÿ”„ News sentiment integration

Support

  • Issues: GitHub Issues
  • Documentation: See this README and inline --help
  • Updates: polyterm update or pipx upgrade polyterm

License

MIT License - see LICENSE file.


Built with โค๏ธ for the PolyMarket community

Your terminal window to prediction market alpha ๐Ÿ“Š

a nytemode project

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

polyterm-0.4.1.tar.gz (133.6 kB view details)

Uploaded Source

Built Distribution

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

polyterm-0.4.1-py3-none-any.whl (167.4 kB view details)

Uploaded Python 3

File details

Details for the file polyterm-0.4.1.tar.gz.

File metadata

  • Download URL: polyterm-0.4.1.tar.gz
  • Upload date:
  • Size: 133.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for polyterm-0.4.1.tar.gz
Algorithm Hash digest
SHA256 ac4eaf49754ff5e0812a3fcdc045383d7d2fed24defeed6ce734d6dae3cc8c1b
MD5 a8bd15c93721d3578122be687d0bd4b5
BLAKE2b-256 0ded000a7c01e5e782535c1bc660d6c0b82d46e2cabbf550779dab0631be7a08

See more details on using hashes here.

File details

Details for the file polyterm-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: polyterm-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 167.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for polyterm-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6fe141cd0446d9764f1708e6a004b1d668658e3e911959760ee3e0dbe480025
MD5 635264dbd6685a5826b9c239f59b5cc6
BLAKE2b-256 e72a3d9e04a48a9cd0bd5a189af564a0e930b3f35af68eeb2ad7bda0a6bac383

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