# AegisTrade AI — Acceptance Criteria & Verification Matrix

| Area | Acceptance Test / Invariant | Verification Method |
| :--- | :--- | :--- |
| **Safety / Risk** | Order sizing never risks $>0.25\%$ equity by default. | Unit test with mocked balances from \$100 to \$100,000. |
| **Safety / Risk** | Trades rejected when calculated size $<$ exchange minimum notional. | Unit test for small account \$50 balance on BTCUSDT. |
| **Safety / Risk** | Daily loss $\ge 1.0\%$ trips intraday trading suspension. | Risk engine test simulating losing trades until threshold. |
| **Safety / Risk** | Overall drawdown $\ge 5.0\%$ trips persistent Kill Switch. | Simulated account drawdown test verifying DB persistence. |
| **Kill Switch** | Survives backend crash/reboot and blocks orders on startup. | Persistence test with process re-initialization. |
| **Bybit API** | Isolated Demo (`api-demo.bybit.com`) vs Live endpoints. | Adapter unit test verifying host URL and credential isolation. |
| **Execution** | Live mode disabled by default (`ENABLE_LIVE_TRADING=False`). | Configuration & API test verifying 403 on unauthorized live switch. |
| **ML Engine** | Causal feature engineering has zero lookahead bias. | Chronological leakage test comparing shifted vs unshifted data. |
| **Expectancy** | EV engine accounts for fees, slippage, and spread. | Cost calculation test showing negative EV turns into `NO-TRADE`. |
| **Dashboard** | Full dark-mode UI with live charts, risk monitor & kill switch. | React production build and integration endpoint tests. |
