Metadata-Version: 2.4
Name: bitsentry
Version: 0.2.0
Summary: Safety, audit, and intelligence layer for Bitget trading agents and traders
Project-URL: Homepage, https://github.com/Benita2001/BitSentry
Project-URL: Repository, https://github.com/Benita2001/BitSentry
Author-email: Benita Chidera <0xbeni123@gmail.com>
License: MIT
Keywords: agent,audit,bitget,crypto,mcp,risk-management,trading
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.10
Requires-Dist: fastapi>=0.104.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: rich>=13.0.0
Requires-Dist: uvicorn>=0.24.0
Description-Content-Type: text/markdown

# BitSentry

Safety, audit, and intelligence layer for Bitget trading agents and traders.

## Structure

- `bitsentry/bgc_client.py` — Bitget API client
- `bitsentry/audit_engine.py` — Trade audit and logging
- `bitsentry/risk_guardian.py` — Pre-trade risk enforcement
- `bitsentry/position_monitor.py` — Real-time position tracking
- `bitsentry/strategy_evaluator.py` — Strategy scoring and auditing
- `bitsentry/api/server.py` — FastAPI REST server (11 endpoints)
- `config/risk_rules.yaml` — Configurable risk parameters
- `run.py` — Server launcher with startup banner

## Setup

```bash
make install   # pip install -e .
make run       # start server on http://127.0.0.1:8000
make validate  # generate audit report + HTML
make verify    # verify SHA-256 integrity hash
```

## API Endpoints

| Method | Path | Description |
|--------|------|-------------|
| GET | `/health` | Server health + mode |
| GET | `/positions` | Open positions with safety ratings |
| GET | `/positions/summary` | GREEN/YELLOW/RED counts |
| GET | `/positions/safe-to-trade` | Pre-trade exposure check |
| POST | `/risk/check` | 5-layer risk middleware |
| GET | `/strategy/leaderboard` | Strategies ranked by profit factor |
| GET | `/strategy/{tag}` | Strategy health verdict |
| POST | `/strategy/record` | Record a trade result |
| GET | `/audit/report` | Full audit + SHA-256 hash |
| GET | `/audit/verify` | Verify integrity hash |
| GET | `/docs` | Swagger UI |

## Stack

Python 3.10+, FastAPI, SQLite, bgc CLI, Pydantic v2
