# 获取 Polymarket 钱包活动

**API:** Data API

**Endpoint:** `GET /v1/beta/polymarket/activity`

**Tags:** Polymarket

获取预测市场活动。使用 condition-ID 值筛选市场，使用 start 和 end 指定时间窗口，使用 limit 和 offset 分页。其他选择器包括 eventId、type、side、sortBy 和 sortDirection。成功响应是顶层的活动记录数组。

### 计费参考

- 计量方式：按成功请求的固定成本计费。
- 参考请求估算：0.012 美元。

仅供参考的元数据，不是账户报价、保证价格或消费上限。资源额度不同于 Felo 额度。最终扣费以 Felo 计费记录为准。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `end` | query | no | integer | 活动时间窗口的上界时间戳（epoch 秒）。省略则使用默认值（当前时间）；比 `end` 更新的行会被排除。 |
| `eventId` | query | no | array | 以逗号分隔的事件 ID 列表。与 market 互斥。 |
| `excludeDepositsWithdrawals` | query | no | boolean, default: true | 排除充值和提现记录。默认值 `true` 即使 `type` 请求了这些记录也会生效，因此要获取充值和提现记录必须传 `false`。 |
| `limit` | query | no | integer, default: 100 | 每页大小。超过最大值的会被限制为 500。 |
| `market` | query | no | array | 以逗号分隔的条件 ID 列表。与 eventId 互斥。 |
| `offset` | query | no | integer, default: 0 | 分页起始索引。超过上限的请求会以 400 拒绝（绝不会静默截断）。要读取超过 offset 5000 的历史数据，请在 `start`/`end` 窗口内分页——每个窗口都有各自的 offset 预算。 |
| `side` | query | no | string, enum: "BUY", "SELL" |  |
| `sortBy` | query | no | string, enum: "TIMESTAMP", "TOKENS", "CASH", default: "TIMESTAMP" |  |
| `sortDirection` | query | no | string, enum: "ASC", "DESC", default: "DESC" | `DESC`（默认）最先返回最新的行，`ASC` 最先返回最旧的行。两种顺序都是稳定的——同一查询在任意 `limit`/`offset` 下返回相同的行，因此各页可以无缝拼接，不会出现空缺或重复。 |
| `start` | query | no | integer | 活动时间窗口的下界时间戳（epoch 秒）。省略或传 `0` 使用默认窗口（最近约 3 年）；传入正数 epoch（例如 `1`）可获取完整历史。当 `sortDirection=ASC` 时，省略 `start` 即从账户历史起点读取（无默认窗口）。 |
| `type` | query | no | array | 以逗号分隔的活动类型列表。DEPOSIT 和 WITHDRAWAL 记录还需要 `excludeDepositsWithdrawals=false`。 |
| `user` | query | yes | string |  |

## Responses

### 200 — 成功

Headers:
- `X-Request-Id` (string) — 联系 Felo 支持时需提供的请求标识符。

**application/json**

Schema: array

```json
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/Response65D835437A58_Activity"
  }
}
```

### 400 — 无法处理该请求。请检查请求参数。

### 401 — 需要有效的 Felo API 密钥。

### 402 — 由于未满足计费要求，请求无法继续。

### 403 — 该账户无权执行此操作。

### 429 — 已达到请求或支出限额。

### 502 — 服务无法完成该请求。

### 503 — API 或计费服务暂时不可用。

### 504 — 服务在处理请求时超时。

### default — 错误响应；上游透传响应可能采用提供方格式

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response65D835437A58_Activity

`#/components/schemas/Response65D835437A58_Activity`

```json
{
  "type": "object",
  "properties": {
    "proxyWallet": {
      "$ref": "#/components/schemas/Response65D835437A58_Address"
    },
    "timestamp": {
      "type": "integer",
      "format": "int64"
    },
    "conditionId": {
      "$ref": "#/components/schemas/Response65D835437A58_Hash64"
    },
    "type": {
      "type": "string",
      "enum": [
        "TRADE",
        "SPLIT",
        "MERGE",
        "REDEEM",
        "REWARD",
        "CONVERSION",
        "DEPOSIT",
        "WITHDRAWAL",
        "YIELD",
        "MAKER_REBATE",
        "TAKER_REBATE",
        "REFERRAL_REWARD"
      ]
    },
    "size": {
      "type": "number",
      "description": "此行的代币数量。在 `REDEEM` 行中，它是为该行结果销毁的代币数量，因此赎回市场的双方会为每个结果返回一行，而不是返回一行合并记录。"
    },
    "usdcSize": {
      "type": "number",
      "description": "此行的 USDC 数量。在 `REDEEM` 行中，它是该行结果的赔付金额，落败结果为 `0`；一次赎回的各行合计为总赔付金额。"
    },
    "transactionHash": {
      "type": "string"
    },
    "price": {
      "type": "number"
    },
    "asset": {
      "type": "string",
      "description": "此行所指的代币 ID。在 `REDEEM` 行中填入该行结算的代币。当该行不针对特定代币时为空。"
    },
    "side": {
      "type": "string",
      "enum": [
        "BUY",
        "SELL"
      ]
    },
    "outcomeIndex": {
      "type": "integer",
      "description": "此行结果在市场 `outcomes` 数组中的从零开始的索引，因此 `outcome` 始终等于 `outcomes[outcomeIndex]`。在 `REDEEM` 行中，它标识该行结算的结果，而不是市场的获胜结果。`999` 表示无法确定结果，此时 `outcome` 为空。"
    },
    "title": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "icon": {
      "type": "string",
      "description": "市场配图。当市场没有自己的图标时，依次回退到市场图片，再回退到父活动的图标和图片。在 `CONVERSION` 行中为空。"
    },
    "eventSlug": {
      "type": "string"
    },
    "outcome": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "pseudonym": {
      "type": "string"
    },
    "bio": {
      "type": "string"
    },
    "profileImage": {
      "type": "string"
    },
    "profileImageOptimized": {
      "type": "string"
    },
    "isCombo": {
      "type": "boolean",
      "description": "当此行属于组合（多市场）头寸时为 true。仅作为标志——此处不内嵌组合详情。该行的 conditionId 等于组合的 combo_condition_id；可通过 market_id 将其传给 /v1/activity/combos 或 /v1/positions/combos，以获取各腿和详情。非组合行会省略该字段。"
    }
  }
}
```

### Response65D835437A58_Address

`#/components/schemas/Response65D835437A58_Address`

```json
{
  "type": "string",
  "description": "用户资料地址（0x 前缀，40 个十六进制字符）",
  "pattern": "^0x[a-fA-F0-9]{40}$",
  "example": "0x56687bf447db6ffa42ffe2204a05edaa20f55839"
}
```

### Response65D835437A58_Hash64

`#/components/schemas/Response65D835437A58_Hash64`

```json
{
  "type": "string",
  "description": "以 0x 开头的 64 位十六进制字符串",
  "pattern": "^0x[a-fA-F0-9]{64}$",
  "example": "0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917"
}
```
