> For the complete documentation index, see [llms.txt](https://docs.cafx.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cafx.io/user-and-testing-guides/uat_beta_testing_guide.md).

# VIP Beta Testing Handbook

>

> **Welcome to the CAFX VIP Beta Program!**
>
> As a VIP Beta tester, you have early access to the CAFX Algorithmic-AI Trading Platform. This guide walks you through setting up your account, managing your API Key Vault, creating your first trading bots, monitoring performance, and providing feedback to help us refine the platform.

***

## 1. Program Overview & Objectives

CAFX is an advanced algorithmic-ai trading platform designed to automate Grid Trading across centralized cryptocurrency exchanges with built-in machine learning signals and dynamic risk management.

During this VIP Beta phase, your testing will help us validate:

* **Key Vault Security & API Connection**: Securely storing and managing exchange API keys across supported centralized exchanges (e.g. Bybit, Binance, MEXC, OKX, and major CCXT-supported exchanges) inside the CAFX Key Vault.
* **Exchange Order Count & Margin Safety**: Ensuring that open limit orders on your exchange **never exceed your grid size by more than one** and locked margin accurately matches your investment budget.
* **Email Notification Delivery**: Confirming real-time email alerts for fills, strategy switches, stop-loss events, and bot shutdowns.
* **Bot Termination & Clean Sweep SLA**: Confirming that stopping a bot cancels all orders, closes positions, and notifies you in **under 1 minute**.
* **Frontend UX & Session Security**: Verifying the **Show More** Bot Runtime State modal, smooth Key Vault operations, and proactive session expiration handling.

***

## 2. Beta Setup & Onboarding Checklist

Follow these quick steps before creating your first bot:

| Step  | Task                               | Details                                                                                                                                                                                      | Status |
| ----- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: |
| **1** | **Create Exchange API Keys**       | Generate API Key & Secret on your chosen exchange (**Bybit, Binance, MEXC, OKX, or any supported exchange**) with **Read & Trade (Futures/Spot)** permissions. *(Never enable Withdrawals).* |  \[ ]  |
| **2** | **Allocate Test Margin**           | Deposit USDT in your exchange Futures/Spot wallet (Recommended starting capital: **$20 – $50 USDT**).                                                                                        |  \[ ]  |
| **3** | **Log in to CAFX App**             | Access the CAFX App at [cafx.io](https://bot.cafx.io) using your invite credentials.                                                                                                         |  \[ ]  |
| **4** | **Save Keys to Vault & Add Email** | Go to **Key Vault** to securely store your Exchange API Key & Secret, and confirm your **Notification Email** address.                                                                       |  \[ ]  |

***

## 3. Key Trader Checklist Items (What to Look Out For)

> \[!IMPORTANT] When testing active bots on your exchange account, pay primary attention to these core checks:

### 🔍 Check 1: Open Order Count Guard

* **Rule**: The total number of open resting limit orders on your exchange orderbook must **NEVER exceed your grid size by more than 1**.
* **What to verify**:
  * For a 6-grid bot (`grid_size = 6`), CAFX caps active entries at half the grid size (≤ 3 active entry orders).
  * Adding 1 resting Take-Profit counter-order, your exchange orderbook should show at most **3 to 4 open orders total**.
  * **Red Flag**: If your exchange orderbook shows 10, 20, or 30+ duplicate orders for a single bot, report a bug immediately!

### 🔍 Check 2: Locked Margin vs. Investment Amount

* **Rule**: The total margin locked by open orders and positions on your exchange must **accurately match your allocated Investment Amount**.
* **What to verify**:
  * If you allocate `$50.00 USDT` investment amount, check your exchange wallet's **Locked / Order Margin**.
  * Locked margin should equal **≈ $50.00** (with a 0.5% safety fee buffer, i.e., **$49.75** net margin).
  * **Red Flag**: If locked margin exceeds your allocated investment amount or drains your main wallet balance beyond your configuration, report a bug immediately!

### 🔍 Check 3: Bot Termination & Clean Sweep SLA (< 1 Minute)

* **Rule**: When you click **Stop Bot**, the system must sweep the exchange clean and notify you in **under 1 minute**.
* **What to verify**:
  * Click **Stop Bot** on an active bot card.
  * Verify that all open limit orders are cancelled immediately on your exchange.
  * Verify that any open position is closed at market immediately.
  * Verify that you receive a **Bot Stopped Email Notification** in **under 60 seconds**.

### 🔍 Check 4: Email Notification Delivery

* **Rule**: All major trading events must generate real-time **Email Notifications** to your registered email address.
* **What to verify**:
  * Check your inbox for:
    * 📧 **Bot Started Notification**: Details investment amount, grid size, leverage, and range.
    * 📧 **Order Fill & Take-Profit Notification**: Real-time alert when an entry or TP order executes.
    * 📧 **Strategy Switch Notification**: Sent when ML models and trend metrics shift direction.
    * 📧 **Stop-Loss Alert**: Sent when emergency risk protection triggers.
    * 📧 **Bot Stopped Notification**: Delivered in under 1 minute.

***

## 4. Frontend & Product UX Requirements

### 🎨 4.1 "Show More" / Bot Runtime State Modal

* [ ] **Full Runtime State Display**:
  * Click the **"Show More"** or **"Details"** button on any active bot card.
  * Verify that the modal displays complete **Bot Runtime State** fields returned by the API:
    * **Grid Levels**: Full list of active grid price levels (`grid_levels: [f64]`).
    * **Trade Count**: Total trades completed.
    * **PnL Metrics**: Realized PnL, Unrealized PnL, and Total Net PnL.
    * **ML Prediction State**: Signal position (`Long`, `Short`, `Neutral`) and model confidence %.
    * **Trend Analysis State**: Market trend direction, strength, and confidence level.
    * **Timestamp**: Last state update timestamp (`updated_at`).
  * *Expected Result*: All values are displayed cleanly without `null`, `undefined`, or truncated data.

### 🔑 4.2 Key Vault (Exchange API Key Manager) Integration

* [ ] **Secure Key Storage & Connection Testing**:
  * Navigate to **Key Vault** in the app.
  * Test adding, editing, testing connection, and deleting API Keys & Secrets for **any supported cryptocurrency exchange** (Bybit, Binance, MEXC, OKX, etc.).
  * *Expected Result*: Key Vault validates API Key permissions (Read & Trade), encrypts sensitive secrets, updates state instantly with smooth loading feedback, and displays clear toast notifications.

### 🔐 4.3 Proactive Session Expiration Handling

* [ ] **Immediate Logout Redirect**:
  * Leave the app open until your authentication token/session expires.
  * *Expected Result*: The application detects token expiration reactively and **immediately redirects you to the `/login` page**, rather than waiting until you try to perform a trade or submit a form.

### 🌐 4.4 Industry-Standard UX Expectations

* [ ] **Action Feedback**: Every user interaction (start bot, stop bot, vault key update) displays an immediate toast notification.
* [ ] **Loading States**: Skeleton loaders or indicators appear while fetching live data.
* [ ] **Connection Resilience**: If internet or WebSocket drops, a non-intrusive reconnection banner appears and auto-reconnects smoothly.

***

## 5. Functional & Non-Functional Testing Checklist

### Module 1: Bot Creation & Parameter Validation

* [ ] **1.1 Input Parameter Validation**:
  * Test setting invalid inputs (e.g., `investment_amount` > available balance, `lower_price` >= `upper_price`, `acceptable_loss_per_grid` <= 0).
  * *Expected Result*: System returns clear error message and prevents bot creation.
* [ ] **1.2 Fee Safety Buffer**:
  * Verify that `investment_amount` automatically applies a 0.5% fee buffer upfront (`investment_amount *= 0.995`).
* [ ] **1.3 Minimum Notional & Step Precision**:
  * Create a bot with minimal capital ($10–$15 USDT).
  * *Expected Result*: System validates `min_notional` and `step_size` for the selected trading pair on the targeted exchange.

***

### Module 2: Grid Execution & Multi-Exchange Fidelity

```mermaid
graph TD
    nodeA["CAFX Engine"] --> nodeB["Bybit / Binance / MEXC / OKX"]
    nodeA --> nodeC["Other Supported CEXs"]
    
    nodeB -->|Verified Internally| nodeB1["Order Count <= Grid Size / 2 + 1 and Single Position Aggregation"]
    nodeC -->|Beta Tester Audited| nodeC1["Hedge Mode and reduce_only API Error Handling"]
```

* [ ] **2.1 Order Count & Counter-Order Placement**:
  * Verify that when an entry Buy order fills, a Sell counter-order (TP) is placed **1 grid step above** automatically.
  * Confirm that total open orders resting on the exchange remain ≤ (grid\_size / 2) + 1.
* [ ] **2.2 Multi-Exchange Behavior Audit**:
  * Test trading on your preferred exchange. *(Note: Bybit, Binance, and MEXC have been extensively verified internally; testing on all supported exchanges is highly encouraged).*
  * Verify that positions aggregate cleanly without exchange API error rejections.
* [ ] **2.3 Slot Recycling on Exit**:
  * Wait for a Take-Profit counter-order to fill.
  * *Expected Result*: Position closes, profit is realized, and active slots drop by 1, allowing a new entry order to activate.

***

### Module 3: Risk Protection & Hybrid Recovery Guard

* [ ] **3.1 Dynamic Stop-Loss Execution**:
  * Simulate or wait for a price breach below `sl_price`.
  * *Expected Result*: Bot executes emergency stop-loss, cancels open orders, closes position at market, and sends an email notification.
* [ ] **3.2 Hybrid Guard Verification**:
  * **Scenario A (`allow_grid_rebalancing = true`)**:
    * *Expected Result*: Upon stop-loss, grid levels automatically recenter around the fresh post-stop-loss market price, resuming grid trading in the new zone.
  * **Scenario B (`allow_grid_rebalancing = false`)**:
    * *Expected Result*: Original grid levels are preserved. The **Recovery Guard** blocks new order placement while price sits in the breach zone (`current_price <= sl_breach_level`). Trading resumes automatically when price recovers out of the breach zone.

***

## 6. Performance & Non-Functional Benchmarks

Beta testers should evaluate system performance against these key metrics:

| Metric                            | Target SLA                | Critical Threshold (Bug Report) |
| --------------------------------- | ------------------------- | ------------------------------- |
| **Order Placement Latency**       | < 500 ms                  | > 2,000 ms                      |
| **Price Ticker Staleness**        | < 2 sec                   | > 10 sec                        |
| **Evaluation Loop**               | 10 sec interval           | > 30 sec drift                  |
| **Email Notification Speed**      | **< 15 sec** after event  | **> 60 sec** delay              |
| **Bot Termination & Clean Sweep** | **< 60 sec** (< 1 minute) | > 120 sec delay                 |

***

## 7. How to Report Issues & Provide Feedback

If you run into any issues, unexpected behavior, or have feature suggestions:

* **Beta Support Channel**: Reach out in our private **Beta WhatsApp / Telegram** channel.
* **Email Support**: Reply to any CAFX trade email notification or write to `beta@cafx.io`.
* **Bug Reports**: When reporting a bug, please include:
  1. Your Exchange name & Trading Pair (e.g. Bybit - `BTC/USDT`).
  2. Number of open orders currently showing on your exchange.
  3. Your allocated Investment Amount vs current Locked Margin.
  4. Device & Browser (e.g. iPhone / Safari or Mac / Chrome).
  5. Grid Size & Config.
  6. Logs & Error messages.
  7. Risk Level & Config.

***

> *Thank you for participating in the CAFX Beta Campaign! Your feedback directly shapes our production release.*

***

<p align="center"><em>This Document is also available in Google Docs</em> <a href="https://github.com/cafx-org/Cafx/tree/main/docs/..."><em>Click Here</em></a></p>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cafx.io/user-and-testing-guides/uat_beta_testing_guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
