Metadata-Version: 2.4
Name: vequil-sdk
Version: 0.2.0
Summary: Multi-agent prediction market trading framework. Deploy autonomous agent teams to trade prediction markets.
Project-URL: Homepage, https://vequil.com
Project-URL: Repository, https://github.com/vequil/vequil
Project-URL: Documentation, https://github.com/vequil/vequil#readme
Author: Vequil
License-Expression: MIT
License-File: LICENSE
Keywords: kelly-criterion,multi-agent,polymarket,prediction-markets,quantitative-finance,trading
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: aiohttp>=3.9
Requires-Dist: anthropic>=0.40
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

<p align="center">
  <strong>V E Q U I L</strong>
</p>

<p align="center">
  <em>Multi-agent prediction market trading framework.</em>
</p>

<p align="center">
  <a href="https://github.com/vequil/vequil/actions"><img src="https://img.shields.io/github/actions/workflow/status/vequil/vequil/ci.yml?branch=main&style=flat-square&label=build" alt="Build"></a>
  <a href="https://pypi.org/project/vequil/"><img src="https://img.shields.io/pypi/v/vequil?style=flat-square&color=0a1628" alt="PyPI"></a>
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.11+-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+"></a>
  <a href="https://github.com/vequil/vequil/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="License"></a>
  <a href="https://vequil.com"><img src="https://img.shields.io/badge/web-vequil.com-0a1628?style=flat-square" alt="Website"></a>
  <a href="https://www.producthunt.com/products/vequil"><img src="https://img.shields.io/badge/Product%20Hunt-%2311-DA552F?style=flat-square&logo=producthunt&logoColor=white" alt="Product Hunt"></a>
</p>

---

## Install

```bash
pip install vequil
```

## Quick Start

```python
from vequil import Pipeline

pipeline = Pipeline(bankroll=500.0)
result = await pipeline.evaluate(
    "Will Liverpool win?",
    odds=0.65,
    model_prob=0.78,
)

print(result.recommendation)   # STRONG — edge=13.0%, kelly=20.0%
print(result.position_size_usdc)  # $100.00
```

### CLI

```bash
# Scan top Polymarket markets by volume
vequil scan --limit 10

# Evaluate a specific opportunity
vequil evaluate "Will Liverpool win?" --odds 0.65 --model-prob 0.78

# Run a live demo (pulls real Polymarket data)
vequil demo
```

### With Analyst Team (LLM debate)

```python
import os
os.environ["ANTHROPIC_API_KEY"] = "sk-..."

from vequil import Pipeline

pipeline = Pipeline(bankroll=500.0, enable_analysts=True)
result = await pipeline.evaluate("Will Arsenal win?", odds=0.72)

# LLM analysts evaluate in parallel, bull/bear researchers debate
print(result.research.consensus_signal)  # "bullish"
print(result.research.bullish_case)
print(result.research.bearish_case)
```

---

## What is Vequil?

Vequil is a **multi-agent prediction market trading framework**. Deploy autonomous agent teams to evaluate and trade prediction market opportunities with deterministic signal rules and Kelly-constrained risk management.

No learned models in the execution path. Every decision logged and auditable.

**Vequil the framework** is what you install. **Vequil the firm** is how we use it.

---

## Architecture

```
    ┌─────────────┐  ┌──────────────┐   ┌──────────────────┐
    │  Feed Agent  │  │ Sports Agent │   │   Analyst Team   │
    │  tick stream │  │ match events │   │   LLM analysts   │
    └──────┬──────┘  └──────┬───────┘   │  bull/bear debate │
           ▼                │           └────────┬─────────┘
    ┌──────────────┐        │            soft context only
    │Feature Agent │        │           (never overrides Kelly)
    │ vol, z-score │        │                    │
    └──────┬───────┘        │                    │
           ▼                ▼                    ▼
    ┌──────────────────────────────────────────────────┐
    │              DETERMINISTIC DECISION               │
    │  features → closed-form rule → probability shift  │
    │  NO learned model · NO curve fitting              │
    └──────────────────────┬───────────────────────────┘
                           ▼
    ┌──────────────────────────────────────────────────┐
    │                Scanner Agent                      │
    │  Polymarket CLOB → match opportunities → score    │
    └──────────────────────┬───────────────────────────┘
                           ▼
    ┌──────────────────────────────────────────────────┐
    │                  Risk Agent                       │
    │  Kelly criterion · position limits · breaker      │
    └──────────────────────┬───────────────────────────┘
                           ▼
    ┌──────────────────────────────────────────────────┐
    │              Execution Agent                      │
    │  paper / live modes · full order audit trail       │
    └──────────────────────────────────────────────────┘
```

---

## Repository Structure

```
vequil/                        pip package (what you install)
├── __init__.py                public API
├── pipeline.py                Pipeline — the main evaluation API
├── cli.py                     CLI entry point (vequil scan/evaluate/demo)
├── core/
│   ├── models.py              frozen dataclasses — Tick, Signal, Order, etc.
│   ├── kelly.py               Kelly criterion with fractional cap
│   └── pricing.py             deterministic signal rule
└── agents/
    ├── analyst_team.py        LLM analysts + bull/bear researcher debate
    ├── feed_agent.py          dual exchange WebSocket feed
    ├── feature_agent.py       rolling features: vol, return, jump, z-score
    ├── sports_agent.py        live sports event feed
    ├── scanner_agent.py       Polymarket CLOB matching + edge scoring
    ├── risk_agent.py          position limits, drawdown circuit breaker
    └── execution_agent.py     paper/live orders, SQLite persistence

trading/                       internal orchestration
tests/                         22 tests, all passing
web/static/                    vequil.com
```

---

## Risk Controls

| Control | Description |
|---------|-------------|
| Kelly cap | Fractional Kelly with configurable cap |
| Min edge | Minimum edge threshold to enter |
| Max positions | Concurrent position limit |
| Position cap | Per-position dollar limit |
| Circuit breaker | Halts trading on daily drawdown |
| Live gate | Disabled until validated performance threshold |

---

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `ANTHROPIC_API_KEY` | No | Enables LLM analyst team |
| `API_FOOTBALL_KEY` | No | Live sports event data |
| `EXECUTION_MODE` | No | `paper` (default) or `live` |
| `BANKROLL_USDC` | No | Starting bankroll (default: 500.0) |

---

## Contributing

We're hiring agent systems engineers, quantitative researchers, and LLM architects. See [vequil.com/careers](https://vequil.com/careers).

---

<p align="center">
  <sub>Deterministic execution. Kelly-constrained risk. Every trade auditable.</sub>
</p>
