Metadata-Version: 2.4
Name: feraterra
Version: 1.0.1
Summary: Fera Terra — Queue-Accurate C++23 Shadow-CLOB & Chaos Execution Simulator for Polymarket, Hyperliquid, and Crypto Bots
Author-email: Fera Terra <chartnest.inc@proton.me>
License: Proprietary
Project-URL: Homepage, https://feraterra.app
Project-URL: Live C++23 Playground, https://feraterra.app/#playground
Project-URL: Pricing & License Keys, https://feraterra.app/#pricing
Project-URL: Benchmarks & Examples, https://github.com/FeraTerra/feraterra-benchmarks
Project-URL: Terms & Billing Portal, https://feraterra.app/terms
Keywords: polymarket,hyperliquid,backtesting,orderbook,clob,market-making,trading-bot,quant,execution-simulator
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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 :: Software Development :: Testing
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Fera Terra

**Queue-Accurate C++23 Shadow-CLOB & Chaos Execution Simulator for Polymarket, Hyperliquid, and Crypto Trading Bots.**

Website & Live Browser Sandbox: **[https://feraterra.app](https://feraterra.app)** | Open-Source Benchmarks: **[github.com/FeraTerra/feraterra-benchmarks](https://github.com/FeraTerra/feraterra-benchmarks)**

---

## Why Fera Terra?

Naive backtesters and paper-trading shims assume `0 ms` cancellation latency and `100%` immediate fills the instant price touches a resting limit order. On real CLOB venues, resting orders wait behind live queue volume (`queue_ahead_lots`) and in-flight cancels suffer toxic adverse-selection pick-offs during news shocks and liquidations.

**Fera Terra** ships a zero-dependency **C++23 Price-Time FIFO L3 matching engine (`arena-server`)** directly inside prebuilt wheels for Linux (`x86_64` & `arm64`), macOS (`Universal2: Apple Silicon + Intel`), and Windows (`x64`) — no C++ compiler required:

| Metric (`polymarket_news_shock`, 140 ms Cancel Latency) | Naive `Touch = Fill` Paper Trader | Fera Terra C++23 L3 FIFO Engine |
| :--- | :---: | :---: |
| **Net Strategy PnL** | `+$154.05` (38 fills) | `-$244.67` (24 fills) |
| **Backtest Illusion Gap** | — | **`$398.72` overstated PnL** |
| **Queue-Blocked Non-Fills / Cancel-Lag Snipes** | Ignored (`0`) | Tracked & graded per fill |

---

## 10-Second Quickstart

```bash
pip install feraterra
feraterra doctor
```

### 1. Live Local Shadow-CLOB (`100%` Local on `127.0.0.1`)
```bash
# Hyperliquid live BTC + ETH Shadow-CLOB (HTTP Proxy :8085, RFC 6455 WS :8086, UI :8090)
feraterra up --venue hyperliquid --symbols BTC,ETH --cancel-latency-ms 120

# Polymarket live top binary markets with conditional inventory enforcement
feraterra up --venue polymarket --auto-top-markets 4 --cancel-latency-ms 140
```
Point your existing `py-clob-client` (Polymarket), `hyperliquid-python-sdk`, Rust, Go, or TypeScript bot at `http://127.0.0.1:8085` (`ws://127.0.0.1:8086/ws`) and open `http://127.0.0.1:8090` for real-time FIFO queue bars, markout attribution, and toxic pick-off diagnostics. Zero wallet keys or exchange API keys touch Fera Terra.

### 2. Deterministic Crash Packs & A/B Strategy Diffs
```bash
export FERATERRA_LICENSE_KEY="ft_live_..."

feraterra benchmark \
  --pack polymarket_news_shock \
  --bot my_mm_bot.py \
  --cancel-latency-ms 140 \
  --json-out baseline.json \
  --html-out baseline.html
```
Test non-Python binaries (`Rust`, `Go`, `C++`, `Node.js`) against identical microstructure crash tapes using `--bot-cmd "./target/release/mm-bot"`.

### 3. Automated CI/CD Pull-Request Regression Gate
```bash
feraterra ci-gate \
  --pack flash_crash_5sigma \
  --bot my_mm_bot.py \
  --min-fifo-pnl -100.0 \
  --max-cancel-snipes 5 \
  --html-out feraterra-ci-report.html
```

---

## Plans & Offline Ed25519 Licensing

- **Hobby (`$0` / forever):** Free out of the box (`pip install feraterra`) — 1 shadow market, local HTTP/WS proxy & diagnostics dashboard.
- **Indie Quant (`$49/mo`):** Up to 4 concurrent markets, 24h live sessions, all 4 synthetic 5-sigma crash packs, HTTP `429`/`502` + latency fault injection, `.jsonl` tape recorder & `<1s` replay.
- **Pro + CI/CD (`$129/mo`):** Up to 16 concurrent markets, 7-day burn-in sessions, `feraterra ci-gate` unlocked in GitHub Actions / GitLab CI, permalink report archiving.
- **Trading Team / Pod (`$299/mo`):** Up to 64 concurrent markets, 30-day soak sessions, unlimited CI runners & multi-bot desk workflows.

Get a license key or try the live browser sandbox at **[https://feraterra.app](https://feraterra.app)**. License keys (`ft_live_...`) verify `100%` offline via RFC 8032 Ed25519 with zero runtime network dependency.
