Marketski is an automated monitoring bot that identifies "Smart Money" and probable insider wallets on the Polymarket prediction market platform.
It works by detecting anomalous high-conviction trading activity in the final hours before a market resolves, then profiling the wallets behind those trades to identify patterns consistent with insider knowledge: unusually high win rates and large cumulative profits.
This web console provides a real-time view of all detected activity, wallet profiles, and analytical charts. It includes an integrated Smart Analyzer (powered by LLM) to help evaluate flagged wallets. The interface is styled after the Borland Turbo Pascal IDE (circa 1990), because nothing says "alpha" like a DOS-era interface.
cp .env.example .env # Configure credentials docker-compose up # Start PostgreSQL + bot python main.py --web # Launch web console
Navigate to Run → Run Single Cycle (or press F9) and click [Run Single Cycle]. The bot will:
After a cycle completes, explore the data:
Each monitoring cycle follows a 5-step pipeline:
Polls the Polymarket Gamma API for all active markets whose resolution time falls within the next CANDIDATE_MARKET_HOURS (default: 12 hours). Markets are upserted into the database.
For each candidate market, fetches the most recent 500 trades and computes the mean and standard deviation of trade sizes (in USD). These stats are used to calculate the statistical anomaly threshold.
Fetches trades on each candidate market that exceed either:
Only trades within the Late-Stage window (4 hours before close) are flagged. Each trade is deduplicated by transaction hash to prevent double-counting across poll cycles.
For each wallet behind an anomalous trade, fetches their entire history of resolved (closed) positions from the Polymarket Data API. Computes:
A wallet is flagged as a Probable Insider if it meets the criteria (see Definitions below). Profiles are cached for 24 hours to avoid redundant API calls.
For each confirmed insider, fetches their current open positions across all Polymarket markets. This provides the "alpha" — seeing what insiders are currently betting on.
A market whose scheduled resolution/closing time is within the next
12 hours (configurable via
CANDIDATE_MARKET_HOURS).
A trade where the USD value exceeds $10,000 OR the size is more than 3 standard deviations above the market's recent average trade size.
A trade occurring within 4 hours of the
market's scheduled closing time (configurable via
LATE_STAGE_HOURS).
A wallet address that meets both of the following:
The main overview screen. Shows four summary counters (markets, anomalies, wallets, insiders), a feed of the 15 most recent anomalous trades, and a leaderboard of the top 5 insiders by profit. This is your at-a-glance view of system status.
Lists all candidate markets currently being monitored. Each row shows the market question, closing time, time remaining, 24-hour volume, and the computed trade statistics (average and standard deviation) used for anomaly detection. Sortable by closing time, volume, or name — click the active sort button again to toggle between ascending (▲) and descending (▼) order.
The full log of detected anomalous trades. Each row includes the timestamp, wallet address (clickable to view profile), USD size, market question, time remaining until close, transaction hash, and whether the wallet is flagged as an insider. Sortable by time, size, or time-to-close, each with ASC/DESC toggle.
All profiled wallets with their trading statistics. Toggle the "Show insiders only" checkbox to filter to flagged wallets. Click any wallet address to see their full profile and open positions. On the wallet detail page, use the [Smart Analyzer] button to get an AI-powered assessment of the wallet's tracking value. Sortable by profit, win rate, or trade count, each with ASC/DESC toggle.
Displays pre-generated analysis charts and a live rankings table:
Click [Regenerate Charts] to rebuild the static PNG images from the latest data.
The control panel for running scan cycles. Click [Run Single Cycle] to execute one complete pipeline pass. The output log shows real-time progress and results. After each cycle, summary statistics are displayed in the results panel.
For continuous monitoring, use the CLI:
python main.py --monitor
Live-editable settings grouped by category. Change any threshold or
interval, then click [ F2 Save Changes ].
Changes apply to the running process immediately — the monitoring loop
picked them up on the next cycle. Settings are persisted to
output/.config_overrides.json and survive restarts.
Use [ Reset to Defaults ] to restore all values to their environment-variable or built-in defaults.
| Purpose | Endpoint |
|---|---|
| Market discovery | GET gamma-api.polymarket.com/markets |
| Trade detection | GET data-api.polymarket.com/trades |
| Wallet profiling | GET data-api.polymarket.com/closed-positions |
| Open positions | GET data-api.polymarket.com/positions |
All endpoints are public and require no authentication. Rate limiting is handled via exponential backoff with jitter.
| Table | Primary Key | Purpose |
|---|---|---|
markets | market_id | Candidate markets with trade stats |
anomalous_bids | bid_id (auto) | Detected high-conviction trades |
wallets | wallet_address | Profiled wallets with insider flag |
insider_positions | id (auto) | Open position snapshots for insiders |
python main.py --monitor # Run continuous monitoring loop (10 min interval) python main.py --analyze # Generate charts from stored data python main.py --web # Launch web console (default port 8017) python main.py --web --port 8080 # Custom port
# Start everything (bot and web console) docker-compose up -d # View bot logs docker-compose logs -f bot # Run chart generation manually docker-compose exec bot python main.py --analyze # Access database docker-compose exec db psql -U marketski
| Key | Action |
|---|---|
| F1 | Open this Help page |
| F5 | Refresh current page |
| F9 | Go to Monitor (Run) |
The Gamma API may not return markets matching the time window. Open
Options → Configuration and increase
Candidate Market Hours to 24 or 48.
If markets have low volume, trades may not exceed the default $10k
threshold. Open Options → Configuration
and lower High Conviction Threshold ($) for testing (e.g.,
1000).
Ensure PostgreSQL is running and DATABASE_URL is correct.
When using Docker, the hostname should be db (the service
name), not localhost. DATABASE_URL is set via
environment variable only (not editable in the web console).
The bot uses exponential backoff automatically. If you see persistent
429s, open Options → Configuration and
increase Poll Interval (seconds).
Marketski v1.0 — Polymarket Insider Detection System
Borland-Style Console Edition