Skip to main content

analysis-poly

Real Profit (Fee-Excluded View)

PnL Ratio rebate

中文说明见:README_zh.md

Polymarket market PnL analyzer with a web UI.

Scope (Important)

  • The dashboard discovers markets from Polymarket user activity within the selected time range, then replays the matched markets.
  • It is intended for Polymarket market analysis in general, including but not limited to crypto markets.
  • Main purpose: quantify and visualize realized PnL, fee impact, market-level performance, and Net PnL vs No-Fee PnL.

Requirements

  • Python 3.11+ (recommended: 3.11)
  • uv package manager is optional for local development

Quick Start

pip install analysis-poly
analysis-poly-server --host 127.0.0.1 --port 8000

Open http://localhost:8000.

Local Install From Source

uv pip install .
# or
pip install .

Then start the web server with the same one-line command:

analysis-poly-server --host 127.0.0.1 --port 8000

For source checkout development, this also works:

uv sync
uv run python main.py

CLI Open + Auto Start

Use a standalone script to start server, open browser, and pass params in URL.

uv run -m analysis_poly.open_with_params \
  --address 0xabc \
  --keywords updown,15m \
  --start-time "2026-03-01 00:00" \
  --end-time "2026-03-02 00:00" \
  --concurrency 8

Frontend will read query params, fill form fields, and auto start the run.

CLI Run Once

Use the synchronous CLI entry when you want a single final JSON payload on stdout without SSE or web UI:

analysis-poly-run \
  --address 0xabc \
  --keywords updown,15m \
  --start-time "2026-03-01 00:00" \
  --end-time "2026-03-02 00:00"

The command blocks until analysis finishes, writes report artifacts into output_dir, and prints:

{
  "status": "COMPLETED",
  "summary": { "...": "..." },
  "artifacts": {
    "json": "reports/...",
    "total_curve_csv": "reports/...",
    "market_curve_csv": "reports/..."
  }
}

First Clone

analysis_poly/static/dist is committed in the repository, so first startup does not require front-end build.

If you modify frontend/src, rebuild assets:

npm install
npm run build

API

  • POST /api/runs
  • GET /api/runs/{run_id}/stream (SSE)
  • POST /api/runs/{run_id}/stop
  • GET /api/runs/{run_id}/result
  • GET /api/runs/{run_id}/state

Test

uv run pytest

Frontend

  • Source: frontend/src
  • Build output: analysis_poly/static/dist/app.js and analysis_poly/static/dist/app.css

Download files

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

Source Distribution

analysis_poly-0.1.9.tar.gz (743.3 kB view details)

Uploaded Source

Built Distribution

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

analysis_poly-0.1.9-py3-none-any.whl (737.4 kB view details)

Uploaded Python 3

File details

Details for the file analysis_poly-0.1.9.tar.gz.

File metadata

  • Download URL: analysis_poly-0.1.9.tar.gz
  • Upload date:
  • Size: 743.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for analysis_poly-0.1.9.tar.gz
Algorithm Hash digest
SHA256 f5cf2b64236d392d150958aa3e3c9fb57c0d4c2a9b1f923397f1bdc24b830584
MD5 843f404ea75b3f11fb742af7de7b9692
BLAKE2b-256 fb3f6b74fbf843a8af21fa2dff0fcac420658415ff26400b500fd84ad18be984

See more details on using hashes here.

File details

Details for the file analysis_poly-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: analysis_poly-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 737.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for analysis_poly-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 433c750577d641751ce7ec099f9e48c93f20e64da134bbf5855b2269df77b26c
MD5 0e501c17fb4ca8bad857ac66350ca923
BLAKE2b-256 df4be76d279ec140d3b5c5ba5e5ae654d88d442ce8d640f246ce468987e45d3c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page