Metadata-Version: 2.4
Name: tradearena
Version: 0.1.0
Summary: Trustless trading signal competition platform — submit, track, and compete on trading signals
Project-URL: Homepage, https://tradearena.io
Project-URL: Repository, https://github.com/luxman89/TradeArena
Project-URL: Documentation, https://github.com/luxman89/TradeArena#readme
Project-URL: Bug Tracker, https://github.com/luxman89/TradeArena/issues
Author-email: TradeArena <hello@tradearena.io>
License-Expression: MIT
License-File: LICENSE
Keywords: backtesting,competition,crypto,signals,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
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: alembic>=1.13.0
Requires-Dist: anthropic>=0.40.0
Requires-Dist: authlib>=1.3.0
Requires-Dist: bcrypt>=4.0.0
Requires-Dist: click>=8.1.0
Requires-Dist: fastapi>=0.115.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: psycopg2-binary>=2.9.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pyjwt>=2.8.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: uvicorn[standard]>=0.30.0
Description-Content-Type: text/markdown

# TradeArena

A signal-tracking platform where traders submit cryptographically committed predictions that are scored across five dimensions. Features an interactive NYSE trading floor UI built with Phaser 3.

## Features

- **Signal submission** — traders submit buy/sell/yes/no/long/short predictions with confidence levels and reasoning
- **Cryptographic commitment** — SHA-256 hash of signal fields + nonce for tamper-proof audit trail
- **Five-dimension scoring** — Win Rate (25%), Risk-Adjusted Return (25%), Reasoning Quality (20%), Consistency (20%), Confidence Calibration (10%)
- **Interactive trading floor** — Phaser 3 rendered NYSE-style environment with animated traders, leaderboard screens, battle mode, day/night cycle
- **Python SDK** — validate and submit signals programmatically, with optional Claude Haiku-powered reasoning generation

## Quick Start

```bash
# Install dependencies
uv sync

# Seed demo data (3 creators, 20 signals)
uv run python scripts/seed_demo.py

# Start dev server
uv run python scripts/server.py
```

Open [http://localhost:8000](http://localhost:8000) to see the trading floor.

## Project Structure

```
src/tradearena/
  api/          FastAPI app — routes, auth, static file serving
  core/         Validation, commitment hashing, scoring engine
  db/           SQLAlchemy ORM (SQLite dev, Postgres-compatible)
sdk/            Python SDK client
scripts/
  arena.html    Phaser 3 trading floor UI (single-file)
  assets/       Spritesheets, tilesets, phaser.min.js
  server.py     Dev server entry point
  seed_demo.py  Demo data seeder
tests/          Pytest test suite
```

## CLI

Install and use the `tradearena` command:

```bash
pip install tradearena

# Configure your API key
tradearena init --api-key ta-your-key-here

# Submit a signal
tradearena submit \
  --asset BTC/USDT \
  --action buy \
  --confidence 0.8 \
  --reasoning "Strong bullish momentum with increasing volume and RSI divergence on the 4h chart suggesting continuation of the uptrend" \
  --data rsi=72.5 \
  --data volume_24h=1.2B

# Check your stats
tradearena status

# View active battles
tradearena battles
```

Run `tradearena --help` for all options.

## Development

```bash
# Run tests
uv run pytest tests/ -v --tb=short

# Lint + format
uv run ruff check src/ sdk/ tests/
uv run ruff format src/ sdk/ tests/
```

## Environment Variables

Set in `.env` (see `.env.example`):

| Variable | Purpose |
|---|---|
| `TRADEARENA_SECRET_KEY` | App secret key |
| `DATABASE_URL` | Database connection string |
| `ANTHROPIC_API_KEY` | For SDK reasoning generation |

## API Endpoints

| Method | Path | Description |
|---|---|---|
| `POST` | `/signal` | Submit a new signal |
| `GET` | `/leaderboard` | Get ranked creators |
| `GET` | `/creator/{id}` | Get creator profile |
| `GET` | `/creator/{id}/signals` | Get creator's signals |
| `GET` | `/` | Trading floor UI |

Auth via `X-API-Key` header (prefix `ta-`).
