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

# 获取已撮合成交量

> 一段日期范围内的全站已撮合成交量

返回一段 **美国东部时间（ET）日历日** 范围（首尾两天均含）内的全站已撮合成交量。

<h2 id="how-volume-is-calculated">
  成交量如何计算
</h2>

每笔已撮合投注计入撮合**双方**的本金：

* **吃单方本金**（撮合金额），加上
* **挂单方本金**，由吃单赔率推导 — 吃单赔率为正时为 `stake × odds / 100`，为负时为 `stake × −100 / odds`。

等价地，从任一方看，每笔已撮合投注计入 **`risk + win`** — 你的本金加上潜在利润，因为你的潜在利润恰好是对手方的本金。一笔 $100、+150 的吃单计为 $250 成交量（吃单方 $100 + 挂单方 $150）。

<Note>
  成交量使用佣金前的原始本金。[获取已撮合投注](/zh-Hans/pages/rest/user/get-matched-bets) 上的 `risk` / `win` 字段已计入佣金，因此把它们相加会与此端点略有差异。
</Note>

<h2 id="freshness">
  新鲜度
</h2>

已结束的 ET 日从最终日归档读取。如果范围结束于今天（晚于今天的 `endDate` 会被截断到今天），会再加上当天撮合的实时汇总，因此当天部分会随投注撮合实时更新。

<h2 id="request">
  请求
</h2>

`GET /exchange/getMatchedVolume`

<ParamField query="startDate" type="string" required>
  范围的第一个 ET 日历日，`YYYY-MM-DD`（含）。
</ParamField>

<ParamField query="endDate" type="string" required>
  范围的最后一个 ET 日历日，`YYYY-MM-DD`（含）。不得早于 `startDate`。晚于今天的日期会被截断到今天。
</ParamField>

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

<h2 id="response">
  响应
</h2>

<ResponseField name="data" type="object">
  <Expandable title="data">
    <ResponseField name="startDate" type="string">所请求开始日期的回显。</ResponseField>
    <ResponseField name="endDate" type="string">所请求结束日期的回显（截断前）。</ResponseField>
    <ResponseField name="matchedVolume" type="number">以美元计的已撮合成交量总计：范围内每笔已撮合投注双方本金（风险额 + 可赢额）之和。</ResponseField>
  </Expandable>
</ResponseField>

```json 响应示例 theme={null}
{
  "data": {
    "startDate": "2026-08-10",
    "endDate": "2026-08-11",
    "matchedVolume": 6447933.012757301
  }
}
```

<h2 id="rate-limits">
  速率限制
</h2>

没有端点级限制 — 仅适用 [全局每 IP 限制](/zh-Hans/pages/rest/introduction#rate-limiting)（滚动每分钟 3,000 次请求）。对于仪表盘，每隔几秒轮询一次完全足够；注意已最终确定的日期不会再变化，因此只有包含今天的范围才有必要重新轮询。

<h2 id="errors">
  错误
</h2>

| 状态 | 含义 |
| - | - |
| `400` | `startDate` / `endDate` 缺失或格式错误（必须为 `YYYY-MM-DD`），或 `startDate` 晚于 `endDate`。 |
| `401` | 认证令牌缺失或无效。 |
| `429` | 超出全局每 IP 速率限制。请遵守 `Retry-After` 响应头。 |
| `503` | 触发了服务端 15 秒超时。可以安全重试。 |


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