> ## Documentation Index
> Fetch the complete documentation index at: https://docs.4casters.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Obter volume casado

> Volume casado total do site em um intervalo de datas

Retorna o volume casado total do site para um intervalo inclusivo de **dias de calendário do Leste dos EUA (ET)**.

## Como o volume é calculado

Cada aposta casada contribui com os valores apostados de **ambos os lados** do casamento:

* a **aposta do taker** (o valor casado), mais
* a **aposta do maker**, derivada das odds do taker: a odds positivas do taker é `stake × odds / 100`, a odds negativas do taker é `stake × −100 / odds`.

De forma equivalente, da perspectiva de qualquer uma das partes cada aposta casada contribui com **`risk + win`**: sua aposta mais seu ganho potencial, porque seu ganho potencial é exatamente a aposta da contraparte. Uma tomada de $100 a +150 conta como $250 de volume ($100 do lado taker + $150 do lado maker).

> [!NOTE]
>
> O volume usa os valores apostados brutos antes da comissão. Os campos `risk` / `win` de [Obter apostas casadas](https://docs.4casters.io/pt-BR/pages/rest/user/get-matched-bets.md) já incluem comissão, então somá-los diferirá ligeiramente deste endpoint.

## Atualidade

Os dias ET finalizados são lidos de um arquivo diário fechado. Se o intervalo terminar hoje (um `endDate` posterior a hoje é cortado para hoje), um agregado ao vivo dos casamentos de hoje é somado, de modo que a porção do dia atual é atualizada em tempo real à medida que as apostas casam.

## Requisição

`GET /exchange/getMatchedVolume`

**startDate** `string` *required*

Primeiro dia de calendário ET do intervalo, `YYYY-MM-DD` (inclusivo).

**endDate** `string` *required*

Último dia de calendário ET do intervalo, `YYYY-MM-DD` (inclusivo). Não deve ser anterior a `startDate`. As datas posteriores a hoje são cortadas para hoje.

```bash curl theme={null}
curl "https://api.4casters.io/exchange/getMatchedVolume?startDate=2026-08-10&endDate=2026-08-11" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Resposta

**data** `object`

**data**

**startDate** `string`

Eco da data de início solicitada.

**endDate** `string`

Eco da data de fim solicitada (antes do corte).

**matchedVolume** `number`

Volume casado total em USD: a soma dos valores apostados dos dois lados (risco + ganho) de cada aposta casada no intervalo.

```json Resposta de exemplo theme={null}
{
  "data": {
    "startDate": "2026-08-10",
    "endDate": "2026-08-11",
    "matchedVolume": 6447933.012757301
  }
}
```

## Limites de taxa

Não há um limite específico do endpoint: aplica-se somente o [limite global por IP](https://docs.4casters.io/pt-BR/pages/rate-limiting.md#per-ip-rest) (1,500 requisições a cada 10 segundos e 100,000 a cada 10 minutos). Para dashboards, consultar uma vez a cada poucos segundos é mais que suficiente; tenha em conta que os dias finalizados nunca mudam, então só os intervalos que incluem hoje se beneficiam de consultar de novo.

## Erros

| Status | Significado |
| - | - |
| `400` | `startDate` / `endDate` falta ou está malformado (deve ser `YYYY-MM-DD`), ou `startDate` é posterior a `endDate`. |
| `401` | Token de autenticação ausente ou inválido. |
| `429` | Limite de taxa global por IP excedido. Respeite o cabeçalho `Retry-After`. |
| `503` | O timeout de 15 segundos do servidor foi atingido. É seguro tentar novamente. |


## OpenAPI

````yaml GET /exchange/getMatchedVolume
openapi: 3.1.0
info:
  title: 4casters REST API
  version: 1.0.0
  description: >-
    Public REST API for the 4casters peer-to-peer betting exchange. Use this API
    to manage your account, query the orderbook and games, and place / edit /
    cancel orders.


    All responses (unless noted otherwise) are JSON envelopes of the form `{
    "data": ... }`.
  contact:
    name: 4casters
    url: https://4casters.io
servers:
  - url: https://api.4casters.io
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Login and account session management
  - name: User
    description: Read account info, bets, and orders
  - name: Orders
    description: Place, edit, look up, and cancel orders
  - name: Markets
    description: Browse leagues, games, participants, and orderbooks
  - name: Affiliate
    description: Affiliate / referral commission
paths:
  /exchange/getMatchedVolume:
    get:
      tags:
        - Markets
      summary: Get matched volume
      description: >-
        Return total sitewide matched volume for an inclusive range of
        US-Eastern (ET) calendar days.


        Every matched bet contributes the stakes of **both** sides to the total:
        the taker's stake plus the maker's stake (derived from the taker odds).
        Equivalently, from either party's perspective each match contributes
        `risk + win` — your stake plus your potential profit, which is exactly
        the counterparty's stake. Commission is not included.


        Past days are read from a finalized daily archive; a range that ends
        today (or later — the end is clamped to today) additionally includes a
        live aggregate of today's matches, so today's portion updates in real
        time.
      parameters:
        - name: startDate
          in: query
          required: true
          schema:
            type: string
            format: date
            example: '2026-08-01'
          description: First ET calendar day of the range (`YYYY-MM-DD`, inclusive).
        - name: endDate
          in: query
          required: true
          schema:
            type: string
            format: date
            example: '2026-08-11'
          description: >-
            Last ET calendar day of the range (`YYYY-MM-DD`, inclusive). Dates
            after today are clamped to today. Must not be before `startDate`.
      responses:
        '200':
          description: Total matched volume for the range
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      startDate:
                        type: string
                        format: date
                        description: Echo of the requested start date.
                      endDate:
                        type: string
                        format: date
                        description: Echo of the requested end date (before clamping).
                      matchedVolume:
                        type: number
                        description: >-
                          Total matched volume in USD: the sum of both sides'
                          stakes (risk + win) of every bet matched in the range.
                example:
                  data:
                    startDate: '2026-08-10'
                    endDate: '2026-08-11'
                    matchedVolume: 6447933.01
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpError'
    Unauthorized:
      description: Missing or invalid auth token
  schemas:
    HttpError:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Pass your auth token in the `Authorization` header. The `Bearer` prefix
        is optional; the server also accepts a signed `auth` cookie or a `token`
        field in the request body.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.