全面优化实盘对接没有验证
This commit is contained in:
+194
@@ -0,0 +1,194 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get closed positions for a user
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/data-openapi.yaml get /closed-positions
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Polymarket Data API
|
||||
version: 1.0.0
|
||||
description: >
|
||||
HTTP API for Polymarket data. This specification documents all public
|
||||
routes.
|
||||
servers:
|
||||
- url: https://data-api.polymarket.com
|
||||
description: Relative server (same host)
|
||||
security: []
|
||||
tags:
|
||||
- name: Data API Status
|
||||
description: Data API health check
|
||||
- name: Core
|
||||
- name: Builders
|
||||
- name: Misc
|
||||
paths:
|
||||
/closed-positions:
|
||||
get:
|
||||
tags:
|
||||
- Core
|
||||
summary: Get closed positions for a user
|
||||
parameters:
|
||||
- in: query
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/components/schemas/Address'
|
||||
description: The address of the user in question
|
||||
- in: query
|
||||
name: market
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
description: >-
|
||||
The conditionId of the market in question. Supports multiple csv
|
||||
separated values. Cannot be used with the eventId param.
|
||||
- in: query
|
||||
name: title
|
||||
schema:
|
||||
type: string
|
||||
maxLength: 100
|
||||
description: Filter by market title
|
||||
- in: query
|
||||
name: eventId
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: integer
|
||||
minimum: 1
|
||||
description: >-
|
||||
The event id of the event in question. Supports multiple csv
|
||||
separated values. Returns positions for all markets for those event
|
||||
ids. Cannot be used with the market param.
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
default: 10
|
||||
minimum: 0
|
||||
maximum: 50
|
||||
description: The max number of positions to return
|
||||
- in: query
|
||||
name: offset
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
minimum: 0
|
||||
maximum: 100000
|
||||
description: The starting index for pagination
|
||||
- in: query
|
||||
name: sortBy
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- REALIZEDPNL
|
||||
- TITLE
|
||||
- PRICE
|
||||
- AVGPRICE
|
||||
- TIMESTAMP
|
||||
default: REALIZEDPNL
|
||||
description: The sort criteria
|
||||
- in: query
|
||||
name: sortDirection
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- ASC
|
||||
- DESC
|
||||
default: DESC
|
||||
description: The sort direction
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ClosedPosition'
|
||||
'400':
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
components:
|
||||
schemas:
|
||||
Address:
|
||||
type: string
|
||||
description: User Profile Address (0x-prefixed, 40 hex chars)
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
Hash64:
|
||||
type: string
|
||||
description: 0x-prefixed 64-hex string
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917'
|
||||
ClosedPosition:
|
||||
type: object
|
||||
properties:
|
||||
proxyWallet:
|
||||
$ref: '#/components/schemas/Address'
|
||||
asset:
|
||||
type: string
|
||||
conditionId:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
avgPrice:
|
||||
type: number
|
||||
totalBought:
|
||||
type: number
|
||||
realizedPnl:
|
||||
type: number
|
||||
curPrice:
|
||||
type: number
|
||||
timestamp:
|
||||
type: integer
|
||||
format: int64
|
||||
title:
|
||||
type: string
|
||||
slug:
|
||||
type: string
|
||||
icon:
|
||||
type: string
|
||||
eventSlug:
|
||||
type: string
|
||||
outcome:
|
||||
type: string
|
||||
outcomeIndex:
|
||||
type: integer
|
||||
oppositeOutcome:
|
||||
type: string
|
||||
oppositeAsset:
|
||||
type: string
|
||||
endDate:
|
||||
type: string
|
||||
ErrorResponse:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get current positions for a user
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/data-openapi.yaml get /positions
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Polymarket Data API
|
||||
version: 1.0.0
|
||||
description: >
|
||||
HTTP API for Polymarket data. This specification documents all public
|
||||
routes.
|
||||
servers:
|
||||
- url: https://data-api.polymarket.com
|
||||
description: Relative server (same host)
|
||||
security: []
|
||||
tags:
|
||||
- name: Data API Status
|
||||
description: Data API health check
|
||||
- name: Core
|
||||
- name: Builders
|
||||
- name: Misc
|
||||
paths:
|
||||
/positions:
|
||||
get:
|
||||
tags:
|
||||
- Core
|
||||
summary: Get current positions for a user
|
||||
parameters:
|
||||
- in: query
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/components/schemas/Address'
|
||||
description: User address (required)
|
||||
- in: query
|
||||
name: market
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
description: >-
|
||||
Comma-separated list of condition IDs. Mutually exclusive with
|
||||
eventId.
|
||||
- in: query
|
||||
name: eventId
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: integer
|
||||
minimum: 1
|
||||
description: Comma-separated list of event IDs. Mutually exclusive with market.
|
||||
- in: query
|
||||
name: sizeThreshold
|
||||
schema:
|
||||
type: number
|
||||
default: 1
|
||||
minimum: 0
|
||||
- in: query
|
||||
name: redeemable
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- in: query
|
||||
name: mergeable
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
default: 100
|
||||
minimum: 0
|
||||
maximum: 500
|
||||
- in: query
|
||||
name: offset
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
minimum: 0
|
||||
maximum: 10000
|
||||
- in: query
|
||||
name: sortBy
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- CURRENT
|
||||
- INITIAL
|
||||
- TOKENS
|
||||
- CASHPNL
|
||||
- PERCENTPNL
|
||||
- TITLE
|
||||
- RESOLVING
|
||||
- PRICE
|
||||
- AVGPRICE
|
||||
default: TOKENS
|
||||
- in: query
|
||||
name: sortDirection
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- ASC
|
||||
- DESC
|
||||
default: DESC
|
||||
- in: query
|
||||
name: title
|
||||
schema:
|
||||
type: string
|
||||
maxLength: 100
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Position'
|
||||
'400':
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
components:
|
||||
schemas:
|
||||
Address:
|
||||
type: string
|
||||
description: User Profile Address (0x-prefixed, 40 hex chars)
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
Hash64:
|
||||
type: string
|
||||
description: 0x-prefixed 64-hex string
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917'
|
||||
Position:
|
||||
type: object
|
||||
properties:
|
||||
proxyWallet:
|
||||
$ref: '#/components/schemas/Address'
|
||||
asset:
|
||||
type: string
|
||||
conditionId:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
size:
|
||||
type: number
|
||||
avgPrice:
|
||||
type: number
|
||||
initialValue:
|
||||
type: number
|
||||
currentValue:
|
||||
type: number
|
||||
cashPnl:
|
||||
type: number
|
||||
percentPnl:
|
||||
type: number
|
||||
totalBought:
|
||||
type: number
|
||||
realizedPnl:
|
||||
type: number
|
||||
percentRealizedPnl:
|
||||
type: number
|
||||
curPrice:
|
||||
type: number
|
||||
redeemable:
|
||||
type: boolean
|
||||
mergeable:
|
||||
type: boolean
|
||||
title:
|
||||
type: string
|
||||
slug:
|
||||
type: string
|
||||
icon:
|
||||
type: string
|
||||
eventSlug:
|
||||
type: string
|
||||
outcome:
|
||||
type: string
|
||||
outcomeIndex:
|
||||
type: integer
|
||||
oppositeOutcome:
|
||||
type: string
|
||||
oppositeAsset:
|
||||
type: string
|
||||
endDate:
|
||||
type: string
|
||||
negativeRisk:
|
||||
type: boolean
|
||||
ErrorResponse:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
@@ -0,0 +1,193 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get positions for a market
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/data-openapi.yaml get /v1/market-positions
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Polymarket Data API
|
||||
version: 1.0.0
|
||||
description: >
|
||||
HTTP API for Polymarket data. This specification documents all public
|
||||
routes.
|
||||
servers:
|
||||
- url: https://data-api.polymarket.com
|
||||
description: Relative server (same host)
|
||||
security: []
|
||||
tags:
|
||||
- name: Data API Status
|
||||
description: Data API health check
|
||||
- name: Core
|
||||
- name: Builders
|
||||
- name: Misc
|
||||
paths:
|
||||
/v1/market-positions:
|
||||
get:
|
||||
tags:
|
||||
- Core
|
||||
summary: Get positions for a market
|
||||
parameters:
|
||||
- in: query
|
||||
name: market
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
description: The condition ID of the market to query positions for
|
||||
- in: query
|
||||
name: user
|
||||
schema:
|
||||
$ref: '#/components/schemas/Address'
|
||||
description: Filter to a single user by proxy wallet address
|
||||
- in: query
|
||||
name: status
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- OPEN
|
||||
- CLOSED
|
||||
- ALL
|
||||
default: ALL
|
||||
description: |
|
||||
Filter positions by status.
|
||||
- `OPEN` — Only positions with size > 0.01
|
||||
- `CLOSED` — Only positions with size <= 0.01
|
||||
- `ALL` — All positions regardless of size
|
||||
- in: query
|
||||
name: sortBy
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- TOKENS
|
||||
- CASH_PNL
|
||||
- REALIZED_PNL
|
||||
- TOTAL_PNL
|
||||
default: TOTAL_PNL
|
||||
description: |
|
||||
Sort positions by:
|
||||
- `TOKENS` — Position size (number of tokens)
|
||||
- `CASH_PNL` — Unrealized cash PnL
|
||||
- `REALIZED_PNL` — Realized PnL
|
||||
- `TOTAL_PNL` — Total PnL (cash_pnl + realized_pnl)
|
||||
- in: query
|
||||
name: sortDirection
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- ASC
|
||||
- DESC
|
||||
default: DESC
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
default: 50
|
||||
minimum: 0
|
||||
maximum: 500
|
||||
description: Max number of positions to return per outcome token
|
||||
- in: query
|
||||
name: offset
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
minimum: 0
|
||||
maximum: 10000
|
||||
description: Pagination offset per outcome token
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/MetaMarketPositionV1'
|
||||
'400':
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
components:
|
||||
schemas:
|
||||
Hash64:
|
||||
type: string
|
||||
description: 0x-prefixed 64-hex string
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917'
|
||||
Address:
|
||||
type: string
|
||||
description: User Profile Address (0x-prefixed, 40 hex chars)
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
MetaMarketPositionV1:
|
||||
type: object
|
||||
properties:
|
||||
token:
|
||||
type: string
|
||||
description: The outcome token asset ID
|
||||
positions:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/MarketPositionV1'
|
||||
ErrorResponse:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
required:
|
||||
- error
|
||||
MarketPositionV1:
|
||||
type: object
|
||||
properties:
|
||||
proxyWallet:
|
||||
$ref: '#/components/schemas/Address'
|
||||
name:
|
||||
type: string
|
||||
profileImage:
|
||||
type: string
|
||||
verified:
|
||||
type: boolean
|
||||
asset:
|
||||
type: string
|
||||
conditionId:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
avgPrice:
|
||||
type: number
|
||||
size:
|
||||
type: number
|
||||
currPrice:
|
||||
type: number
|
||||
currentValue:
|
||||
type: number
|
||||
cashPnl:
|
||||
type: number
|
||||
totalBought:
|
||||
type: number
|
||||
realizedPnl:
|
||||
type: number
|
||||
totalPnl:
|
||||
type: number
|
||||
outcome:
|
||||
type: string
|
||||
outcomeIndex:
|
||||
type: integer
|
||||
|
||||
````
|
||||
@@ -0,0 +1,140 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get top holders for markets
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/data-openapi.yaml get /holders
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Polymarket Data API
|
||||
version: 1.0.0
|
||||
description: >
|
||||
HTTP API for Polymarket data. This specification documents all public
|
||||
routes.
|
||||
servers:
|
||||
- url: https://data-api.polymarket.com
|
||||
description: Relative server (same host)
|
||||
security: []
|
||||
tags:
|
||||
- name: Data API Status
|
||||
description: Data API health check
|
||||
- name: Core
|
||||
- name: Builders
|
||||
- name: Misc
|
||||
paths:
|
||||
/holders:
|
||||
get:
|
||||
tags:
|
||||
- Core
|
||||
summary: Get top holders for markets
|
||||
parameters:
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
minimum: 0
|
||||
maximum: 20
|
||||
description: Maximum number of holders to return per token. Capped at 20.
|
||||
- in: query
|
||||
name: market
|
||||
required: true
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
description: Comma-separated list of condition IDs.
|
||||
- in: query
|
||||
name: minBalance
|
||||
schema:
|
||||
type: integer
|
||||
default: 1
|
||||
minimum: 0
|
||||
maximum: 999999
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/MetaHolder'
|
||||
'400':
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
components:
|
||||
schemas:
|
||||
Hash64:
|
||||
type: string
|
||||
description: 0x-prefixed 64-hex string
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917'
|
||||
MetaHolder:
|
||||
type: object
|
||||
properties:
|
||||
token:
|
||||
type: string
|
||||
holders:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Holder'
|
||||
ErrorResponse:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
required:
|
||||
- error
|
||||
Holder:
|
||||
type: object
|
||||
properties:
|
||||
proxyWallet:
|
||||
$ref: '#/components/schemas/Address'
|
||||
bio:
|
||||
type: string
|
||||
asset:
|
||||
type: string
|
||||
pseudonym:
|
||||
type: string
|
||||
amount:
|
||||
type: number
|
||||
displayUsernamePublic:
|
||||
type: boolean
|
||||
outcomeIndex:
|
||||
type: integer
|
||||
name:
|
||||
type: string
|
||||
profileImage:
|
||||
type: string
|
||||
profileImageOptimized:
|
||||
type: string
|
||||
Address:
|
||||
type: string
|
||||
description: User Profile Address (0x-prefixed, 40 hex chars)
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
|
||||
````
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get total value of a user's positions
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/data-openapi.yaml get /value
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Polymarket Data API
|
||||
version: 1.0.0
|
||||
description: >
|
||||
HTTP API for Polymarket data. This specification documents all public
|
||||
routes.
|
||||
servers:
|
||||
- url: https://data-api.polymarket.com
|
||||
description: Relative server (same host)
|
||||
security: []
|
||||
tags:
|
||||
- name: Data API Status
|
||||
description: Data API health check
|
||||
- name: Core
|
||||
- name: Builders
|
||||
- name: Misc
|
||||
paths:
|
||||
/value:
|
||||
get:
|
||||
tags:
|
||||
- Core
|
||||
summary: Get total value of a user's positions
|
||||
parameters:
|
||||
- in: query
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/components/schemas/Address'
|
||||
- in: query
|
||||
name: market
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Value'
|
||||
'400':
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
components:
|
||||
schemas:
|
||||
Address:
|
||||
type: string
|
||||
description: User Profile Address (0x-prefixed, 40 hex chars)
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
Hash64:
|
||||
type: string
|
||||
description: 0x-prefixed 64-hex string
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917'
|
||||
Value:
|
||||
type: object
|
||||
properties:
|
||||
user:
|
||||
$ref: '#/components/schemas/Address'
|
||||
value:
|
||||
type: number
|
||||
ErrorResponse:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
+162
@@ -0,0 +1,162 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get trader leaderboard rankings
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/data-openapi.yaml get /v1/leaderboard
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Polymarket Data API
|
||||
version: 1.0.0
|
||||
description: >
|
||||
HTTP API for Polymarket data. This specification documents all public
|
||||
routes.
|
||||
servers:
|
||||
- url: https://data-api.polymarket.com
|
||||
description: Relative server (same host)
|
||||
security: []
|
||||
tags:
|
||||
- name: Data API Status
|
||||
description: Data API health check
|
||||
- name: Core
|
||||
- name: Builders
|
||||
- name: Misc
|
||||
paths:
|
||||
/v1/leaderboard:
|
||||
get:
|
||||
tags:
|
||||
- Core
|
||||
summary: Get trader leaderboard rankings
|
||||
parameters:
|
||||
- in: query
|
||||
name: category
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- OVERALL
|
||||
- POLITICS
|
||||
- SPORTS
|
||||
- ESPORTS
|
||||
- CRYPTO
|
||||
- CULTURE
|
||||
- MENTIONS
|
||||
- WEATHER
|
||||
- ECONOMICS
|
||||
- TECH
|
||||
- FINANCE
|
||||
default: OVERALL
|
||||
description: Market category for the leaderboard
|
||||
- in: query
|
||||
name: timePeriod
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- DAY
|
||||
- WEEK
|
||||
- MONTH
|
||||
- ALL
|
||||
default: DAY
|
||||
description: Time period for leaderboard results
|
||||
- in: query
|
||||
name: orderBy
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- PNL
|
||||
- VOL
|
||||
default: PNL
|
||||
description: Leaderboard ordering criteria
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
default: 25
|
||||
minimum: 1
|
||||
maximum: 50
|
||||
description: Max number of leaderboard traders to return
|
||||
- in: query
|
||||
name: offset
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
minimum: 0
|
||||
maximum: 1000
|
||||
description: Starting index for pagination
|
||||
- in: query
|
||||
name: user
|
||||
schema:
|
||||
$ref: '#/components/schemas/Address'
|
||||
description: Limit leaderboard to a single user by address
|
||||
- in: query
|
||||
name: userName
|
||||
schema:
|
||||
type: string
|
||||
description: Limit leaderboard to a single username
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TraderLeaderboardEntry'
|
||||
'400':
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
components:
|
||||
schemas:
|
||||
Address:
|
||||
type: string
|
||||
description: User Profile Address (0x-prefixed, 40 hex chars)
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
TraderLeaderboardEntry:
|
||||
type: object
|
||||
properties:
|
||||
rank:
|
||||
type: string
|
||||
description: The rank position of the trader
|
||||
proxyWallet:
|
||||
$ref: '#/components/schemas/Address'
|
||||
userName:
|
||||
type: string
|
||||
description: The trader's username
|
||||
vol:
|
||||
type: number
|
||||
description: Trading volume for this trader
|
||||
pnl:
|
||||
type: number
|
||||
description: Profit and loss for this trader
|
||||
profileImage:
|
||||
type: string
|
||||
description: URL to the trader's profile image
|
||||
xUsername:
|
||||
type: string
|
||||
description: The trader's X (Twitter) username
|
||||
verifiedBadge:
|
||||
type: boolean
|
||||
description: Whether the trader has a verified badge
|
||||
ErrorResponse:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get trades for a user or markets
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/data-openapi.yaml get /trades
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Polymarket Data API
|
||||
version: 1.0.0
|
||||
description: >
|
||||
HTTP API for Polymarket data. This specification documents all public
|
||||
routes.
|
||||
servers:
|
||||
- url: https://data-api.polymarket.com
|
||||
description: Relative server (same host)
|
||||
security: []
|
||||
tags:
|
||||
- name: Data API Status
|
||||
description: Data API health check
|
||||
- name: Core
|
||||
- name: Builders
|
||||
- name: Misc
|
||||
paths:
|
||||
/trades:
|
||||
get:
|
||||
tags:
|
||||
- Core
|
||||
summary: Get trades for a user or markets
|
||||
parameters:
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
default: 100
|
||||
minimum: 0
|
||||
maximum: 10000
|
||||
- in: query
|
||||
name: offset
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
minimum: 0
|
||||
maximum: 10000
|
||||
- in: query
|
||||
name: takerOnly
|
||||
schema:
|
||||
type: boolean
|
||||
default: true
|
||||
- in: query
|
||||
name: filterType
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- CASH
|
||||
- TOKENS
|
||||
description: Must be provided together with filterAmount.
|
||||
- in: query
|
||||
name: filterAmount
|
||||
schema:
|
||||
type: number
|
||||
minimum: 0
|
||||
description: Must be provided together with filterType.
|
||||
- in: query
|
||||
name: market
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
description: >-
|
||||
Comma-separated list of condition IDs. Mutually exclusive with
|
||||
eventId.
|
||||
- in: query
|
||||
name: eventId
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: integer
|
||||
minimum: 1
|
||||
description: Comma-separated list of event IDs. Mutually exclusive with market.
|
||||
- in: query
|
||||
name: user
|
||||
schema:
|
||||
$ref: '#/components/schemas/Address'
|
||||
- in: query
|
||||
name: side
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
- in: query
|
||||
name: start
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 0
|
||||
description: >-
|
||||
Lower-bound timestamp (epoch seconds) for the trade window. Omit or
|
||||
pass `0` for the default window (most recent ~3 years); pass a
|
||||
positive epoch (e.g. `1`) to retrieve full history.
|
||||
- in: query
|
||||
name: end
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 0
|
||||
description: >-
|
||||
Upper-bound timestamp (epoch seconds) for the trade window. Omit for
|
||||
the default (current time); rows newer than `end` are excluded.
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Trade'
|
||||
'400':
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
components:
|
||||
schemas:
|
||||
Hash64:
|
||||
type: string
|
||||
description: 0x-prefixed 64-hex string
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917'
|
||||
Address:
|
||||
type: string
|
||||
description: User Profile Address (0x-prefixed, 40 hex chars)
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
Trade:
|
||||
type: object
|
||||
properties:
|
||||
proxyWallet:
|
||||
$ref: '#/components/schemas/Address'
|
||||
side:
|
||||
type: string
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
asset:
|
||||
type: string
|
||||
conditionId:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
size:
|
||||
type: number
|
||||
price:
|
||||
type: number
|
||||
timestamp:
|
||||
type: integer
|
||||
format: int64
|
||||
title:
|
||||
type: string
|
||||
slug:
|
||||
type: string
|
||||
icon:
|
||||
type: string
|
||||
eventSlug:
|
||||
type: string
|
||||
outcome:
|
||||
type: string
|
||||
outcomeIndex:
|
||||
type: integer
|
||||
name:
|
||||
type: string
|
||||
pseudonym:
|
||||
type: string
|
||||
bio:
|
||||
type: string
|
||||
profileImage:
|
||||
type: string
|
||||
profileImageOptimized:
|
||||
type: string
|
||||
transactionHash:
|
||||
type: string
|
||||
ErrorResponse:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
@@ -0,0 +1,255 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get user activity
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/data-openapi.yaml get /activity
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Polymarket Data API
|
||||
version: 1.0.0
|
||||
description: >
|
||||
HTTP API for Polymarket data. This specification documents all public
|
||||
routes.
|
||||
servers:
|
||||
- url: https://data-api.polymarket.com
|
||||
description: Relative server (same host)
|
||||
security: []
|
||||
tags:
|
||||
- name: Data API Status
|
||||
description: Data API health check
|
||||
- name: Core
|
||||
- name: Builders
|
||||
- name: Misc
|
||||
paths:
|
||||
/activity:
|
||||
get:
|
||||
tags:
|
||||
- Core
|
||||
summary: Get user activity
|
||||
parameters:
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
default: 100
|
||||
minimum: 0
|
||||
maximum: 500
|
||||
- in: query
|
||||
name: offset
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
minimum: 0
|
||||
maximum: 10000
|
||||
- in: query
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/components/schemas/Address'
|
||||
- in: query
|
||||
name: market
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
description: >-
|
||||
Comma-separated list of condition IDs. Mutually exclusive with
|
||||
eventId.
|
||||
- in: query
|
||||
name: eventId
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: integer
|
||||
minimum: 1
|
||||
description: Comma-separated list of event IDs. Mutually exclusive with market.
|
||||
- in: query
|
||||
name: type
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
enum:
|
||||
- TRADE
|
||||
- SPLIT
|
||||
- MERGE
|
||||
- REDEEM
|
||||
- REWARD
|
||||
- CONVERSION
|
||||
- DEPOSIT
|
||||
- WITHDRAWAL
|
||||
- YIELD
|
||||
- MAKER_REBATE
|
||||
- TAKER_REBATE
|
||||
- REFERRAL_REWARD
|
||||
- in: query
|
||||
name: start
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 0
|
||||
description: >-
|
||||
Lower-bound timestamp (epoch seconds) for the activity window. Omit
|
||||
or pass `0` for the default window (most recent ~3 years); pass a
|
||||
positive epoch (e.g. `1`) to retrieve full history.
|
||||
- in: query
|
||||
name: end
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 0
|
||||
description: >-
|
||||
Upper-bound timestamp (epoch seconds) for the activity window. Omit
|
||||
for the default (current time); rows newer than `end` are excluded.
|
||||
- in: query
|
||||
name: sortBy
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- TIMESTAMP
|
||||
- TOKENS
|
||||
- CASH
|
||||
default: TIMESTAMP
|
||||
- in: query
|
||||
name: sortDirection
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- ASC
|
||||
- DESC
|
||||
default: DESC
|
||||
- in: query
|
||||
name: side
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Activity'
|
||||
'400':
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
components:
|
||||
schemas:
|
||||
Address:
|
||||
type: string
|
||||
description: User Profile Address (0x-prefixed, 40 hex chars)
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
Hash64:
|
||||
type: string
|
||||
description: 0x-prefixed 64-hex string
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917'
|
||||
Activity:
|
||||
type: object
|
||||
properties:
|
||||
proxyWallet:
|
||||
$ref: '#/components/schemas/Address'
|
||||
timestamp:
|
||||
type: integer
|
||||
format: int64
|
||||
conditionId:
|
||||
$ref: '#/components/schemas/Hash64'
|
||||
type:
|
||||
type: string
|
||||
enum:
|
||||
- TRADE
|
||||
- SPLIT
|
||||
- MERGE
|
||||
- REDEEM
|
||||
- REWARD
|
||||
- CONVERSION
|
||||
- DEPOSIT
|
||||
- WITHDRAWAL
|
||||
- YIELD
|
||||
- MAKER_REBATE
|
||||
- TAKER_REBATE
|
||||
- REFERRAL_REWARD
|
||||
size:
|
||||
type: number
|
||||
usdcSize:
|
||||
type: number
|
||||
transactionHash:
|
||||
type: string
|
||||
price:
|
||||
type: number
|
||||
asset:
|
||||
type: string
|
||||
side:
|
||||
type: string
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
outcomeIndex:
|
||||
type: integer
|
||||
title:
|
||||
type: string
|
||||
slug:
|
||||
type: string
|
||||
icon:
|
||||
type: string
|
||||
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 when this row is part of a combinatorial (multi-market)
|
||||
position. Flag only — combo detail is not embedded here. The row's
|
||||
conditionId equals the combo's combo_condition_id; pass it to
|
||||
/v1/activity/combos or /v1/positions/combos via market_id to fetch
|
||||
legs and detail. Omitted on non-combo rows.
|
||||
ErrorResponse:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
@@ -0,0 +1,280 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get user combo activity
|
||||
|
||||
> Combo lifecycle and redeem events (split / merge / convert / compress / wrap / unwrap / redeem) for a user, with per-leg breakdown. The combo counterpart to /activity trade rows. Also available at /v1/data/user/{address}/activity/combos (address from the path).
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/data-openapi.yaml get /v1/activity/combos
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Polymarket Data API
|
||||
version: 1.0.0
|
||||
description: >
|
||||
HTTP API for Polymarket data. This specification documents all public
|
||||
routes.
|
||||
servers:
|
||||
- url: https://data-api.polymarket.com
|
||||
description: Relative server (same host)
|
||||
security: []
|
||||
tags:
|
||||
- name: Data API Status
|
||||
description: Data API health check
|
||||
- name: Core
|
||||
- name: Builders
|
||||
- name: Misc
|
||||
paths:
|
||||
/v1/activity/combos:
|
||||
get:
|
||||
tags:
|
||||
- Core
|
||||
summary: Get user combo activity
|
||||
description: >-
|
||||
Combo lifecycle and redeem events (split / merge / convert / compress /
|
||||
wrap / unwrap / redeem) for a user, with per-leg breakdown. The combo
|
||||
counterpart to /activity trade rows. Also available at
|
||||
/v1/data/user/{address}/activity/combos (address from the path).
|
||||
parameters:
|
||||
- in: query
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/components/schemas/Address'
|
||||
- in: query
|
||||
name: market_id
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ComboConditionId'
|
||||
description: >-
|
||||
Comma-separated combo_condition_id values to filter to specific
|
||||
combos. These equal the market_id of isCombo rows on /activity. Omit
|
||||
for all of the user's combo activity.
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
default: 50
|
||||
minimum: 0
|
||||
maximum: 500
|
||||
- in: query
|
||||
name: offset
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
minimum: 0
|
||||
maximum: 10000
|
||||
- in: query
|
||||
name: cursor
|
||||
schema:
|
||||
type: string
|
||||
description: >-
|
||||
Opaque continuation token from a previous response's
|
||||
pagination.next_cursor. When present it supersedes offset (which is
|
||||
ignored). Invalid, tampered, or cross-endpoint tokens return 400.
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CombosActivityResponse'
|
||||
'400':
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
components:
|
||||
schemas:
|
||||
Address:
|
||||
type: string
|
||||
description: User Profile Address (0x-prefixed, 40 hex chars)
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
ComboConditionId:
|
||||
type: string
|
||||
description: >-
|
||||
Combo condition ID (0x-prefixed, 62 hex chars / bytes31). Equals the
|
||||
market_id (unified) / conditionId (legacy) of isCombo rows on /activity.
|
||||
pattern: ^0x[a-fA-F0-9]{62}$
|
||||
example: '0x0391ab0ebea17b65ba87e071b0566e816b0000000000000000000000000000'
|
||||
CombosActivityResponse:
|
||||
type: object
|
||||
properties:
|
||||
activity:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ComboActivity'
|
||||
pagination:
|
||||
$ref: '#/components/schemas/Pagination'
|
||||
ErrorResponse:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
required:
|
||||
- error
|
||||
ComboActivity:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
event_kind:
|
||||
type: string
|
||||
description: >-
|
||||
Raw on-chain event, e.g. PositionsSplit, PositionsMerged,
|
||||
PositionRedeemed.
|
||||
side:
|
||||
type: string
|
||||
description: Normalized label for rendering.
|
||||
enum:
|
||||
- Split
|
||||
- Merge
|
||||
- Convert
|
||||
- Compress
|
||||
- Wrap
|
||||
- Unwrap
|
||||
- Redeem
|
||||
module_kind:
|
||||
type: string
|
||||
description: Always Combinatorial.
|
||||
user_address:
|
||||
$ref: '#/components/schemas/Address'
|
||||
combo_condition_id:
|
||||
$ref: '#/components/schemas/ComboConditionId'
|
||||
combo_position_id:
|
||||
type: string
|
||||
module_id:
|
||||
type: integer
|
||||
amount_usdc:
|
||||
type: number
|
||||
nullable: true
|
||||
description: Lifecycle amount; null on redeems.
|
||||
payout_usdc:
|
||||
type: number
|
||||
nullable: true
|
||||
description: Redeem payout; null on lifecycle events.
|
||||
timestamp:
|
||||
type: integer
|
||||
format: int64
|
||||
tx_dttm:
|
||||
type: string
|
||||
description: RFC3339 UTC
|
||||
tx_hash:
|
||||
type: string
|
||||
log_index:
|
||||
type: integer
|
||||
block_number:
|
||||
type: integer
|
||||
format: int64
|
||||
legs:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ComboLeg'
|
||||
Pagination:
|
||||
type: object
|
||||
description: >-
|
||||
Standard pagination metadata. No total count; has_more is derived from
|
||||
page fullness. next_cursor is opaque.
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
offset:
|
||||
type: integer
|
||||
has_more:
|
||||
type: boolean
|
||||
next_cursor:
|
||||
type: string
|
||||
nullable: true
|
||||
description: >-
|
||||
Opaque signed cursor for the next page; null when has_more is false.
|
||||
Pass it back verbatim as ?cursor= on the next request (keep the same
|
||||
sort where the endpoint has one). Never parse or construct it. On
|
||||
cursor-enabled endpoints this makes deep pagination O(page) and
|
||||
stable against concurrent inserts.
|
||||
ComboLeg:
|
||||
type: object
|
||||
properties:
|
||||
leg_index:
|
||||
type: integer
|
||||
leg_position_id:
|
||||
type: string
|
||||
leg_condition_id:
|
||||
type: string
|
||||
description: The leg market's condition ID (distinct from the combo's).
|
||||
leg_outcome_index:
|
||||
type: integer
|
||||
leg_outcome_label:
|
||||
type: string
|
||||
leg_status:
|
||||
type: string
|
||||
description: Placeholder (OPEN) until leg-resolution integration ships.
|
||||
leg_resolved_at:
|
||||
type: string
|
||||
nullable: true
|
||||
leg_current_price:
|
||||
type: string
|
||||
description: Placeholder ("0") until live-price integration ships.
|
||||
market:
|
||||
$ref: '#/components/schemas/ComboMarket'
|
||||
ComboMarket:
|
||||
type: object
|
||||
properties:
|
||||
market_id:
|
||||
type: string
|
||||
slug:
|
||||
type: string
|
||||
title:
|
||||
type: string
|
||||
outcome:
|
||||
type: string
|
||||
image_url:
|
||||
type: string
|
||||
icon_url:
|
||||
type: string
|
||||
category:
|
||||
type: string
|
||||
subcategory:
|
||||
type: string
|
||||
tags:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
end_date:
|
||||
type: string
|
||||
description: RFC3339 UTC
|
||||
event:
|
||||
$ref: '#/components/schemas/ComboEvent'
|
||||
ComboEvent:
|
||||
type: object
|
||||
properties:
|
||||
event_id:
|
||||
type: string
|
||||
event_slug:
|
||||
type: string
|
||||
event_title:
|
||||
type: string
|
||||
event_image:
|
||||
type: string
|
||||
|
||||
````
|
||||
@@ -0,0 +1,329 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get user combo positions
|
||||
|
||||
> Combinatorial (multi-market) positions held by a user, with per-leg breakdown. Also available at /v1/data/user/{address}/positions/combos (address from the path).
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/data-openapi.yaml get /v1/positions/combos
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Polymarket Data API
|
||||
version: 1.0.0
|
||||
description: >
|
||||
HTTP API for Polymarket data. This specification documents all public
|
||||
routes.
|
||||
servers:
|
||||
- url: https://data-api.polymarket.com
|
||||
description: Relative server (same host)
|
||||
security: []
|
||||
tags:
|
||||
- name: Data API Status
|
||||
description: Data API health check
|
||||
- name: Core
|
||||
- name: Builders
|
||||
- name: Misc
|
||||
paths:
|
||||
/v1/positions/combos:
|
||||
get:
|
||||
tags:
|
||||
- Core
|
||||
summary: Get user combo positions
|
||||
description: >-
|
||||
Combinatorial (multi-market) positions held by a user, with per-leg
|
||||
breakdown. Also available at /v1/data/user/{address}/positions/combos
|
||||
(address from the path).
|
||||
parameters:
|
||||
- in: query
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/components/schemas/Address'
|
||||
- in: query
|
||||
name: status
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- OPEN
|
||||
- PARTIAL
|
||||
- RESOLVED_WIN
|
||||
- RESOLVED_LOSS
|
||||
- in: query
|
||||
name: sort
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- current_value_desc
|
||||
- first_entry_desc
|
||||
- entry_cost_desc
|
||||
- resolved_at_desc
|
||||
- updated_asc
|
||||
default: current_value_desc
|
||||
- in: query
|
||||
name: market_id
|
||||
style: form
|
||||
explode: false
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ComboConditionId'
|
||||
description: >-
|
||||
Comma-separated combo_condition_id values to filter to specific
|
||||
combos. These equal the market_id of isCombo rows on /activity. Omit
|
||||
for all of the user's combos.
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
minimum: 0
|
||||
maximum: 1000
|
||||
- in: query
|
||||
name: offset
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
minimum: 0
|
||||
maximum: 100000
|
||||
- in: query
|
||||
name: updatedAfter
|
||||
schema:
|
||||
type: integer
|
||||
description: >-
|
||||
Incremental-sync watermark (epoch seconds, inclusive): only rows
|
||||
whose updated_at is at or after this time. Positions mutate on
|
||||
resolution and redemption, so this catches changes a creation-time
|
||||
filter cannot. In sync mode
|
||||
(updatedAfter/updatedBefore/sort=updated_asc) every live row is
|
||||
returned regardless of balance, and the effective upper bound is
|
||||
clamped ~90s behind now (commit-visibility safety lag) — very recent
|
||||
rows appear on the next poll. Rows at the boundary may re-deliver:
|
||||
upsert by (combo_condition_id, combo_position_id).
|
||||
- in: query
|
||||
name: updatedBefore
|
||||
schema:
|
||||
type: integer
|
||||
description: >-
|
||||
Optional upper bound (epoch seconds, inclusive) for updated_at;
|
||||
clamped to the safety lag. Must be >= updatedAfter.
|
||||
- in: query
|
||||
name: cursor
|
||||
schema:
|
||||
type: string
|
||||
description: >-
|
||||
Opaque continuation token from a previous response's
|
||||
pagination.next_cursor. When present it supersedes offset (which is
|
||||
ignored). Invalid, tampered, or cross-endpoint tokens return 400.
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CombosResponse'
|
||||
'400':
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'500':
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
components:
|
||||
schemas:
|
||||
Address:
|
||||
type: string
|
||||
description: User Profile Address (0x-prefixed, 40 hex chars)
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
ComboConditionId:
|
||||
type: string
|
||||
description: >-
|
||||
Combo condition ID (0x-prefixed, 62 hex chars / bytes31). Equals the
|
||||
market_id (unified) / conditionId (legacy) of isCombo rows on /activity.
|
||||
pattern: ^0x[a-fA-F0-9]{62}$
|
||||
example: '0x0391ab0ebea17b65ba87e071b0566e816b0000000000000000000000000000'
|
||||
CombosResponse:
|
||||
type: object
|
||||
properties:
|
||||
combos:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ComboPosition'
|
||||
pagination:
|
||||
$ref: '#/components/schemas/Pagination'
|
||||
ErrorResponse:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
required:
|
||||
- error
|
||||
ComboPosition:
|
||||
type: object
|
||||
properties:
|
||||
combo_condition_id:
|
||||
$ref: '#/components/schemas/ComboConditionId'
|
||||
combo_position_id:
|
||||
type: string
|
||||
module_id:
|
||||
type: integer
|
||||
description: 3 = Combinatorial
|
||||
user_address:
|
||||
$ref: '#/components/schemas/Address'
|
||||
shares_balance:
|
||||
type: string
|
||||
description: Decimal string (precision-preserving).
|
||||
entry_avg_price_usdc:
|
||||
type: string
|
||||
entry_cost_usdc:
|
||||
type: string
|
||||
description: >-
|
||||
REMAINING cost basis (entry_avg_price × shares_balance). Reads ~0
|
||||
after a winning combo is redeemed — use total_cost_usdc to display
|
||||
what was paid on closed positions.
|
||||
realized_payout_usdc:
|
||||
type: string
|
||||
description: >-
|
||||
Gross redemption proceeds (winning combo shares redeem 1:1 at $1).
|
||||
"0.00" while OPEN / unredeemed / RESOLVED_LOSS; accumulates under
|
||||
PARTIAL. Gross payout, not net PnL — net = realized_payout_usdc −
|
||||
total_cost_usdc.
|
||||
total_cost_usdc:
|
||||
type: string
|
||||
description: >-
|
||||
Original cost basis = entry_avg_price × (shares_balance +
|
||||
realized_payout). Survives redemption burning the shares; equals
|
||||
entry_cost_usdc while OPEN.
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- OPEN
|
||||
- PARTIAL
|
||||
- RESOLVED_WIN
|
||||
- RESOLVED_LOSS
|
||||
first_entry_at:
|
||||
type: string
|
||||
description: RFC3339 UTC
|
||||
resolved_at:
|
||||
type: string
|
||||
nullable: true
|
||||
updated_at:
|
||||
type: string
|
||||
description: >-
|
||||
Last-modified time (UTC, ISO 8601). Bumps on any recompute of the
|
||||
row (trade, redemption, resolution classification) — the
|
||||
incremental-sync watermark field. Omitted on responses served by the
|
||||
legacy backend.
|
||||
legs_total:
|
||||
type: integer
|
||||
legs_resolved:
|
||||
type: integer
|
||||
legs_pending:
|
||||
type: integer
|
||||
legs:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ComboLeg'
|
||||
Pagination:
|
||||
type: object
|
||||
description: >-
|
||||
Standard pagination metadata. No total count; has_more is derived from
|
||||
page fullness. next_cursor is opaque.
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
offset:
|
||||
type: integer
|
||||
has_more:
|
||||
type: boolean
|
||||
next_cursor:
|
||||
type: string
|
||||
nullable: true
|
||||
description: >-
|
||||
Opaque signed cursor for the next page; null when has_more is false.
|
||||
Pass it back verbatim as ?cursor= on the next request (keep the same
|
||||
sort where the endpoint has one). Never parse or construct it. On
|
||||
cursor-enabled endpoints this makes deep pagination O(page) and
|
||||
stable against concurrent inserts.
|
||||
ComboLeg:
|
||||
type: object
|
||||
properties:
|
||||
leg_index:
|
||||
type: integer
|
||||
leg_position_id:
|
||||
type: string
|
||||
leg_condition_id:
|
||||
type: string
|
||||
description: The leg market's condition ID (distinct from the combo's).
|
||||
leg_outcome_index:
|
||||
type: integer
|
||||
leg_outcome_label:
|
||||
type: string
|
||||
leg_status:
|
||||
type: string
|
||||
description: Placeholder (OPEN) until leg-resolution integration ships.
|
||||
leg_resolved_at:
|
||||
type: string
|
||||
nullable: true
|
||||
leg_current_price:
|
||||
type: string
|
||||
description: Placeholder ("0") until live-price integration ships.
|
||||
market:
|
||||
$ref: '#/components/schemas/ComboMarket'
|
||||
ComboMarket:
|
||||
type: object
|
||||
properties:
|
||||
market_id:
|
||||
type: string
|
||||
slug:
|
||||
type: string
|
||||
title:
|
||||
type: string
|
||||
outcome:
|
||||
type: string
|
||||
image_url:
|
||||
type: string
|
||||
icon_url:
|
||||
type: string
|
||||
category:
|
||||
type: string
|
||||
subcategory:
|
||||
type: string
|
||||
tags:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
end_date:
|
||||
type: string
|
||||
description: RFC3339 UTC
|
||||
event:
|
||||
$ref: '#/components/schemas/ComboEvent'
|
||||
ComboEvent:
|
||||
type: object
|
||||
properties:
|
||||
event_id:
|
||||
type: string
|
||||
event_slug:
|
||||
type: string
|
||||
event_title:
|
||||
type: string
|
||||
event_image:
|
||||
type: string
|
||||
|
||||
````
|
||||
Reference in New Issue
Block a user