> For the complete documentation index, see [llms.txt](https://trident-cas.sabn.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trident-cas.sabn.xyz/api/stats.md).

# Stats

**Base Path**: `/stats`

***

### Endpoints

#### 1. GET `/stats/profile`

Get aggregate profile statistics for the authenticated user (wagers, earnings, deposits, withdrawals).

* **Authentication Required**: Yes
* **Method**: `GET`

**Response**

```json
{
    "wagerAmount": 5000.0,
    "earningAmount": 4800.0,
    "depositAmount": 1000.0,
    "withdrawAmount": 800.0
}
```

***

#### 2. GET `/stats/games`

Get game history for the authenticated user.

* **Authentication Required**: Yes
* **Method**: `GET`

**Query Parameters**

| Parameter | Type   | Description                                                  |
| --------- | ------ | ------------------------------------------------------------ |
| `page`    | Number | Page number (default: 1)                                     |
| `limit`   | Number | Items per page (default: 10)                                 |
| `sort`    | String | `most-recent`, `least-recent`, `most-earned`, `least-earned` |
| `search`  | String | Filter by game name                                          |

**Response**

```json
{
    "success": true,
    "data": {
        "games": [
            {
                "game": "mines",
                "wager": 10.0,
                "earning": 25.0,
                "multiplier": 2.5,
                "date": 1735700000000
            }
        ],
        "totalGames": 50,
        "totalPages": 5,
        "currentPage": 1
    },
    "hasMore": true
}
```

***

#### 3. GET `/stats/payments`

Get payment history (deposits and withdrawals) for the authenticated user.

* **Authentication Required**: Yes
* **Method**: `GET`

**Query Parameters**

| Parameter | Type   | Description                                                      |
| --------- | ------ | ---------------------------------------------------------------- |
| `page`    | Number | Page number (default: 1)                                         |
| `limit`   | Number | Items per page (default: 10)                                     |
| `type`    | String | `all`, `deposits`, `withdraws`                                   |
| `sort`    | String | `most-recent`, `least-recent`, `highest-amount`, `lowest-amount` |
| `search`  | String | Search by txhash, chain, or asset                                |

**Response**

```json
{
    "success": true,
    "data": {
        "payments": [
            {
                "_id": "...",
                "type": "deposit",
                "chain": "ETH",
                "asset": "USDT",
                "amount": "100.000000",
                "usdAmount": 100.0,
                "txhash": "0x...",
                "to": "0xYourWalletAddress...",
                "date": 1735700000000
            }
        ],
        "totalPayments": 10,
        "totalPages": 1,
        "currentPage": 1
    },
    "hasMore": false
}
```

***

#### 4. GET `/stats/fairness`

Get Provably Fair data for user's gameplay history across Mines, Battles, and other games.

* **Authentication Required**: Yes
* **Method**: `GET`

**Query Parameters**

| Parameter | Type   | Description                                  |
| --------- | ------ | -------------------------------------------- |
| `page`    | Number | Page number (default: 1)                     |
| `limit`   | Number | Items per page (default: 10)                 |
| `sort`    | String | `most-recent`, `least-recent`                |
| `search`  | String | Search by server seed, client seed, or nonce |
| `game`    | String | `all` (default)                              |

**Response**

```json
{
    "success": true,
    "data": {
        "items": [
            {
                "id": "...",
                "game": "mines",
                "betAmount": 10,
                "payout": 0,
                "status": "lost",
                "completedAt": 1735700000000,
                "pf": {
                    "serverSeedCommitment": "...",
                    "serverSeed": "...",
                    "clientSeed": "...",
                    "nonce": 1,
                    "publicSeed": "...",
                    "round": 0
                }
            }
        ],
        "total": 100,
        "totalPages": 10,
        "currentPage": 1
    }
}
```

***

#### 5. GET `/stats/live-bets`

Get a paginated history of live bets and high rolls across all games. Useful for displaying historical bets below the initial 10 WebSocket items or rendering a full pagination view.

* **Authentication Required**: No
* **Method**: `GET`

**Query Parameters**

| Parameter | Type   | Description                                                                     |
| --------- | ------ | ------------------------------------------------------------------------------- |
| `page`    | Number | Page number (default: 1)                                                        |
| `limit`   | Number | Items per page (default: 10)                                                    |
| `type`    | String | `live-bets` (default) or `high-rolls` (filters wager >= 50 or multiplier >= 10) |

**Response**

```json
{
    "success": true,
    "data": {
        "bets": [
            {
                "id": "645abc123...",
                "game": "Plinko",
                "pfp": "url_to_avatar",
                "user": "Albert Flores",
                "wager": 32.0,
                "multiplier": 1.0,
                "payout": 160.0,
                "date": 1735700000000
            }
        ],
        "total": 100,
        "totalPages": 10,
        "currentPage": 1
    },
    "hasMore": true
}
```


---

# 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:

```
GET https://trident-cas.sabn.xyz/api/stats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
