Update Polymarket documentation - March 27, 2026
Added 19 new documentation pages: - Rebates API: get-current-rebated-fees-for-a-maker - Relayer API: 7 new endpoints (safe check, transactions, nonce, API keys) - Rewards API: 6 new endpoints (earnings, configurations, percentages) - Data API: get-midpoint-price (replaces empty market-data version) - Resources: blockchain-data, referral-program - Trading: matching-engine Updated TARGET.md with new URL entries.
This commit is contained in:
@@ -0,0 +1,229 @@
|
||||
> ## 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 active rewards configurations
|
||||
|
||||
> Returns all current active rewards configurations grouped by market.
|
||||
|
||||
When `sponsored=true`, returns sponsored reward configurations instead.
|
||||
|
||||
Results are paginated (500 items per page). Use next_cursor to fetch subsequent pages.
|
||||
A next_cursor value of "LTE=" indicates the last page.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/clob-openapi.yaml get /rewards/markets/current
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Polymarket CLOB API
|
||||
description: Polymarket CLOB API Reference
|
||||
license:
|
||||
name: MIT
|
||||
identifier: MIT
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://clob.polymarket.com
|
||||
description: Production CLOB API
|
||||
- url: https://clob-staging.polymarket.com
|
||||
description: Staging CLOB API
|
||||
security: []
|
||||
tags:
|
||||
- name: Trade
|
||||
description: Trade endpoints
|
||||
- name: Markets
|
||||
description: Market data endpoints
|
||||
- name: Account
|
||||
description: Account and authentication endpoints
|
||||
- name: Notifications
|
||||
description: User notification endpoints
|
||||
- name: Rewards
|
||||
description: Rewards and earnings endpoints
|
||||
- name: Rebates
|
||||
description: Maker rebate endpoints
|
||||
paths:
|
||||
/rewards/markets/current:
|
||||
get:
|
||||
tags:
|
||||
- Rewards
|
||||
summary: Get current active rewards configurations
|
||||
description: >
|
||||
Returns all current active rewards configurations grouped by market.
|
||||
|
||||
|
||||
When `sponsored=true`, returns sponsored reward configurations instead.
|
||||
|
||||
|
||||
Results are paginated (500 items per page). Use next_cursor to fetch
|
||||
subsequent pages.
|
||||
|
||||
A next_cursor value of "LTE=" indicates the last page.
|
||||
operationId: getCurrentRewards
|
||||
parameters:
|
||||
- name: sponsored
|
||||
in: query
|
||||
description: >-
|
||||
If true, returns sponsored reward configurations instead of standard
|
||||
ones
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- name: next_cursor
|
||||
in: query
|
||||
description: Pagination cursor from previous response
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved current rewards configurations
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedCurrentReward'
|
||||
example:
|
||||
limit: 500
|
||||
count: 1
|
||||
next_cursor: LTE=
|
||||
data:
|
||||
- condition_id: >-
|
||||
0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af
|
||||
rewards_max_spread: 99
|
||||
rewards_min_size: 10
|
||||
rewards_config:
|
||||
- id: 0
|
||||
asset_address: '0x9c4E1703476E875070EE25b56A58B008CFb8FA78'
|
||||
start_date: '2024-03-01'
|
||||
end_date: '2500-12-31'
|
||||
rate_per_day: 2
|
||||
total_rewards: 92
|
||||
- id: 0
|
||||
asset_address: '0x69308FB512518e39F9b16112fA8d994F4e2Bf8bB'
|
||||
start_date: '2024-03-01'
|
||||
end_date: '2500-12-31'
|
||||
rate_per_day: 1
|
||||
total_rewards: 46
|
||||
sponsored_daily_rate: 0.5
|
||||
sponsors_count: 2
|
||||
native_daily_rate: 2.5
|
||||
total_daily_rate: 3
|
||||
'400':
|
||||
description: Bad request - Invalid next_cursor
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid next_cursor
|
||||
'500':
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Internal server error
|
||||
components:
|
||||
schemas:
|
||||
PaginatedCurrentReward:
|
||||
type: object
|
||||
description: Paginated list of current reward configurations
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
description: Maximum number of items per page
|
||||
count:
|
||||
type: integer
|
||||
description: Number of items in the current response
|
||||
next_cursor:
|
||||
type: string
|
||||
description: Cursor for the next page. "LTE=" indicates the last page.
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CurrentReward'
|
||||
required:
|
||||
- limit
|
||||
- count
|
||||
- next_cursor
|
||||
- data
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
CurrentReward:
|
||||
type: object
|
||||
description: Current active reward configuration for a market
|
||||
properties:
|
||||
condition_id:
|
||||
type: string
|
||||
description: Condition ID of the market
|
||||
rewards_max_spread:
|
||||
type: number
|
||||
description: Maximum spread for rewards eligibility
|
||||
rewards_min_size:
|
||||
type: number
|
||||
description: Minimum order size for rewards eligibility
|
||||
rewards_config:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CurrentRewardConfig'
|
||||
sponsored_daily_rate:
|
||||
type: number
|
||||
format: double
|
||||
description: Sponsored daily rate (omitted when zero)
|
||||
sponsors_count:
|
||||
type: integer
|
||||
description: Number of sponsors (omitted when zero)
|
||||
native_daily_rate:
|
||||
type: number
|
||||
format: double
|
||||
description: Computed native daily rate excluding sponsors (omitted when zero)
|
||||
total_daily_rate:
|
||||
type: number
|
||||
format: double
|
||||
description: Computed total daily rate including sponsors (omitted when zero)
|
||||
required:
|
||||
- condition_id
|
||||
CurrentRewardConfig:
|
||||
type: object
|
||||
description: Reward configuration entry for a current rewards market
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: Rewards config ID (always 0 on /rewards/markets/current)
|
||||
asset_address:
|
||||
type: string
|
||||
description: Address of the reward asset
|
||||
start_date:
|
||||
type: string
|
||||
format: date
|
||||
description: Start date of the rewards period
|
||||
end_date:
|
||||
type: string
|
||||
format: date
|
||||
description: End date of the rewards period
|
||||
rate_per_day:
|
||||
type: number
|
||||
format: double
|
||||
description: Daily reward rate
|
||||
total_rewards:
|
||||
type: number
|
||||
format: double
|
||||
description: Total rewards amount
|
||||
required:
|
||||
- asset_address
|
||||
- start_date
|
||||
- rate_per_day
|
||||
|
||||
````
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
@@ -0,0 +1,260 @@
|
||||
> ## 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 earnings for user by date
|
||||
|
||||
> Returns an array of user earnings per market for a provided day.
|
||||
|
||||
Requires CLOB L2 Auth headers.
|
||||
|
||||
Results are paginated (100 items per page). Use next_cursor to fetch subsequent pages.
|
||||
A next_cursor value of "LTE=" indicates the last page.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/clob-openapi.yaml get /rewards/user
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Polymarket CLOB API
|
||||
description: Polymarket CLOB API Reference
|
||||
license:
|
||||
name: MIT
|
||||
identifier: MIT
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://clob.polymarket.com
|
||||
description: Production CLOB API
|
||||
- url: https://clob-staging.polymarket.com
|
||||
description: Staging CLOB API
|
||||
security: []
|
||||
tags:
|
||||
- name: Trade
|
||||
description: Trade endpoints
|
||||
- name: Markets
|
||||
description: Market data endpoints
|
||||
- name: Account
|
||||
description: Account and authentication endpoints
|
||||
- name: Notifications
|
||||
description: User notification endpoints
|
||||
- name: Rewards
|
||||
description: Rewards and earnings endpoints
|
||||
- name: Rebates
|
||||
description: Maker rebate endpoints
|
||||
paths:
|
||||
/rewards/user:
|
||||
get:
|
||||
tags:
|
||||
- Rewards
|
||||
summary: Get earnings for user by date
|
||||
description: >
|
||||
Returns an array of user earnings per market for a provided day.
|
||||
|
||||
|
||||
Requires CLOB L2 Auth headers.
|
||||
|
||||
|
||||
Results are paginated (100 items per page). Use next_cursor to fetch
|
||||
subsequent pages.
|
||||
|
||||
A next_cursor value of "LTE=" indicates the last page.
|
||||
operationId: getEarningsForUserForDay
|
||||
parameters:
|
||||
- name: date
|
||||
in: query
|
||||
description: Date in YYYY-MM-DD format
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
format: date
|
||||
example: '2024-03-26'
|
||||
- name: signature_type
|
||||
in: query
|
||||
description: |
|
||||
Signature type for address derivation (required for API KEY auth):
|
||||
- 0: EOA
|
||||
- 1: POLY_PROXY
|
||||
- 2: POLY_GNOSIS_SAFE
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
- name: maker_address
|
||||
in: query
|
||||
description: Maker address to query earnings for
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: '0xFeA4cB3dD4ca7CefD3368653B7D6FF9BcDFca604'
|
||||
- name: sponsored
|
||||
in: query
|
||||
description: If true, returns sponsored-only earnings
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- name: next_cursor
|
||||
in: query
|
||||
description: Pagination cursor from previous response
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved user earnings
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedUserEarnings'
|
||||
example:
|
||||
limit: 100
|
||||
count: 1
|
||||
next_cursor: LTE=
|
||||
data:
|
||||
- date: '2024-03-26T00:00:00Z'
|
||||
condition_id: >-
|
||||
0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af
|
||||
asset_address: '0x9c4E1703476E875070EE25b56A58B008CFb8FA78'
|
||||
maker_address: '0xFeA4cB3dD4ca7CefD3368653B7D6FF9BcDFca604'
|
||||
earnings: 0.237519
|
||||
asset_rate: 1
|
||||
'400':
|
||||
description: Bad request - Invalid parameters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
invalid_date:
|
||||
summary: Invalid date format
|
||||
value:
|
||||
error: 'Invalid date (format: YYYY-MM-DD)'
|
||||
invalid_signature_type:
|
||||
summary: Invalid signature type
|
||||
value:
|
||||
error: Invalid signature_type
|
||||
invalid_maker_address:
|
||||
summary: Invalid maker address
|
||||
value:
|
||||
error: Invalid maker_address
|
||||
'401':
|
||||
description: Unauthorized - Invalid API key or authentication failed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid API key
|
||||
'500':
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Internal server error
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
PaginatedUserEarnings:
|
||||
type: object
|
||||
description: Paginated list of user earnings
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
description: Maximum number of items per page
|
||||
count:
|
||||
type: integer
|
||||
description: Number of items in the current response
|
||||
next_cursor:
|
||||
type: string
|
||||
description: Cursor for the next page. "LTE=" indicates the last page.
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/UserEarning'
|
||||
required:
|
||||
- limit
|
||||
- count
|
||||
- next_cursor
|
||||
- data
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
UserEarning:
|
||||
type: object
|
||||
description: User earnings for a specific market on a given day
|
||||
properties:
|
||||
date:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Date of the earnings
|
||||
condition_id:
|
||||
type: string
|
||||
description: Condition ID of the market
|
||||
asset_address:
|
||||
type: string
|
||||
description: Address of the reward asset
|
||||
maker_address:
|
||||
type: string
|
||||
description: Address of the maker
|
||||
earnings:
|
||||
type: number
|
||||
format: double
|
||||
description: Amount of earnings in the asset
|
||||
asset_rate:
|
||||
type: number
|
||||
format: double
|
||||
description: Exchange rate of the asset
|
||||
required:
|
||||
- date
|
||||
- condition_id
|
||||
- asset_address
|
||||
- maker_address
|
||||
- earnings
|
||||
securitySchemes:
|
||||
polyApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_API_KEY
|
||||
description: Your API key
|
||||
polyAddress:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_ADDRESS
|
||||
description: Ethereum address associated with the API key
|
||||
polySignature:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_SIGNATURE
|
||||
description: HMAC signature of the request
|
||||
polyPassphrase:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_PASSPHRASE
|
||||
description: API key passphrase
|
||||
polyTimestamp:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
@@ -0,0 +1,409 @@
|
||||
> ## 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 multiple markets with rewards
|
||||
|
||||
> Returns a list of active markets with their reward configurations.
|
||||
Supports text search, tag filtering, numeric filters, and sorting.
|
||||
|
||||
Results are paginated (100 items per page by default). Use next_cursor to fetch subsequent pages.
|
||||
A next_cursor value of "LTE=" indicates the last page.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/clob-openapi.yaml get /rewards/markets/multi
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Polymarket CLOB API
|
||||
description: Polymarket CLOB API Reference
|
||||
license:
|
||||
name: MIT
|
||||
identifier: MIT
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://clob.polymarket.com
|
||||
description: Production CLOB API
|
||||
- url: https://clob-staging.polymarket.com
|
||||
description: Staging CLOB API
|
||||
security: []
|
||||
tags:
|
||||
- name: Trade
|
||||
description: Trade endpoints
|
||||
- name: Markets
|
||||
description: Market data endpoints
|
||||
- name: Account
|
||||
description: Account and authentication endpoints
|
||||
- name: Notifications
|
||||
description: User notification endpoints
|
||||
- name: Rewards
|
||||
description: Rewards and earnings endpoints
|
||||
- name: Rebates
|
||||
description: Maker rebate endpoints
|
||||
paths:
|
||||
/rewards/markets/multi:
|
||||
get:
|
||||
tags:
|
||||
- Rewards
|
||||
summary: Get multiple markets with rewards
|
||||
description: >
|
||||
Returns a list of active markets with their reward configurations.
|
||||
|
||||
Supports text search, tag filtering, numeric filters, and sorting.
|
||||
|
||||
|
||||
Results are paginated (100 items per page by default). Use next_cursor
|
||||
to fetch subsequent pages.
|
||||
|
||||
A next_cursor value of "LTE=" indicates the last page.
|
||||
operationId: getMultiMarkets
|
||||
parameters:
|
||||
- name: q
|
||||
in: query
|
||||
description: Text search on market question/description
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: tag_slug
|
||||
in: query
|
||||
description: >-
|
||||
Filter by tag slug. Can be repeated for OR logic (e.g.,
|
||||
?tag_slug=sports&tag_slug=politics)
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: event_id
|
||||
in: query
|
||||
description: >-
|
||||
Filter by event ID. Can be repeated for multiple events (e.g.,
|
||||
?event_id=100&event_id=200)
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: event_title
|
||||
in: query
|
||||
description: Search event titles using case-insensitive pattern matching
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: order_by
|
||||
in: query
|
||||
description: Field to sort results by
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- market_id
|
||||
- created_at
|
||||
- volume_24hr
|
||||
- spread
|
||||
- competitiveness
|
||||
- max_spread
|
||||
- min_size
|
||||
- question
|
||||
- one_day_price_change
|
||||
- rate_per_day
|
||||
- price
|
||||
- end_date
|
||||
- start_date
|
||||
- reward_end_date
|
||||
- name: position
|
||||
in: query
|
||||
description: Sort direction
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- ASC
|
||||
- DESC
|
||||
- name: min_volume_24hr
|
||||
in: query
|
||||
description: Minimum 24-hour volume filter
|
||||
required: false
|
||||
schema:
|
||||
type: number
|
||||
format: double
|
||||
- name: max_volume_24hr
|
||||
in: query
|
||||
description: Maximum 24-hour volume filter
|
||||
required: false
|
||||
schema:
|
||||
type: number
|
||||
format: double
|
||||
- name: min_spread
|
||||
in: query
|
||||
description: Minimum spread filter
|
||||
required: false
|
||||
schema:
|
||||
type: number
|
||||
format: double
|
||||
- name: max_spread
|
||||
in: query
|
||||
description: Maximum spread filter
|
||||
required: false
|
||||
schema:
|
||||
type: number
|
||||
format: double
|
||||
- name: min_price
|
||||
in: query
|
||||
description: Minimum first token price filter
|
||||
required: false
|
||||
schema:
|
||||
type: number
|
||||
format: double
|
||||
- name: max_price
|
||||
in: query
|
||||
description: Maximum first token price filter
|
||||
required: false
|
||||
schema:
|
||||
type: number
|
||||
format: double
|
||||
- name: next_cursor
|
||||
in: query
|
||||
description: Pagination cursor from previous response
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: page_size
|
||||
in: query
|
||||
description: Number of items per page (max 500, values above are capped)
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
default: 100
|
||||
maximum: 500
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved markets with rewards
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedMultiMarketInfo'
|
||||
example:
|
||||
limit: 50
|
||||
count: 1
|
||||
next_cursor: NQ==
|
||||
data:
|
||||
- condition_id: >-
|
||||
0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af
|
||||
event_id: '12345'
|
||||
event_slug: 2024-us-election
|
||||
created_at: '2024-05-01T12:00:00Z'
|
||||
group_item_title: ''
|
||||
image: https://example.com/image.png
|
||||
market_competitiveness: 0.42
|
||||
market_id: '248849'
|
||||
market_slug: will-trump-win-the-2024-iowa-caucus
|
||||
one_day_price_change: 0.03
|
||||
question: Will Trump win the 2024 Iowa Caucus?
|
||||
rewards_max_spread: 99
|
||||
rewards_min_size: 10
|
||||
spread: 0.12
|
||||
end_date: '2024-08-10 00:00:00'
|
||||
tokens:
|
||||
- token_id: >-
|
||||
1343197538147866997676250008839231694243646439454152539053893078719042421992
|
||||
outcome: 'YES'
|
||||
price: 0.8
|
||||
- token_id: >-
|
||||
16678291189211314787145083999015737376658799626183230671758641503291735614088
|
||||
outcome: 'NO'
|
||||
price: 0.2
|
||||
volume_24hr: 12345.67
|
||||
rewards_config:
|
||||
- id: 7
|
||||
asset_address: '0x9c4E1703476E875070EE25b56A58B008CFb8FA78'
|
||||
start_date: '2024-03-01'
|
||||
end_date: '2500-12-31'
|
||||
rate_per_day: 2
|
||||
total_rewards: 92
|
||||
'400':
|
||||
description: Bad request - Invalid parameters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
invalid_order_by:
|
||||
summary: Invalid order_by value
|
||||
value:
|
||||
error: Invalid order_by
|
||||
invalid_position:
|
||||
summary: Invalid position value
|
||||
value:
|
||||
error: Invalid position
|
||||
invalid_cursor:
|
||||
summary: Invalid pagination cursor
|
||||
value:
|
||||
error: Invalid next_cursor
|
||||
'500':
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Internal server error
|
||||
components:
|
||||
schemas:
|
||||
PaginatedMultiMarketInfo:
|
||||
type: object
|
||||
description: Paginated list of markets with rewards and trading metrics
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
description: Maximum number of items per page
|
||||
count:
|
||||
type: integer
|
||||
description: Number of items in the current response
|
||||
next_cursor:
|
||||
type: string
|
||||
description: Cursor for the next page. "LTE=" indicates the last page.
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/MultiMarketInfo'
|
||||
required:
|
||||
- limit
|
||||
- count
|
||||
- next_cursor
|
||||
- data
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
MultiMarketInfo:
|
||||
type: object
|
||||
description: Market with rewards configuration and trading metrics
|
||||
properties:
|
||||
condition_id:
|
||||
type: string
|
||||
description: Condition ID of the market
|
||||
event_id:
|
||||
type: string
|
||||
description: Event ID
|
||||
event_slug:
|
||||
type: string
|
||||
description: URL slug for the event
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Market creation timestamp
|
||||
group_item_title:
|
||||
type: string
|
||||
description: Title within an event group
|
||||
image:
|
||||
type: string
|
||||
description: URL to market image
|
||||
market_competitiveness:
|
||||
type: number
|
||||
format: double
|
||||
description: Competitiveness score of the market
|
||||
market_id:
|
||||
type: string
|
||||
description: Market ID
|
||||
market_slug:
|
||||
type: string
|
||||
description: URL slug for the market
|
||||
one_day_price_change:
|
||||
type: number
|
||||
format: double
|
||||
description: Price change over the last 24 hours
|
||||
question:
|
||||
type: string
|
||||
description: Market question
|
||||
rewards_max_spread:
|
||||
type: number
|
||||
description: Maximum spread for rewards eligibility
|
||||
rewards_min_size:
|
||||
type: number
|
||||
description: Minimum order size for rewards eligibility
|
||||
spread:
|
||||
type: number
|
||||
format: double
|
||||
description: Current spread
|
||||
end_date:
|
||||
type: string
|
||||
description: Market end date
|
||||
tokens:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/RewardsToken'
|
||||
volume_24hr:
|
||||
type: number
|
||||
format: double
|
||||
description: 24-hour trading volume
|
||||
rewards_config:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/RewardsConfig'
|
||||
required:
|
||||
- condition_id
|
||||
- market_id
|
||||
- question
|
||||
- tokens
|
||||
RewardsToken:
|
||||
type: object
|
||||
description: Token information for rewards markets
|
||||
properties:
|
||||
token_id:
|
||||
type: string
|
||||
description: Token ID
|
||||
outcome:
|
||||
type: string
|
||||
description: Outcome name (e.g., "YES", "NO")
|
||||
price:
|
||||
type: number
|
||||
format: double
|
||||
description: Current price of the token
|
||||
required:
|
||||
- token_id
|
||||
- outcome
|
||||
RewardsConfig:
|
||||
type: object
|
||||
description: Rewards configuration for a market
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: Rewards config ID
|
||||
asset_address:
|
||||
type: string
|
||||
description: Address of the reward asset
|
||||
start_date:
|
||||
type: string
|
||||
format: date
|
||||
description: Start date of the rewards period
|
||||
end_date:
|
||||
type: string
|
||||
format: date
|
||||
description: End date of the rewards period
|
||||
rate_per_day:
|
||||
type: number
|
||||
format: double
|
||||
description: Daily reward rate
|
||||
total_rewards:
|
||||
type: number
|
||||
format: double
|
||||
description: Total rewards amount
|
||||
remaining_reward_amount:
|
||||
type: number
|
||||
format: double
|
||||
description: Remaining reward amount
|
||||
total_days:
|
||||
type: integer
|
||||
description: Total number of days in the rewards period
|
||||
required:
|
||||
- asset_address
|
||||
- start_date
|
||||
- rate_per_day
|
||||
|
||||
````
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
@@ -0,0 +1,289 @@
|
||||
> ## 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 raw rewards for a specific market
|
||||
|
||||
> Returns an array of present and future rewards configured on a market.
|
||||
|
||||
When `sponsored=true`, sponsored daily rates are folded into each config's
|
||||
`rate_per_day` .
|
||||
|
||||
Results are paginated (100 items per page). Use next_cursor to fetch subsequent pages.
|
||||
A next_cursor value of "LTE=" indicates the last page.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/clob-openapi.yaml get /rewards/markets/{condition_id}
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Polymarket CLOB API
|
||||
description: Polymarket CLOB API Reference
|
||||
license:
|
||||
name: MIT
|
||||
identifier: MIT
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://clob.polymarket.com
|
||||
description: Production CLOB API
|
||||
- url: https://clob-staging.polymarket.com
|
||||
description: Staging CLOB API
|
||||
security: []
|
||||
tags:
|
||||
- name: Trade
|
||||
description: Trade endpoints
|
||||
- name: Markets
|
||||
description: Market data endpoints
|
||||
- name: Account
|
||||
description: Account and authentication endpoints
|
||||
- name: Notifications
|
||||
description: User notification endpoints
|
||||
- name: Rewards
|
||||
description: Rewards and earnings endpoints
|
||||
- name: Rebates
|
||||
description: Maker rebate endpoints
|
||||
paths:
|
||||
/rewards/markets/{condition_id}:
|
||||
get:
|
||||
tags:
|
||||
- Rewards
|
||||
summary: Get raw rewards for a specific market
|
||||
description: >
|
||||
Returns an array of present and future rewards configured on a market.
|
||||
|
||||
|
||||
When `sponsored=true`, sponsored daily rates are folded into each
|
||||
config's
|
||||
|
||||
`rate_per_day` .
|
||||
|
||||
|
||||
Results are paginated (100 items per page). Use next_cursor to fetch
|
||||
subsequent pages.
|
||||
|
||||
A next_cursor value of "LTE=" indicates the last page.
|
||||
operationId: getRawRewardsForMarket
|
||||
parameters:
|
||||
- name: condition_id
|
||||
in: path
|
||||
description: The condition ID of the market
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
example: '0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af'
|
||||
- name: sponsored
|
||||
in: query
|
||||
description: If true, folds sponsored daily rates into each config's rate_per_day
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- name: next_cursor
|
||||
in: query
|
||||
description: Pagination cursor from previous response
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved rewards for market
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedMarketReward'
|
||||
example:
|
||||
limit: 100
|
||||
count: 1
|
||||
next_cursor: LTE=
|
||||
data:
|
||||
- condition_id: >-
|
||||
0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af
|
||||
question: Will Trump win the 2024 Iowa Caucus?
|
||||
market_slug: will-trump-win-the-2024-iowa-caucus
|
||||
event_slug: will-trump-win-the-2024-iowa-caucus
|
||||
image: >-
|
||||
https://polymarket-upload.s3.us-east-2.amazonaws.com/trump1+copy.png
|
||||
rewards_max_spread: 99
|
||||
rewards_min_size: 10
|
||||
market_competitiveness: 0.42
|
||||
tokens:
|
||||
- token_id: >-
|
||||
1343197538147866997676250008839231694243646439454152539053893078719042421992
|
||||
outcome: 'YES'
|
||||
price: 0.8
|
||||
- token_id: >-
|
||||
16678291189211314787145083999015737376658799626183230671758641503291735614088
|
||||
outcome: 'NO'
|
||||
price: 0.2
|
||||
rewards_config:
|
||||
- id: 1
|
||||
asset_address: '0x9c4E1703476E875070EE25b56A58B008CFb8FA78'
|
||||
start_date: '2024-03-01'
|
||||
end_date: '2500-12-31'
|
||||
rate_per_day: 0.25
|
||||
total_rewards: 0
|
||||
total_days: 174161
|
||||
- id: 2
|
||||
asset_address: '0x9c4E1703476E875070EE25b56A58B008CFb8FA78'
|
||||
start_date: '2024-03-01'
|
||||
end_date: '2024-05-31'
|
||||
rate_per_day: 1
|
||||
total_rewards: 92
|
||||
total_days: 92
|
||||
'400':
|
||||
description: Bad request - Invalid market or next_cursor
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
invalid_market:
|
||||
summary: Empty condition ID
|
||||
value:
|
||||
error: Invalid market
|
||||
invalid_cursor:
|
||||
summary: Invalid pagination cursor
|
||||
value:
|
||||
error: Invalid next_cursor
|
||||
'500':
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Internal server error
|
||||
components:
|
||||
schemas:
|
||||
PaginatedMarketReward:
|
||||
type: object
|
||||
description: Paginated list of market reward configurations
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
description: Maximum number of items per page
|
||||
count:
|
||||
type: integer
|
||||
description: Number of items in the current response
|
||||
next_cursor:
|
||||
type: string
|
||||
description: Cursor for the next page. "LTE=" indicates the last page.
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/MarketReward'
|
||||
required:
|
||||
- limit
|
||||
- count
|
||||
- next_cursor
|
||||
- data
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
MarketReward:
|
||||
type: object
|
||||
description: Market with raw reward configurations
|
||||
properties:
|
||||
condition_id:
|
||||
type: string
|
||||
description: Condition ID of the market
|
||||
question:
|
||||
type: string
|
||||
description: Market question
|
||||
market_slug:
|
||||
type: string
|
||||
description: URL slug for the market
|
||||
event_slug:
|
||||
type: string
|
||||
description: URL slug for the event
|
||||
image:
|
||||
type: string
|
||||
description: URL to market image
|
||||
rewards_max_spread:
|
||||
type: number
|
||||
description: Maximum spread for rewards eligibility
|
||||
rewards_min_size:
|
||||
type: number
|
||||
description: Minimum order size for rewards eligibility
|
||||
market_competitiveness:
|
||||
type: number
|
||||
format: double
|
||||
description: Competitiveness score of the market
|
||||
tokens:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/RewardsToken'
|
||||
rewards_config:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/RewardsConfig'
|
||||
required:
|
||||
- condition_id
|
||||
- question
|
||||
- tokens
|
||||
RewardsToken:
|
||||
type: object
|
||||
description: Token information for rewards markets
|
||||
properties:
|
||||
token_id:
|
||||
type: string
|
||||
description: Token ID
|
||||
outcome:
|
||||
type: string
|
||||
description: Outcome name (e.g., "YES", "NO")
|
||||
price:
|
||||
type: number
|
||||
format: double
|
||||
description: Current price of the token
|
||||
required:
|
||||
- token_id
|
||||
- outcome
|
||||
RewardsConfig:
|
||||
type: object
|
||||
description: Rewards configuration for a market
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: Rewards config ID
|
||||
asset_address:
|
||||
type: string
|
||||
description: Address of the reward asset
|
||||
start_date:
|
||||
type: string
|
||||
format: date
|
||||
description: Start date of the rewards period
|
||||
end_date:
|
||||
type: string
|
||||
format: date
|
||||
description: End date of the rewards period
|
||||
rate_per_day:
|
||||
type: number
|
||||
format: double
|
||||
description: Daily reward rate
|
||||
total_rewards:
|
||||
type: number
|
||||
format: double
|
||||
description: Total rewards amount
|
||||
remaining_reward_amount:
|
||||
type: number
|
||||
format: double
|
||||
description: Remaining reward amount
|
||||
total_days:
|
||||
type: integer
|
||||
description: Total number of days in the rewards period
|
||||
required:
|
||||
- asset_address
|
||||
- start_date
|
||||
- rate_per_day
|
||||
|
||||
````
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
@@ -0,0 +1,177 @@
|
||||
> ## 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 reward percentages for user
|
||||
|
||||
> Returns the real-time percentages of rewards that a user is earning per market.
|
||||
|
||||
The response is a map of condition_id to the percentage of total rewards
|
||||
the user is currently earning in that market.
|
||||
|
||||
Requires CLOB L2 Auth headers.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/clob-openapi.yaml get /rewards/user/percentages
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Polymarket CLOB API
|
||||
description: Polymarket CLOB API Reference
|
||||
license:
|
||||
name: MIT
|
||||
identifier: MIT
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://clob.polymarket.com
|
||||
description: Production CLOB API
|
||||
- url: https://clob-staging.polymarket.com
|
||||
description: Staging CLOB API
|
||||
security: []
|
||||
tags:
|
||||
- name: Trade
|
||||
description: Trade endpoints
|
||||
- name: Markets
|
||||
description: Market data endpoints
|
||||
- name: Account
|
||||
description: Account and authentication endpoints
|
||||
- name: Notifications
|
||||
description: User notification endpoints
|
||||
- name: Rewards
|
||||
description: Rewards and earnings endpoints
|
||||
- name: Rebates
|
||||
description: Maker rebate endpoints
|
||||
paths:
|
||||
/rewards/user/percentages:
|
||||
get:
|
||||
tags:
|
||||
- Rewards
|
||||
summary: Get reward percentages for user
|
||||
description: >
|
||||
Returns the real-time percentages of rewards that a user is earning per
|
||||
market.
|
||||
|
||||
|
||||
The response is a map of condition_id to the percentage of total rewards
|
||||
|
||||
the user is currently earning in that market.
|
||||
|
||||
|
||||
Requires CLOB L2 Auth headers.
|
||||
operationId: getRewardPercentagesForUser
|
||||
parameters:
|
||||
- name: signature_type
|
||||
in: query
|
||||
description: |
|
||||
Signature type for address derivation (required for API KEY auth):
|
||||
- 0: EOA
|
||||
- 1: POLY_PROXY
|
||||
- 2: POLY_GNOSIS_SAFE
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
- name: maker_address
|
||||
in: query
|
||||
description: Maker address to query percentages for
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: '0xFeA4cB3dD4ca7CefD3368653B7D6FF9BcDFca604'
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved reward percentages
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: number
|
||||
format: double
|
||||
description: Map of condition_id to reward percentage
|
||||
example:
|
||||
'0x296ea2f3ad438ce7ead77f40d0159bf3e5d8be146f6f615fa253b00e02243f5c': 20
|
||||
'0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af': 20
|
||||
'400':
|
||||
description: Bad request - Invalid parameters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
invalid_signature_type:
|
||||
summary: Invalid signature type
|
||||
value:
|
||||
error: Invalid signature_type
|
||||
invalid_maker_address:
|
||||
summary: Invalid maker address
|
||||
value:
|
||||
error: Invalid maker_address
|
||||
'401':
|
||||
description: Unauthorized - Invalid API key or authentication failed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid API key
|
||||
'500':
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Internal server error
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
securitySchemes:
|
||||
polyApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_API_KEY
|
||||
description: Your API key
|
||||
polyAddress:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_ADDRESS
|
||||
description: Ethereum address associated with the API key
|
||||
polySignature:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_SIGNATURE
|
||||
description: HMAC signature of the request
|
||||
polyPassphrase:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_PASSPHRASE
|
||||
description: API key passphrase
|
||||
polyTimestamp:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
@@ -0,0 +1,222 @@
|
||||
> ## 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 earnings for user by date
|
||||
|
||||
> Returns the summed total rewards earnings for a user on a provided day,
|
||||
grouped by asset address.
|
||||
|
||||
Requires CLOB L2 Auth headers.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/clob-openapi.yaml get /rewards/user/total
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Polymarket CLOB API
|
||||
description: Polymarket CLOB API Reference
|
||||
license:
|
||||
name: MIT
|
||||
identifier: MIT
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://clob.polymarket.com
|
||||
description: Production CLOB API
|
||||
- url: https://clob-staging.polymarket.com
|
||||
description: Staging CLOB API
|
||||
security: []
|
||||
tags:
|
||||
- name: Trade
|
||||
description: Trade endpoints
|
||||
- name: Markets
|
||||
description: Market data endpoints
|
||||
- name: Account
|
||||
description: Account and authentication endpoints
|
||||
- name: Notifications
|
||||
description: User notification endpoints
|
||||
- name: Rewards
|
||||
description: Rewards and earnings endpoints
|
||||
- name: Rebates
|
||||
description: Maker rebate endpoints
|
||||
paths:
|
||||
/rewards/user/total:
|
||||
get:
|
||||
tags:
|
||||
- Rewards
|
||||
summary: Get total earnings for user by date
|
||||
description: |
|
||||
Returns the summed total rewards earnings for a user on a provided day,
|
||||
grouped by asset address.
|
||||
|
||||
Requires CLOB L2 Auth headers.
|
||||
operationId: getTotalEarningsForUserForDay
|
||||
parameters:
|
||||
- name: date
|
||||
in: query
|
||||
description: Date in YYYY-MM-DD format
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
format: date
|
||||
example: '2024-03-26'
|
||||
- name: signature_type
|
||||
in: query
|
||||
description: |
|
||||
Signature type for address derivation (required for API KEY auth):
|
||||
- 0: EOA
|
||||
- 1: POLY_PROXY
|
||||
- 2: POLY_GNOSIS_SAFE
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
- name: maker_address
|
||||
in: query
|
||||
description: Maker address to query earnings for
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: '0xFeA4cB3dD4ca7CefD3368653B7D6FF9BcDFca604'
|
||||
- name: sponsored
|
||||
in: query
|
||||
description: If true, aggregates both native and sponsored earnings
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved total user earnings
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TotalUserEarning'
|
||||
example:
|
||||
- date: '2024-04-09T00:00:00Z'
|
||||
asset_address: '0x9c4E1703476E875070EE25b56A58B008CFb8FA78'
|
||||
maker_address: '0xD527CCdBEB6478488c848465F9947bDA3C2e6994'
|
||||
earnings: 1.59984
|
||||
asset_rate: 0.999357
|
||||
- date: '2024-04-09T00:00:00Z'
|
||||
asset_address: '0x69308FB512518e39F9b16112fA8d994F4e2Bf8bB'
|
||||
maker_address: '0xD527CCdBEB6478488c848465F9947bDA3C2e6994'
|
||||
earnings: 8.187219
|
||||
asset_rate: 3.51
|
||||
'400':
|
||||
description: Bad request - Invalid parameters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
invalid_date:
|
||||
summary: Invalid date format
|
||||
value:
|
||||
error: 'Invalid date (format: YYYY-MM-DD)'
|
||||
invalid_signature_type:
|
||||
summary: Invalid signature type
|
||||
value:
|
||||
error: Invalid signature_type
|
||||
invalid_maker_address:
|
||||
summary: Invalid maker address
|
||||
value:
|
||||
error: Invalid maker_address
|
||||
'401':
|
||||
description: Unauthorized - Invalid API key or authentication failed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid API key
|
||||
'500':
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Internal server error
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
TotalUserEarning:
|
||||
type: object
|
||||
description: Total user earnings for a given day grouped by asset
|
||||
properties:
|
||||
date:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Date of the earnings
|
||||
asset_address:
|
||||
type: string
|
||||
description: Address of the reward asset
|
||||
maker_address:
|
||||
type: string
|
||||
description: Address of the maker
|
||||
earnings:
|
||||
type: number
|
||||
format: double
|
||||
description: Total amount of earnings in the asset
|
||||
asset_rate:
|
||||
type: number
|
||||
format: double
|
||||
description: Exchange rate of the asset
|
||||
required:
|
||||
- date
|
||||
- asset_address
|
||||
- maker_address
|
||||
- earnings
|
||||
- asset_rate
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
securitySchemes:
|
||||
polyApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_API_KEY
|
||||
description: Your API key
|
||||
polyAddress:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_ADDRESS
|
||||
description: Ethereum address associated with the API key
|
||||
polySignature:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_SIGNATURE
|
||||
description: HMAC signature of the request
|
||||
polyPassphrase:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_PASSPHRASE
|
||||
description: API key passphrase
|
||||
polyTimestamp:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
@@ -0,0 +1,499 @@
|
||||
> ## 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 earnings and markets configuration
|
||||
|
||||
> Returns an array of current rewards including user earnings and live percentages
|
||||
per market for a provided day.
|
||||
|
||||
Results are paginated (100 items per page by default, max 500). Use next_cursor to fetch subsequent pages.
|
||||
A next_cursor value of "LTE=" indicates the last page.
|
||||
|
||||
Requires CLOB L2 Auth headers.
|
||||
|
||||
Optional features:
|
||||
- Search by question/description using the `q` parameter
|
||||
- Filter by tag slugs using `tag_slug` parameter (multiple values are OR'ed)
|
||||
- Filter by favorite markets using `favorite_markets=true`
|
||||
- Sort by various fields using `order_by` and `position` parameters
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml /api-spec/clob-openapi.yaml get /rewards/user/markets
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Polymarket CLOB API
|
||||
description: Polymarket CLOB API Reference
|
||||
license:
|
||||
name: MIT
|
||||
identifier: MIT
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://clob.polymarket.com
|
||||
description: Production CLOB API
|
||||
- url: https://clob-staging.polymarket.com
|
||||
description: Staging CLOB API
|
||||
security: []
|
||||
tags:
|
||||
- name: Trade
|
||||
description: Trade endpoints
|
||||
- name: Markets
|
||||
description: Market data endpoints
|
||||
- name: Account
|
||||
description: Account and authentication endpoints
|
||||
- name: Notifications
|
||||
description: User notification endpoints
|
||||
- name: Rewards
|
||||
description: Rewards and earnings endpoints
|
||||
- name: Rebates
|
||||
description: Maker rebate endpoints
|
||||
paths:
|
||||
/rewards/user/markets:
|
||||
get:
|
||||
tags:
|
||||
- Rewards
|
||||
summary: Get user earnings and markets configuration
|
||||
description: >
|
||||
Returns an array of current rewards including user earnings and live
|
||||
percentages
|
||||
|
||||
per market for a provided day.
|
||||
|
||||
|
||||
Results are paginated (100 items per page by default, max 500). Use
|
||||
next_cursor to fetch subsequent pages.
|
||||
|
||||
A next_cursor value of "LTE=" indicates the last page.
|
||||
|
||||
|
||||
Requires CLOB L2 Auth headers.
|
||||
|
||||
|
||||
Optional features:
|
||||
|
||||
- Search by question/description using the `q` parameter
|
||||
|
||||
- Filter by tag slugs using `tag_slug` parameter (multiple values are
|
||||
OR'ed)
|
||||
|
||||
- Filter by favorite markets using `favorite_markets=true`
|
||||
|
||||
- Sort by various fields using `order_by` and `position` parameters
|
||||
operationId: getUserEarningsAndMarketsConfig
|
||||
parameters:
|
||||
- name: date
|
||||
in: query
|
||||
description: Date in YYYY-MM-DD format. Defaults to current date if not provided.
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
format: date
|
||||
example: '2024-03-26'
|
||||
- name: signature_type
|
||||
in: query
|
||||
description: |
|
||||
Signature type for address derivation (required for API KEY auth):
|
||||
- 0: EOA
|
||||
- 1: POLY_PROXY
|
||||
- 2: POLY_GNOSIS_SAFE
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
- name: maker_address
|
||||
in: query
|
||||
description: Maker address to query data for
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: '0xFeA4cB3dD4ca7CefD3368653B7D6FF9BcDFca604'
|
||||
- name: sponsored
|
||||
in: query
|
||||
description: If true, returns sponsored reward earnings
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- name: next_cursor
|
||||
in: query
|
||||
description: Pagination cursor from previous response
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: page_size
|
||||
in: query
|
||||
description: Number of items per page (max 500, values above are capped)
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
default: 100
|
||||
maximum: 500
|
||||
- name: q
|
||||
in: query
|
||||
description: Search query to filter markets by question/description
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: tag_slug
|
||||
in: query
|
||||
description: Filter by tag slug (can be repeated for OR logic)
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: favorite_markets
|
||||
in: query
|
||||
description: If true, only show markets favorited by the user (requires auth)
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- name: no_competition
|
||||
in: query
|
||||
description: Filter for markets with no competition
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- name: only_mergeable
|
||||
in: query
|
||||
description: Filter for only mergeable markets
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- name: only_open_orders
|
||||
in: query
|
||||
description: Filter for markets where user has open orders
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- name: only_open_positions
|
||||
in: query
|
||||
description: Filter for markets where user has open positions
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- name: order_by
|
||||
in: query
|
||||
description: Field to sort by
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- max_spread
|
||||
- min_size
|
||||
- end_date
|
||||
- earning_percentage
|
||||
- rate_per_day
|
||||
- earnings
|
||||
- spread
|
||||
- competitiveness
|
||||
- question
|
||||
- price
|
||||
- market
|
||||
- volume_24hr
|
||||
- name: position
|
||||
in: query
|
||||
description: Sort direction
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- ASC
|
||||
- DESC
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved user earnings and market configurations
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedUserRewardsMarkets'
|
||||
example:
|
||||
limit: 100
|
||||
count: 1
|
||||
total_count: 42
|
||||
next_cursor: LTE=
|
||||
data:
|
||||
- condition_id: >-
|
||||
0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af
|
||||
market_id: '248849'
|
||||
event_id: '12345'
|
||||
question: Will Trump win the 2024 Iowa Caucus?
|
||||
market_slug: will-trump-win-the-2024-iowa-caucus
|
||||
event_slug: will-trump-win-the-2024-iowa-caucus
|
||||
image: >-
|
||||
https://polymarket-upload.s3.us-east-2.amazonaws.com/trump1+copy.png
|
||||
rewards_max_spread: 99
|
||||
rewards_min_size: 10
|
||||
volume_24hr: 12345.67
|
||||
spread: 0.12
|
||||
market_competitiveness: 0.42
|
||||
tokens:
|
||||
- token_id: >-
|
||||
1343197538147866997676250008839231694243646439454152539053893078719042421992
|
||||
outcome: 'YES'
|
||||
price: 0.8
|
||||
- token_id: >-
|
||||
16678291189211314787145083999015737376658799626183230671758641503291735614088
|
||||
outcome: 'NO'
|
||||
price: 0.2
|
||||
rewards_config:
|
||||
- id: 0
|
||||
asset_address: '0x9c4E1703476E875070EE25b56A58B008CFb8FA78'
|
||||
start_date: '2024-03-01'
|
||||
end_date: '2500-12-31'
|
||||
rate_per_day: 2
|
||||
total_rewards: 92
|
||||
maker_address: '0xD527CCdBEB6478488c848465F9947bDA3C2e6994'
|
||||
earning_percentage: 30
|
||||
earnings:
|
||||
- asset_address: '0x9c4E1703476E875070EE25b56A58B008CFb8FA78'
|
||||
earnings: 0.585051
|
||||
asset_rate: 1.001
|
||||
'400':
|
||||
description: Bad request - Invalid parameters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
invalid_date:
|
||||
summary: Invalid date format
|
||||
value:
|
||||
error: 'Invalid date (format: YYYY-MM-DD)'
|
||||
invalid_signature_type:
|
||||
summary: Invalid signature type
|
||||
value:
|
||||
error: Invalid signature_type
|
||||
favorite_requires_auth:
|
||||
summary: Favorite markets requires auth
|
||||
value:
|
||||
error: favorite_markets query argument requires authentication
|
||||
'401':
|
||||
description: Unauthorized - Invalid API key or authentication failed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid API key
|
||||
'500':
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Internal server error
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
PaginatedUserRewardsMarkets:
|
||||
type: object
|
||||
description: Paginated list of user rewards markets
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
description: Maximum number of items per page
|
||||
count:
|
||||
type: integer
|
||||
description: Number of items in the current response
|
||||
total_count:
|
||||
type: integer
|
||||
description: Total number of items across all pages
|
||||
next_cursor:
|
||||
type: string
|
||||
description: Cursor for the next page. "LTE=" indicates the last page.
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/UserRewardsMarket'
|
||||
required:
|
||||
- limit
|
||||
- count
|
||||
- next_cursor
|
||||
- data
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
UserRewardsMarket:
|
||||
type: object
|
||||
description: Market with user rewards earnings and configuration
|
||||
properties:
|
||||
condition_id:
|
||||
type: string
|
||||
description: Condition ID of the market
|
||||
market_id:
|
||||
type: string
|
||||
description: Market ID
|
||||
event_id:
|
||||
type: string
|
||||
description: Event ID
|
||||
question:
|
||||
type: string
|
||||
description: Market question
|
||||
market_slug:
|
||||
type: string
|
||||
description: URL slug for the market
|
||||
event_slug:
|
||||
type: string
|
||||
description: URL slug for the event
|
||||
image:
|
||||
type: string
|
||||
description: URL to market image
|
||||
rewards_max_spread:
|
||||
type: number
|
||||
description: Maximum spread for rewards eligibility
|
||||
rewards_min_size:
|
||||
type: number
|
||||
description: Minimum order size for rewards eligibility
|
||||
volume_24hr:
|
||||
type: number
|
||||
format: double
|
||||
description: 24-hour trading volume
|
||||
spread:
|
||||
type: number
|
||||
format: double
|
||||
description: Current spread
|
||||
market_competitiveness:
|
||||
type: number
|
||||
format: double
|
||||
description: Competitiveness score of the market
|
||||
tokens:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/RewardsToken'
|
||||
rewards_config:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CurrentRewardConfig'
|
||||
maker_address:
|
||||
type: string
|
||||
description: Maker address
|
||||
earning_percentage:
|
||||
type: number
|
||||
format: double
|
||||
description: Percentage of total rewards the user is earning
|
||||
earnings:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/AssetEarning'
|
||||
required:
|
||||
- condition_id
|
||||
- market_id
|
||||
- question
|
||||
- tokens
|
||||
RewardsToken:
|
||||
type: object
|
||||
description: Token information for rewards markets
|
||||
properties:
|
||||
token_id:
|
||||
type: string
|
||||
description: Token ID
|
||||
outcome:
|
||||
type: string
|
||||
description: Outcome name (e.g., "YES", "NO")
|
||||
price:
|
||||
type: number
|
||||
format: double
|
||||
description: Current price of the token
|
||||
required:
|
||||
- token_id
|
||||
- outcome
|
||||
CurrentRewardConfig:
|
||||
type: object
|
||||
description: Reward configuration entry for a current rewards market
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: Rewards config ID (always 0 on /rewards/markets/current)
|
||||
asset_address:
|
||||
type: string
|
||||
description: Address of the reward asset
|
||||
start_date:
|
||||
type: string
|
||||
format: date
|
||||
description: Start date of the rewards period
|
||||
end_date:
|
||||
type: string
|
||||
format: date
|
||||
description: End date of the rewards period
|
||||
rate_per_day:
|
||||
type: number
|
||||
format: double
|
||||
description: Daily reward rate
|
||||
total_rewards:
|
||||
type: number
|
||||
format: double
|
||||
description: Total rewards amount
|
||||
required:
|
||||
- asset_address
|
||||
- start_date
|
||||
- rate_per_day
|
||||
AssetEarning:
|
||||
type: object
|
||||
description: Earnings for a specific asset
|
||||
properties:
|
||||
asset_address:
|
||||
type: string
|
||||
description: Address of the reward asset
|
||||
earnings:
|
||||
type: number
|
||||
format: double
|
||||
description: Amount of earnings
|
||||
asset_rate:
|
||||
type: number
|
||||
format: double
|
||||
description: Exchange rate of the asset
|
||||
required:
|
||||
- asset_address
|
||||
- earnings
|
||||
securitySchemes:
|
||||
polyApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_API_KEY
|
||||
description: Your API key
|
||||
polyAddress:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_ADDRESS
|
||||
description: Ethereum address associated with the API key
|
||||
polySignature:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_SIGNATURE
|
||||
description: HMAC signature of the request
|
||||
polyPassphrase:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_PASSPHRASE
|
||||
description: API key passphrase
|
||||
polyTimestamp:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
Reference in New Issue
Block a user