Skip to content
NickAltsteinPublic

About

Institutional quantitative receiving props terminal and CLV ledger.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2,148 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PROPSTEIN

Deterministic Quantitative Pricing Engine, Cryptographic Receipt Ledger, and Event-Driven Market State Terminal.

Production Live Production Checks Python Contracts MCP Server

Retail analytics platforms rely on unverifiable post-hoc win rates, unquarantined outlier feeds, and mutable database records. PropStein (formerly PropWire) is a fail-closed quantitative market pricing engine and real-time analytics terminal engineered with institutional fintech rigor.

The platform ingests multi-book order book and player proposition telemetry, normalizes implied probability distributions, quarantines statistical anomalies (>12.0% synthetic divergence), and commits pre-settlement pricing snapshots to a 3-hash SHA-256 verification chain over canonical JSON (sorted keys).


System Architecture

flowchart LR
    subgraph Ingestion ["1. Telemetry & Normalization"]
        A[Multi-Venue Odds Feeds] --> B[Implied Prob & Vig Stripper]
        B --> C{Execution Gate}
    end

    subgraph Gate ["2. Fail-Closed Pricing Gate"]
        C -->|< 5.0% Edge| D[Suppress / Efficiency State]
        C -->|> 12.0% Edge| E[Quarantine: `/v1/diagnostics`]
        C -->|5.0% - 12.0% Validated| F[Qualified Edge Pool: `/v1/edges`]
    end

    subgraph Crypto ["3. Cryptographic State & Dispatch"]
        F --> G[Canonical JSON SHA-256 Hasher]
        G --> H[(3-Hash Chain Ledger)]
        F --> I[Idempotent Cron Dispatcher]
        I --> J[`.cache/sent_edge_alerts.json`]
    end

    H --> K[Live Terminal: propstein.com]
    H --> L[TypeScript MCP Server]
Loading

Core Engineering Primitives

1. Segregated Execution vs. Diagnostic Pipelines (/v1/edges vs. /v1/diagnostics)

  • executionGate.ts and the Python quantitative pipeline enforce strict numeric bounds. Edges exceeding 12.0% expected value are automatically flagged as stale-line or feed anomalies and routed to /v1/diagnostics rather than polluting live production execution boards.
  • When market spreads tighten efficiently, the terminal enters a deterministic Zero-Play Market Efficiency State rather than fabricating low-edge volume.

2. 3-Hash Cryptographic Verification Chain (POST /api/v1/verify-receipt)

Every published edge is anchored across three verifiable lifecycle states serialized as canonical JSON (crypto_utils.py):

  1. opening_recommendation_hash: Timestamped model projection, fair odds, and book price at discovery.
  2. closing_snapshot_hash: Automated pre-kickoff closing line snapshot (closing_snapshots SQL table) capturing true Closing Line Value (CLV).
  3. settlement_resolution_hash: Automated boxscore ingestion (ESPN/Sleeper telemetry) joined against the prior two hashes to produce a tamper-evident audit receipt.

3. Idempotent Event-Driven Alert Dispatcher

  • Automated GitHub Actions cron workflow (scripts/dispatch_edge_alerts.py) evaluates live market boards on schedule.
  • Deduplicates by quote ID, side, line, and price using .cache/sent_edge_alerts.json across scheduled runs.

4. Model Context Protocol (MCP) Server Integration

  • Exposes a native TypeScript @modelcontextprotocol/sdk server allowing autonomous quantitative agents to query live edges, verify historical receipts via SHA-256 hash checks, and inspect feed diagnostics.

Technical Stack

Layer Technology Role & Design Constraint
Quantitative Engine Python 3.12, FastAPI, Pytest Statistical distribution modeling, vig removal, canonical JSON hashing
State & Persistence PostgreSQL / SQLite, .cache JSON closing_snapshots ledger, idempotent alert deduplication
Terminal UI Vanilla ES6+ / Next.js, Tailwind Zero-bloat #0B0D11 slate canvas, 1px #222733 hairlines, sub-16ms table renders
Agent Interface TypeScript, @modelcontextprotocol/sdk Structured tool definitions (get_current_edges, verify_receipt, inspect_diagnostics)
CI/CD & Automation GitHub Actions, Vercel Edge Automated cron ingestion, persistent state caching, strict CSP/SSL headers

Model Context Protocol (MCP) Interface

Connect Claude Desktop, Cursor, or custom autonomous agents directly to the PropStein pricing engine:

{
  "mcpServers": {
    "propstein-quant": {
      "command": "node",
      "args": ["./mcp-server/dist/index.js"],
      "env": {
        "PropWire_API_URL": "https://YOUR-LIVE-API-HOST",
        "PropWire_API_KEY": "OPTIONAL-SCOPED-KEY"
      }
    }
  }
}

Exposed MCP Tools

  • get_current_edges: Reads the same /v1/edges decision used by alert dispatch. A source quote must carry explicit verification, complete book terms, fresh provider time, and the edge_10pct_v1 qualification policy. Missing evidence returns no actionable edge.
  • verify_receipt (deprecated alias: verify_slip, kept for one release): Hash check only. Fetches a 3-stage receipt chain (Entry -> T-0 Close -> Boxscore Settlement) and independently recomputes RFC-8785 SHA-256 digests locally; does not price or evaluate slips.
  • inspect_diagnostics: Reads /v1/diagnostics for rejected quote IDs and fail-closed reasons.

Alert dispatch requires PROPSTEIN_EDGES_URL to point to the live API's /v1/edges route. It has no picks-file fallback and no unverified override. Until that URL and a verified receiving quote are available, the dispatcher emits no alerts. The public static feed remains research-only.


Verification & Test Suite

PropStein enforces strict contract validation prior to every production deployment:

# 1. Run Python Quantitative & Cryptographic Contract Suite (118 tests)
pytest -q
# -> Tests canonical JSON hashing, float-precision boundary gates, and CLV SQL joins

# 2. Dry-Run the Idempotent Edge Alert Dispatcher
python3 scripts/dispatch_edge_alerts.py --dry-run --min-ev 5.0
# -> Evaluates live payload, checks .cache/sent_edge_alerts.json SHA-256 state, outputs qualified edges

# 3. Execute End-to-End Production Readiness Checks
npm run check:production
# -> Validates CSP headers, executionGate.ts precision bounds, and mode-sync state machines

Cryptographic Receipt Verification Example

Verify any historical projection against its pre-game closing snapshot and final settlement:

curl -s -X POST https://propstein.com/api/v1/verify-receipt \
  -H "Content-Type: application/json" \
  -d '{"receipt_id": "ps_rcpt_8f92a1c4"}' | jq .
{
  "status": "VERIFIED",
  "canonical_form": "canonical JSON (sorted keys)",
  "chain": {
    "opening_hash": "4a7d1ed414474e4033ac29ccb8653d9b4b0e8ef12c6f6630f9d9f58992160911",
    "closing_snapshot_hash": "9c1185a5c5e9fc54612808977ee8f548d88e0ec08d17a3a9fb379c381c81ef8",
    "settlement_hash": "d7a8fbb307d7809469ca9abcb0082e4f0dc50df3650d03227a9228811d0be64e"
  },
  "metrics": {
    "published_fair_prob": 0.584,
    "closing_implied_prob": 0.569,
    "clv_delta_bps": "+150 bps",
    "anomaly_quarantined": false
  }
}

License

Proprietary / All Rights Reserved © Nick Altstein — Live Terminal: propstein.com

About

Institutional quantitative receiving props terminal and CLV ledger.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages