# 取得 Polymarket 錢包活動

**API:** Data API

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

**Tags:** Polymarket

取得預測市場活動。使用 condition-ID 值篩選市場，以 start 與 end 指定時間範圍，並以 limit 與 offset 分頁。其他選擇器包括 eventId、type、side、sortBy 與 sortDirection。成功回應是頂層的活動記錄陣列。

### 定價參考

- 計量方式：以成功請求為固定成本基礎。
- 參考請求預估：USD 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"
}
```
