Skip to content

GNL324/polylens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

114 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Polylens

Polylens is a wallet intelligence and arbitrage research platform for prediction markets and sportsbook odds. It analyzes Polymarket wallet activity, compares related markets across Polymarket and Kalshi, scans sportsbook lines and player props for pricing discrepancies, stores opportunities, and can continuously monitor for new prop arbitrage.

Polylens is intended for research, analytics, and monitoring. It does not execute trades or place sportsbook bets.

Features

  • Wallet analytics for Polymarket addresses
  • Prediction market analysis across Polymarket and Kalshi
  • Market inventory and matching diagnostics
  • Sportsbook odds ingestion via The Odds API
  • Sportsbook futures and multibook arbitrage analysis
  • Player prop arbitrage scanning for common NBA props
  • Continuous monitoring with duplicate suppression
  • SQLite opportunity persistence
  • Telegram alerting for qualifying prop opportunities
  • CLI-first workflows suitable for servers and systemd

Architecture

flowchart LR
    CLI[CLI commands] --> Adapters
    Adapters --> PM[Polymarket APIs]
    Adapters --> Kalshi[Kalshi APIs]
    Adapters --> Odds[The Odds API]
    Adapters --> Analysis
    Analysis --> Wallet[Wallet analytics]
    Analysis --> Matching[Market matching]
    Analysis --> Arb[Arbitrage engines]
    Arb --> Storage[(SQLite storage)]
    Arb --> Alerts[Telegram alerts]
    Analysis --> Reports[JSON reports]
Loading

See docs/architecture.md for a fuller module map.

Installation

Local

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

If requirements.txt is not present in your checkout yet, install the small runtime/test set used by the project manually and then run pytest to verify the environment.

Environment Variables

ODDS_API_KEY          Required for The Odds API sportsbook odds, futures, and player props.
ODDSBLAZE_API_KEY    Optional OddsBlaze provider for player prop odds.
TELEGRAM_BOT_TOKEN   Optional for Telegram alerts.
TELEGRAM_CHAT_ID     Optional for Telegram alerts.

Other deployment-specific values may be placed in the systemd env file described in docs/deployment_systemd.md.

Quick Start

python -m src.cli analyze-wallet 0x0000000000000000000000000000000000000000
python -m src.cli compare-kalshi 0x0000000000000000000000000000000000000000
python -m src.cli scan-prop-arb --sport basketball_nba --markets player_points --bankroll 1000 --json
python -m src.cli watch-prop-arb --sport basketball_nba --markets player_points --interval 30 --bankroll 1000 --min-roi 0.01

OddsBlaze

OddsBlaze is optional and does not replace The Odds API flow.

export ODDSBLAZE_API_KEY="..."
python -m src.cli oddsblaze-odds --sportsbook draftkings --league nba --market-contains Player --live false --main true --json
python -m src.cli scan-prop-arb --sport basketball_nba --provider oddsblaze --sportsbook draftkings --sportsbook fanduel --markets Player --json

Local Dashboard And Risk

Start the local dashboard:

python -m src.cli web-dashboard --host 127.0.0.1 --port 8787

Check risk state:

python -m src.cli risk-status

Polylens defaults to DRY_RUN=true and LIVE_TRADING=false; live execution remains blocked. See docs/dashboard.md and docs/risk_engine.md.

Prop Arbitrage Analytics Collector

The analytics collector runs scan-prop-arb on a timer and records opportunity lifecycle snapshots to data/opportunities.db. It does not place bets or send alerts.

Install timer (manual enable)

cp deploy/systemd/polylens-prop-arb-collector.env.example deploy/systemd/polylens-prop-arb-collector.env
# edit deploy/systemd/polylens-prop-arb-collector.env and set ODDS_API_KEY / ODDSBLAZE_API_KEY

sudo cp deploy/systemd/polylens-prop-arb-collector.service /etc/systemd/system/
sudo cp deploy/systemd/polylens-prop-arb-collector.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now polylens-prop-arb-collector.timer

The timer is not enabled by the repo install scripts. Enable it only when you want active monitoring.

Disable timer

sudo systemctl disable --now polylens-prop-arb-collector.timer
sudo systemctl stop polylens-prop-arb-collector.service

View analytics

python -m src.cli opportunity-leaderboard --json
python -m src.cli opportunity-lifetimes --json
python -m src.cli opportunity-quality-report --json

The web dashboard also includes an Opportunity Analytics page at / (Command Center navigation).

Collector logs use --summary-json so journal output stays compact (counts and analytics metadata only, no full candidate payloads).

Short-Crypto Live Trading

Short-window BTC/ETH/SOL trading on Kalshi and Polymarket is gated behind explicit environment flags, readiness audits, duplicate-trade protection, and a kill switch. Live sends default off.

See docs/short_crypto_live_trading.md for current milestone status, safety gates, first-live-test procedures, and audit commands.

Testing

pytest

Roadmap

See docs/roadmap.md.

Security

Do not commit API keys, Telegram credentials, webhook URLs, private wallet notes, or raw data containing sensitive account information. See SECURITY.md and docs/security.md.

License

Polylens is released under the MIT License. See LICENSE.

About

AI-powered prediction market and market intelligence platform for wallet analytics, opportunity discovery, arbitrage detection, and quantitative research.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors