userstring필수
The wallet to anchor on. At least one of `user`/`condition` is required.
https://api.sandbase.ai/v1/api/polymarket/closed-positionsA wallet's closed positions with realized PnL, newest first, from the Data API v2.
출력이 여기에 표시됩니다
입력을 완료한 다음 Run을 클릭하세요.
Returns a wallet's closed Polymarket positions, newest first, with realized PnL, average entry price and market details for each position. It needs a user wallet address. You can narrow the list by market, event or title.
REALIZED_PNL.start and end.event_id or condition.curl -X POST "https://api.sandbase.ai/v1/api/polymarket/closed-positions" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user": "0xfe787d2da716d60e8acff57fb87eb13cd4d10319", "limit": 2}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
user | string | Yes | The wallet to anchor on. At least one of user/condition is required. |
condition | string | No | Condition id(s), comma-separated (at most 20 distinct values). With user, narrows that user's positions (all ids honoured). Without user, anchors on the market's holders; exactly one id is accepted there, and a multi |
cursor | string | No | Opaque pagination cursor from a prior response's next_cursor. It carries the page position, page size, and the status/sort/direction it was minted under. |
end | integer | No | Inclusive upper bound on last_event_at, epoch seconds; omit or 0 for unbounded. A position with no native economics carries no last_event_at and is therefore excluded by any bound, in either direction; a window |
event_id | string | No | Event id(s), comma-separated (at most 20 distinct values). User-anchored only. |
filter_amount | number | No | The filter floor. TOKENS: minimum CURRENT holding in shares (defaults to the 0.1 dust floor; applies to OPEN/REDEEMABLE; a user's CLOSED set is not narrowed by it, and on a market anchor it moves the OPEN/CLOSED |
filter_type | string | No | CASH or TOKENS; defaults to TOKENS (the /v2/trades-homogenized filter pair, replacing the former size_threshold). |
include_archived | boolean | No | Also include positions on archived markets; defaults to false. OPEN/REDEEMABLE/REDEEMABLE_LOST/MERGEABLE only; combining it with status=CLOSED is rejected. Inactive markets remain excluded either way. |
limit | integer | No | First-page size. Ignored when cursor is supplied (the cursor's size wins). |
sort_by | string | No | One of CURRENT_VALUE, PRICE, TOKENS, UNREALIZED_PNL, REALIZED_PNL, TOTAL_PNL, or TIMESTAMP (the row's last_event_at). PRICE ranks by the response's effective current_price on every supported anchor an |
sort_direction | string | No | ASC or DESC; defaults to DESC. |
start | integer | No | Inclusive lower bound on last_event_at, epoch seconds; omit or 0 for unbounded (the /v2/activity + /v2/trades vocabulary). |
title | string | No | Case-insensitive market-title substring filter, honoured on every anchor and status. SQL LIKE wildcards (%, _) keep their usual meaning; empty or whitespace-only is treated as absent; at most 200 characters. NOT carr |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": [
{
"archived": false,
"avg_price": 0.5412,
"condition_id": "0xcd84f901e5b49d769f43d1d78fdf5e913bd736be0dedb7acff688b9655e04ca4",
"current_price": 1.0,
"current_size": 0.0,
"current_value": 0.0,
"end_date": "2026-07-14",
"entry_cost_usdc": 0.0,
"entry_fees_usdc": 5248.774259,
"event_id": "655090",
"event_slug": "mlb-atl-pit-2026-07-07",
"first_entry_at": 1783464052
}
],
"pagination": {
"has_more": true,
"limit": 2,
"next_cursor": "eyJkYXRhIjp7InR5cGUiOiJwb3NpdGlvbnMiLCJwYXJhbXMiOnsibCI6MiwiZCI6MiwiayI6IjM4Njk5…",
"offset": 0
}
}
| Field | Meaning |
|---|---|
data[].title / data[].slug / data[].event_slug | Market title and the slugs that identify the market and its event. |
data[].condition_id / data[].token_id | Identifiers for the market condition and the outcome token the wallet held. Use condition_id in the condition filter. |
data[].outcome / data[].opposite_outcome | The outcome the wallet held and the other side of the same market. |
data[].avg_price | Average entry price of the position, between 0 and 1. |
data[].realized_pnl / data[].total_pnl | Profit or loss locked in on the position. For closed rows both values match and unrealized_pnl is 0.0. |
data[].percent_realized_pnl | Realized profit as a percentage figure, for example 84.6171. |
data[].total_size / data[].total_cost_usdc / data[].entry_fees_usdc | Total shares bought, total cost in USDC, and fees paid in USDC. |
data[].first_entry_at / data[].last_event_at | Epoch second timestamps of the wallet's first entry and its latest event on the position. last_event_at drives the sort order and the start/end filters. |
data[].current_price | Latest price of the outcome. A value of 1.0 on a closed row means the outcome won. |
pagination.has_more / pagination.next_cursor | Shows whether more rows exist and gives the cursor for the next page. |
pagination.next_cursor back as cursor to get the next page. The cursor sets the page size, so limit is ignored when you send it.title and condition on every page of a walk, because the cursor does not carry them.condition_id values are hex strings. event_id is a numeric string. Timestamps are epoch seconds.$0.012 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
빌드를 시작하세요
통합 인증 및 사용량 추적이 있는 플랫폼 API 엔드포인트입니다.
curl -X POST "https://api.sandbase.ai/v1/api/polymarket/closed-positions" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"user": "0xfe787d2da716d60e8acff57fb87eb13cd4d10319",
"limit": 2
}'서버 환경에 SandBase API 키를 설정하세요. 요청에는 Bearer 인증이 사용됩니다.
export SANDBASE_API_KEY="YOUR_API_KEY"키는 서버에 보관하세요. 브라우저 코드에 노출하지 마세요.
userstring필수The wallet to anchor on. At least one of `user`/`condition` is required.
conditionstringCondition id(s), comma-separated (at most 20 distinct values). With `user`, narrows that user's positions (all ids honoured). Without `user`, anchors on the market's holders; exactly one id is accepted there, and a multi-id list is rejected rather than silently truncated.
limitintegerFirst-page size. Ignored when `cursor` is supplied (the cursor's size wins).
cursorstringOpaque pagination cursor from a prior response's `next_cursor`. It carries the page position, page size, and the status/sort/direction it was minted under.
event_idstringEvent id(s), comma-separated (at most 20 distinct values). User-anchored only.
titlestringCase-insensitive market-title substring filter, honoured on every anchor and status. SQL LIKE wildcards (`%`, `_`) keep their usual meaning; empty or whitespace-only is treated as absent; at most 200 characters. NOT carried by the cursor: re-send it on every page of a walk (like `condition` and the
filter_typestring`CASH` or `TOKENS`; defaults to `TOKENS` (the /v2/trades-homogenized filter pair, replacing the former `size_threshold`).
filter_amountnumberThe filter floor. `TOKENS`: minimum CURRENT holding in shares (defaults to the 0.1 dust floor; applies to `OPEN`/`REDEEMABLE`; a user's `CLOSED` set is not narrowed by it, and on a market anchor it moves the OPEN/CLOSED boundary). `CASH`: minimum mark-to-market `current_value` in USDC, on top of the
include_archivedbooleanAlso include positions on archived markets; defaults to `false`. `OPEN`/`REDEEMABLE`/`REDEEMABLE_LOST`/`MERGEABLE` only; combining it with `status=CLOSED` is rejected. Inactive markets remain excluded either way.
sort_bystringOne of `CURRENT_VALUE`, `PRICE`, `TOKENS`, `UNREALIZED_PNL`, `REALIZED_PNL`, `TOTAL_PNL`, or `TIMESTAMP` (the row's `last_event_at`). `PRICE` ranks by the response's effective `current_price` on every supported anchor and status. On `REDEEMABLE`, the existing winners-first partition remains ahead of
startintegerInclusive lower bound on `last_event_at`, epoch seconds; omit or `0` for unbounded (the `/v2/activity` + `/v2/trades` vocabulary).
endintegerInclusive upper bound on `last_event_at`, epoch seconds; omit or `0` for unbounded. A position with no native economics carries no `last_event_at` and is therefore **excluded by any bound**, in either direction; a window asks which positions moved inside it, and a row with no clock has no answer. Un
sort_directionstring`ASC` or `DESC`; defaults to `DESC`.
이 API의 저장된 예시 응답입니다. 확인할 때 라이브 요청은 실행되지 않습니다.
저장된 응답이 게시되지 않았습니다. Playground에서 API를 실행해 응답을 확인하세요.
더 살펴보기
| API | 가격 | 응답 |
|---|---|---|
Polymarket | $0.012 / 호출 | JSON |
Polymarket | $0.012 / 호출 | JSON |
Polymarket | $0.012 / 호출 | JSON |
Polymarket | $0.012 / 호출 | JSON |
Polymarket | $0.012 / 호출 | JSON |
Polymarket | $0.012 / 호출 | JSON |
질문
Authorization 헤더(Bearer)에 SandBase API 키를 넣고, 매개변수를 JSON 본문으로 담아 https://api.sandbase.ai/v1/api/polymarket/closed-positions에 POST 요청을 보내세요. 이 페이지의 Playground에서도 코드를 작성하지 않고 직접 테스트할 수 있습니다.
호출당 $0.012, SandBase 잔액에서 청구됩니다. 사용한 호출에 대해서만 요금이 부과되며, 구독은 없습니다.
필수: user (string). 선택: condition (string), limit (integer), cursor (string), event_id (string), title (string) 및 filter_type (string) 외 6개. 이 페이지의 Parameters 표와 Playground에 모든 필드가 나와 있습니다.
같은 HTTP 요청에서 반환되는 JSON 응답입니다(동기식). 이 페이지의 README에 샘플 응답이 포함되어 있습니다.
아니요. Polymarket Closed Positions은 SandBase를 통해 실행되므로, SandBase API 키 하나로 이 엔드포인트와 카탈로그의 다른 모든 API 및 모델을 사용할 수 있습니다. Polymarket API 액세스를 별도로 신청할 필요는 없습니다.