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:
Etherdrake
2026-03-27 13:12:05 +01:00
parent be426d8d2e
commit 240ece03cc
21 changed files with 3929 additions and 2 deletions
+29 -1
View File
@@ -63,7 +63,7 @@ https://docs.polymarket.com/api-reference/market-data/get-order-books-request-bo
https://docs.polymarket.com/api-reference/market-data/get-market-price.md
https://docs.polymarket.com/api-reference/market-data/get-market-prices-query-parameters.md
https://docs.polymarket.com/api-reference/market-data/get-market-prices-request-body.md
https://docs.polymarket.com/api-reference/market-data/get-midpoint-price.md
https://docs.polymarket.com/api-reference/data/get-midpoint-price.md
https://docs.polymarket.com/api-reference/market-data/get-midpoint-prices-query-parameters.md
https://docs.polymarket.com/api-reference/market-data/get-midpoint-prices-request-body.md
https://docs.polymarket.com/api-reference/market-data/get-spread.md
@@ -339,3 +339,31 @@ https://docs.polymarket.com/trading/clients/builder.md
https://docs.polymarket.com/index.md
https://docs.polymarket.com/resources/contract-addresses.md
https://docs.polymarket.com/resources/error-codes.md
## NEW - API Reference - Rebates (2026-03-27)
https://docs.polymarket.com/api-reference/rebates/get-current-rebated-fees-for-a-maker.md
## NEW - API Reference - Relayer
https://docs.polymarket.com/api-reference/relayer-api-keys/get-all-relayer-api-keys.md
https://docs.polymarket.com/api-reference/relayer/check-if-a-safe-is-deployed.md
https://docs.polymarket.com/api-reference/relayer/get-a-transaction-by-id.md
https://docs.polymarket.com/api-reference/relayer/get-current-nonce-for-a-user.md
https://docs.polymarket.com/api-reference/relayer/get-recent-transactions-for-a-user.md
https://docs.polymarket.com/api-reference/relayer/get-relayer-address-and-nonce.md
https://docs.polymarket.com/api-reference/relayer/submit-a-transaction.md
## NEW - API Reference - Rewards
https://docs.polymarket.com/api-reference/rewards/get-current-active-rewards-configurations.md
https://docs.polymarket.com/api-reference/rewards/get-earnings-for-user-by-date.md
https://docs.polymarket.com/api-reference/rewards/get-multiple-markets-with-rewards.md
https://docs.polymarket.com/api-reference/rewards/get-raw-rewards-for-a-specific-market.md
https://docs.polymarket.com/api-reference/rewards/get-reward-percentages-for-user.md
https://docs.polymarket.com/api-reference/rewards/get-total-earnings-for-user-by-date.md
https://docs.polymarket.com/api-reference/rewards/get-user-earnings-and-markets-configuration.md
## NEW - Resources
https://docs.polymarket.com/resources/blockchain-data.md
https://docs.polymarket.com/resources/referral-program.md
## NEW - Trading
https://docs.polymarket.com/trading/matching-engine.md
@@ -0,0 +1,107 @@
> ## 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 midpoint price
> Retrieves the midpoint price for a specific token ID.
The midpoint is calculated as the average of the best bid and best ask prices.
## OpenAPI
````yaml /api-spec/clob-openapi.yaml get /midpoint
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:
/midpoint:
get:
tags:
- Data
summary: Get midpoint price
description: >
Retrieves the midpoint price for a specific token ID.
The midpoint is calculated as the average of the best bid and best ask
prices.
operationId: getMidpoint
parameters:
- name: token_id
in: query
description: Token ID (asset ID)
required: true
schema:
type: string
example: 0xabc123def456...
responses:
'200':
description: Successfully retrieved midpoint price
content:
application/json:
schema:
type: object
required:
- mid_price
properties:
mid_price:
type: string
description: Midpoint price as a string
example: '0.45'
'400':
description: Bad request - Invalid token id
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: Invalid token id
'404':
description: Not found - No orderbook exists for the requested token id
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: No orderbook exists for the requested token id
security: []
components:
schemas:
ErrorResponse:
type: object
required:
- error
properties:
error:
type: string
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -1 +0,0 @@
null
@@ -0,0 +1,160 @@
> ## 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 rebated fees for a maker
> Returns the current rebated fees for a maker address on a given date.
Each entry includes the condition ID, asset address, and the USDC amount rebated.
This endpoint does not require authentication.
## OpenAPI
````yaml /api-spec/clob-openapi.yaml get /rebates/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:
/rebates/current:
get:
tags:
- Rebates
summary: Get current rebated fees for a maker
description: >
Returns the current rebated fees for a maker address on a given date.
Each entry includes the condition ID, asset address, and the USDC amount
rebated.
This endpoint does not require authentication.
operationId: getCurrentRebatedFees
parameters:
- name: date
in: query
description: Date in YYYY-MM-DD format
required: true
schema:
type: string
format: date
example: '2026-02-27'
- name: maker_address
in: query
description: Ethereum address of the maker
required: true
schema:
type: string
example: '0xFeA4cB3dD4ca7CefD3368653B7D6FF9BcDFca604'
responses:
'200':
description: Successfully retrieved rebated fees
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RebatedFees'
example:
- date: '2026-02-27'
condition_id: >-
0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af
asset_address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
maker_address: '0xFeA4cB3dD4ca7CefD3368653B7D6FF9BcDFca604'
rebated_fees_usdc: '0.237519'
'400':
description: Bad request - Invalid parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
invalid_date:
summary: Invalid date
value:
error: Invalid date
invalid_maker_address:
summary: Invalid maker address
value:
error: Invalid maker_address
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: Internal server error
components:
schemas:
RebatedFees:
type: object
description: Rebated fees for a maker on a specific market and date
required:
- date
- condition_id
- asset_address
- maker_address
- rebated_fees_usdc
properties:
date:
type: string
description: Date of the rebate (YYYY-MM-DD)
example: '2026-02-27'
condition_id:
type: string
description: Condition ID of the market
example: '0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af'
asset_address:
type: string
description: Asset address (e.g. USDC contract)
example: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
maker_address:
type: string
description: Maker's Ethereum address
example: '0xFeA4cB3dD4ca7CefD3368653B7D6FF9BcDFca604'
rebated_fees_usdc:
type: string
description: Rebated fee amount in USDC
example: '0.237519'
ErrorResponse:
type: object
required:
- error
properties:
error:
type: string
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -0,0 +1,141 @@
> ## 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 all relayer API keys
> Returns all relayer API keys for the authenticated address. Auth allowed: Gamma auth or Relayer API key auth (`RELAYER_API_KEY` + `RELAYER_API_KEY_ADDRESS`).
## OpenAPI
````yaml /api-spec/relayer-openapi.yaml get /relayer/api/keys
openapi: 3.0.3
info:
title: Polymarket Relayer API
version: 1.0.0
description: HTTP API for the Polymarket Relayer. Submit and track gasless transactions.
servers:
- url: https://relayer-v2.polymarket.com
description: Polymarket Relayer API
security: []
tags:
- name: Relayer
description: Relayer transaction operations
- name: Relayer API Keys
description: >
Relayer API keys let a user authenticate requests to relayer endpoints
without Gamma auth.
However, Relayer API keys can only be created using Gamma auth. Every
address can create a maximum of 100 keys.
The API key auth headers are:
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
`RELAYER_API_KEY_ADDRESS` must match the address that owns the key.
paths:
/relayer/api/keys:
get:
tags:
- Relayer API Keys
summary: Get all relayer API keys
description: >
Returns all relayer API keys for the authenticated address. Auth
allowed: Gamma auth or Relayer API key auth (`RELAYER_API_KEY` +
`RELAYER_API_KEY_ADDRESS`).
parameters:
- name: RELAYER_API_KEY
in: header
required: false
description: Relayer API key (when using relayer API key auth)
schema:
type: string
example: 01967c03-b8c8-7000-8f68-8b8eaec6fd3d
- name: RELAYER_API_KEY_ADDRESS
in: header
required: false
description: >-
Address that owns the key (when using relayer API key auth). Must
match the address that owns the key.
schema:
$ref: '#/components/schemas/Address'
example: 0xabc...
responses:
'200':
description: >-
API keys retrieved successfully. Returns an empty array if no keys
exist for the authenticated address.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RelayerApiKey'
example:
- apiKey: 01967c03-b8c8-7000-8f68-8b8eaec6fd3d
address: 0xabc...
createdAt: '2026-02-24T18:20:11.237485Z'
updatedAt: '2026-02-24T18:20:11.237485Z'
'401':
description: Unauthorized - Missing or invalid auth
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: invalid authorization
'403':
description: Forbidden - Unsupported auth mechanism
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: not allowed
components:
schemas:
Address:
type: string
description: Ethereum address (0x-prefixed, 40 hex chars)
pattern: ^0x[a-fA-F0-9]{40}$
example: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
RelayerApiKey:
type: object
properties:
apiKey:
type: string
description: The relayer API key
example: 01967c03-b8c8-7000-8f68-8b8eaec6fd3d
address:
$ref: '#/components/schemas/Address'
description: The address that owns the key
example: 0xabc...
createdAt:
type: string
format: date-time
description: Timestamp when the key was created
example: '2026-02-24T18:20:11.237485Z'
updatedAt:
type: string
format: date-time
description: Timestamp when the key was last updated
example: '2026-02-24T18:20:11.237485Z'
ErrorResponse:
type: object
properties:
error:
type: string
required:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -0,0 +1,108 @@
> ## 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.
# Check if a safe is deployed
> Returns a payload that determines if a safe is deployed. Takes in the user's Polymarket proxy address.
## OpenAPI
````yaml /api-spec/relayer-openapi.yaml get /deployed
openapi: 3.0.3
info:
title: Polymarket Relayer API
version: 1.0.0
description: HTTP API for the Polymarket Relayer. Submit and track gasless transactions.
servers:
- url: https://relayer-v2.polymarket.com
description: Polymarket Relayer API
security: []
tags:
- name: Relayer
description: Relayer transaction operations
- name: Relayer API Keys
description: >
Relayer API keys let a user authenticate requests to relayer endpoints
without Gamma auth.
However, Relayer API keys can only be created using Gamma auth. Every
address can create a maximum of 100 keys.
The API key auth headers are:
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
`RELAYER_API_KEY_ADDRESS` must match the address that owns the key.
paths:
/deployed:
get:
tags:
- Relayer
summary: Check if a safe is deployed
description: >
Returns a payload that determines if a safe is deployed. Takes in the
user's Polymarket proxy address.
parameters:
- name: address
in: query
required: true
description: User's Polymarket proxy address
schema:
$ref: '#/components/schemas/Address'
example: '0x6d8c4e9aDF5748Af82Dabe2C6225207770d6B4fa'
responses:
'200':
description: Deployment status retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/DeployedResponse'
example:
deployed: true
'400':
description: Bad Request - Missing or invalid address
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: invalid address
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
Address:
type: string
description: Ethereum address (0x-prefixed, 40 hex chars)
pattern: ^0x[a-fA-F0-9]{40}$
example: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
DeployedResponse:
type: object
properties:
deployed:
type: boolean
description: Whether the safe is deployed
example: true
ErrorResponse:
type: object
properties:
error:
type: string
required:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -0,0 +1,203 @@
> ## 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 a transaction by ID
> Gets a transaction submitted to the Relayer. Takes in a required transaction ID as a query parameter.
## OpenAPI
````yaml /api-spec/relayer-openapi.yaml get /transaction
openapi: 3.0.3
info:
title: Polymarket Relayer API
version: 1.0.0
description: HTTP API for the Polymarket Relayer. Submit and track gasless transactions.
servers:
- url: https://relayer-v2.polymarket.com
description: Polymarket Relayer API
security: []
tags:
- name: Relayer
description: Relayer transaction operations
- name: Relayer API Keys
description: >
Relayer API keys let a user authenticate requests to relayer endpoints
without Gamma auth.
However, Relayer API keys can only be created using Gamma auth. Every
address can create a maximum of 100 keys.
The API key auth headers are:
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
`RELAYER_API_KEY_ADDRESS` must match the address that owns the key.
paths:
/transaction:
get:
tags:
- Relayer
summary: Get a transaction by ID
description: >
Gets a transaction submitted to the Relayer. Takes in a required
transaction ID as a query parameter.
parameters:
- name: id
in: query
required: true
description: Transaction ID
schema:
type: string
example: 0190b317-a1d3-7bec-9b91-eeb6dcd3a620
responses:
'200':
description: Transaction retrieved successfully
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RelayerTransaction'
example:
- transactionID: 0190b317-a1d3-7bec-9b91-eeb6dcd3a620
transactionHash: >-
0x38cbfbeae8fffa4e2b187ee5978d3ee9cafc53af0363ed90a35b7ea9016535d8
from: '0x6e0c80c90ea6c15917308f820eac91ce2724b5b5'
to: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
proxyAddress: '0x6d8c4e9adf5748af82dabe2c6225207770d6b4fa'
data: 0x...
nonce: '60'
value: ''
signature: >-
0x01a060c734d7bdf4adde50c4a7e574036b1f8b12890911bdd1c1cfdcd77502381b89fa8a47c36f62a0b9f1cdfee7b260fd8108536db9f6b2089c02637e7de9fc20
state: STATE_CONFIRMED
type: SAFE
owner: '0x6e0c80c90ea6c15917308f820eac91ce2724b5b5'
metadata: ''
createdAt: '2024-07-14T21:13:08.819782Z'
updatedAt: '2024-07-14T21:13:46.576639Z'
'400':
description: Bad Request - Missing or invalid transaction ID
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: invalid id
'404':
description: Transaction not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: transaction not found
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
RelayerTransaction:
type: object
properties:
transactionID:
type: string
description: Unique identifier for the transaction
example: 0190b317-a1d3-7bec-9b91-eeb6dcd3a620
transactionHash:
type: string
description: Onchain transaction hash (available once confirmed)
example: '0x38cbfbeae8fffa4e2b187ee5978d3ee9cafc53af0363ed90a35b7ea9016535d8'
from:
$ref: '#/components/schemas/Address'
description: Signer address
example: '0x6e0c80c90ea6c15917308f820eac91ce2724b5b5'
to:
$ref: '#/components/schemas/Address'
description: Target contract address
example: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
proxyAddress:
$ref: '#/components/schemas/Address'
description: User's Polymarket proxy wallet address
example: '0x6d8c4e9adf5748af82dabe2c6225207770d6b4fa'
data:
type: string
description: Encoded transaction data (0x-prefixed hex string)
example: 0x...
nonce:
type: string
description: Transaction nonce
example: '60'
value:
type: string
description: Transaction value
example: ''
signature:
type: string
description: Transaction signature (0x-prefixed hex string)
example: >-
0x01a060c734d7bdf4adde50c4a7e574036b1f8b12890911bdd1c1cfdcd77502381b89fa8a47c36f62a0b9f1cdfee7b260fd8108536db9f6b2089c02637e7de9fc20
state:
type: string
description: Current state of the transaction
enum:
- STATE_NEW
- STATE_EXECUTED
- STATE_MINED
- STATE_CONFIRMED
- STATE_INVALID
- STATE_FAILED
example: STATE_CONFIRMED
type:
type: string
description: Transaction type
enum:
- SAFE
- PROXY
example: SAFE
owner:
$ref: '#/components/schemas/Address'
description: Owner address
example: '0x6e0c80c90ea6c15917308f820eac91ce2724b5b5'
metadata:
type: string
description: Transaction metadata
example: ''
createdAt:
type: string
format: date-time
description: Timestamp when the transaction was created
example: '2024-07-14T21:13:08.819782Z'
updatedAt:
type: string
format: date-time
description: Timestamp when the transaction was last updated
example: '2024-07-14T21:13:46.576639Z'
ErrorResponse:
type: object
properties:
error:
type: string
required:
- error
Address:
type: string
description: Ethereum address (0x-prefixed, 40 hex chars)
pattern: ^0x[a-fA-F0-9]{40}$
example: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
````
Built with [Mintlify](https://mintlify.com).
@@ -0,0 +1,123 @@
> ## 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 nonce for a user
> Gets the current Proxy or Safe nonce for a user. Takes in the user's signer address and the type of nonce to retrieve.
## OpenAPI
````yaml /api-spec/relayer-openapi.yaml get /nonce
openapi: 3.0.3
info:
title: Polymarket Relayer API
version: 1.0.0
description: HTTP API for the Polymarket Relayer. Submit and track gasless transactions.
servers:
- url: https://relayer-v2.polymarket.com
description: Polymarket Relayer API
security: []
tags:
- name: Relayer
description: Relayer transaction operations
- name: Relayer API Keys
description: >
Relayer API keys let a user authenticate requests to relayer endpoints
without Gamma auth.
However, Relayer API keys can only be created using Gamma auth. Every
address can create a maximum of 100 keys.
The API key auth headers are:
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
`RELAYER_API_KEY_ADDRESS` must match the address that owns the key.
paths:
/nonce:
get:
tags:
- Relayer
summary: Get current nonce for a user
description: >
Gets the current Proxy or Safe nonce for a user. Takes in the user's
signer address and the type of nonce to retrieve.
parameters:
- name: address
in: query
required: true
description: User's signer address
schema:
$ref: '#/components/schemas/Address'
example: '0x77837466dd64fb52ECD00C737F060d0ff5CCB575'
- name: type
in: query
required: true
description: Type of nonce to retrieve
schema:
type: string
enum:
- PROXY
- SAFE
example: PROXY
responses:
'200':
description: Nonce retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/NonceResponse'
example:
nonce: '31'
'400':
description: Bad Request - Missing or invalid query parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
invalidAddress:
value:
error: invalid address
invalidType:
value:
error: invalid type
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
Address:
type: string
description: Ethereum address (0x-prefixed, 40 hex chars)
pattern: ^0x[a-fA-F0-9]{40}$
example: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
NonceResponse:
type: object
properties:
nonce:
type: string
description: Current nonce value
example: '31'
ErrorResponse:
type: object
properties:
error:
type: string
required:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -0,0 +1,271 @@
> ## 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 recent transactions for a user
> Gets the most recent transactions submitted to the Relayer, owned by a specific user. Authenticated using Builder API Keys or Relayer API Keys.
**Builder API Key auth headers:**
- `POLY_BUILDER_API_KEY`
- `POLY_BUILDER_TIMESTAMP`
- `POLY_BUILDER_PASSPHRASE`
- `POLY_BUILDER_SIGNATURE`
**Relayer API Key auth headers:**
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
## OpenAPI
````yaml /api-spec/relayer-openapi.yaml get /transactions
openapi: 3.0.3
info:
title: Polymarket Relayer API
version: 1.0.0
description: HTTP API for the Polymarket Relayer. Submit and track gasless transactions.
servers:
- url: https://relayer-v2.polymarket.com
description: Polymarket Relayer API
security: []
tags:
- name: Relayer
description: Relayer transaction operations
- name: Relayer API Keys
description: >
Relayer API keys let a user authenticate requests to relayer endpoints
without Gamma auth.
However, Relayer API keys can only be created using Gamma auth. Every
address can create a maximum of 100 keys.
The API key auth headers are:
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
`RELAYER_API_KEY_ADDRESS` must match the address that owns the key.
paths:
/transactions:
get:
tags:
- Relayer
summary: Get recent transactions for a user
description: >
Gets the most recent transactions submitted to the Relayer, owned by a
specific user. Authenticated using Builder API Keys or Relayer API Keys.
**Builder API Key auth headers:**
- `POLY_BUILDER_API_KEY`
- `POLY_BUILDER_TIMESTAMP`
- `POLY_BUILDER_PASSPHRASE`
- `POLY_BUILDER_SIGNATURE`
**Relayer API Key auth headers:**
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
parameters:
- name: POLY_BUILDER_API_KEY
in: header
required: false
description: Builder API key (when using Builder API Key auth)
schema:
type: string
- name: POLY_BUILDER_TIMESTAMP
in: header
required: false
description: Unix timestamp (when using Builder API Key auth)
schema:
type: string
- name: POLY_BUILDER_PASSPHRASE
in: header
required: false
description: Builder passphrase (when using Builder API Key auth)
schema:
type: string
- name: POLY_BUILDER_SIGNATURE
in: header
required: false
description: HMAC-SHA256 signature (when using Builder API Key auth)
schema:
type: string
- name: RELAYER_API_KEY
in: header
required: false
description: Relayer API key (when using Relayer API Key auth)
schema:
type: string
- name: RELAYER_API_KEY_ADDRESS
in: header
required: false
description: Address that owns the key (when using Relayer API Key auth)
schema:
$ref: '#/components/schemas/Address'
responses:
'200':
description: Transactions retrieved successfully
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RelayerTransaction'
example:
- transactionID: 0190b317-a1d3-7bec-9b91-eeb6dcd3a620
transactionHash: >-
0x38cbfbeae8fffa4e2b187ee5978d3ee9cafc53af0363ed90a35b7ea9016535d8
from: '0x6e0c80c90ea6c15917308f820eac91ce2724b5b5'
to: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
proxyAddress: '0x6d8c4e9adf5748af82dabe2c6225207770d6b4fa'
data: 0x...
nonce: '60'
value: ''
signature: >-
0x01a060c734d7bdf4adde50c4a7e574036b1f8b12890911bdd1c1cfdcd77502381b89fa8a47c36f62a0b9f1cdfee7b260fd8108536db9f6b2089c02637e7de9fc20
state: STATE_CONFIRMED
type: SAFE
owner: '0x6e0c80c90ea6c15917308f820eac91ce2724b5b5'
metadata: ''
createdAt: '2024-07-14T21:13:08.819782Z'
updatedAt: '2024-07-14T21:13:46.576639Z'
- transactionID: 0190a792-b5be-7cad-9eae-9941f2b47ebf
transactionHash: >-
0x0b2ff276b65382fc5593cdd965168c878006684a7fc8d2d011eddeddccd87335
from: '0x6e0c80c90ea6c15917308f820eac91ce2724b5b5'
to: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
proxyAddress: '0x6d8c4e9adf5748af82dabe2c6225207770d6b4fa'
data: 0x...
nonce: '58'
value: ''
signature: >-
0x9d99a48b6552183dc44018dbbab0e196fa59511e5661b961416e93138870814f3c474367362524ccc6865a8558f2543cc8e1b2e7336e39e6cdb4ad6f09d0db6a20
state: STATE_CONFIRMED
type: SAFE
owner: '0x6e0c80c90ea6c15917308f820eac91ce2724b5b5'
metadata: ''
createdAt: '2024-07-12T15:32:08.254831Z'
updatedAt: '2024-07-12T15:32:45.265257Z'
'401':
description: Unauthorized - Invalid authentication
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: invalid authorization
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: internal server error
components:
schemas:
Address:
type: string
description: Ethereum address (0x-prefixed, 40 hex chars)
pattern: ^0x[a-fA-F0-9]{40}$
example: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
RelayerTransaction:
type: object
properties:
transactionID:
type: string
description: Unique identifier for the transaction
example: 0190b317-a1d3-7bec-9b91-eeb6dcd3a620
transactionHash:
type: string
description: Onchain transaction hash (available once confirmed)
example: '0x38cbfbeae8fffa4e2b187ee5978d3ee9cafc53af0363ed90a35b7ea9016535d8'
from:
$ref: '#/components/schemas/Address'
description: Signer address
example: '0x6e0c80c90ea6c15917308f820eac91ce2724b5b5'
to:
$ref: '#/components/schemas/Address'
description: Target contract address
example: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
proxyAddress:
$ref: '#/components/schemas/Address'
description: User's Polymarket proxy wallet address
example: '0x6d8c4e9adf5748af82dabe2c6225207770d6b4fa'
data:
type: string
description: Encoded transaction data (0x-prefixed hex string)
example: 0x...
nonce:
type: string
description: Transaction nonce
example: '60'
value:
type: string
description: Transaction value
example: ''
signature:
type: string
description: Transaction signature (0x-prefixed hex string)
example: >-
0x01a060c734d7bdf4adde50c4a7e574036b1f8b12890911bdd1c1cfdcd77502381b89fa8a47c36f62a0b9f1cdfee7b260fd8108536db9f6b2089c02637e7de9fc20
state:
type: string
description: Current state of the transaction
enum:
- STATE_NEW
- STATE_EXECUTED
- STATE_MINED
- STATE_CONFIRMED
- STATE_INVALID
- STATE_FAILED
example: STATE_CONFIRMED
type:
type: string
description: Transaction type
enum:
- SAFE
- PROXY
example: SAFE
owner:
$ref: '#/components/schemas/Address'
description: Owner address
example: '0x6e0c80c90ea6c15917308f820eac91ce2724b5b5'
metadata:
type: string
description: Transaction metadata
example: ''
createdAt:
type: string
format: date-time
description: Timestamp when the transaction was created
example: '2024-07-14T21:13:08.819782Z'
updatedAt:
type: string
format: date-time
description: Timestamp when the transaction was last updated
example: '2024-07-14T21:13:46.576639Z'
ErrorResponse:
type: object
properties:
error:
type: string
required:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -0,0 +1,128 @@
> ## 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 relayer address and nonce
> Fetches the relayer address and nonce for a specific user. Takes in the user's signer address and the type of nonce to retrieve.
## OpenAPI
````yaml /api-spec/relayer-openapi.yaml get /relay-payload
openapi: 3.0.3
info:
title: Polymarket Relayer API
version: 1.0.0
description: HTTP API for the Polymarket Relayer. Submit and track gasless transactions.
servers:
- url: https://relayer-v2.polymarket.com
description: Polymarket Relayer API
security: []
tags:
- name: Relayer
description: Relayer transaction operations
- name: Relayer API Keys
description: >
Relayer API keys let a user authenticate requests to relayer endpoints
without Gamma auth.
However, Relayer API keys can only be created using Gamma auth. Every
address can create a maximum of 100 keys.
The API key auth headers are:
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
`RELAYER_API_KEY_ADDRESS` must match the address that owns the key.
paths:
/relay-payload:
get:
tags:
- Relayer
summary: Get relayer address and nonce
description: >
Fetches the relayer address and nonce for a specific user. Takes in the
user's signer address and the type of nonce to retrieve.
parameters:
- name: address
in: query
required: true
description: User's signer address
schema:
$ref: '#/components/schemas/Address'
example: '0x77837466dd64fb52ECD00C737F060d0ff5CCB575'
- name: type
in: query
required: true
description: Type of nonce to retrieve
schema:
type: string
enum:
- PROXY
- SAFE
example: PROXY
responses:
'200':
description: Relay payload retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/RelayPayloadResponse'
example:
address: '0x4da9395388791c22684e03779c3de10934eb9cfb'
nonce: '31'
'400':
description: Bad Request - Missing or invalid query parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
invalidAddress:
value:
error: invalid address
invalidType:
value:
error: invalid type
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
Address:
type: string
description: Ethereum address (0x-prefixed, 40 hex chars)
pattern: ^0x[a-fA-F0-9]{40}$
example: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
RelayPayloadResponse:
type: object
properties:
address:
$ref: '#/components/schemas/Address'
description: Relayer address
example: '0x4da9395388791c22684e03779c3de10934eb9cfb'
nonce:
type: string
description: Current nonce value
example: '31'
ErrorResponse:
type: object
properties:
error:
type: string
required:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -0,0 +1,295 @@
> ## 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.
# Submit a transaction
> Submit a transaction request to the Relayer. Authenticated using Builder API Keys or Relayer API Keys.
**Builder API Key auth headers:**
- `POLY_BUILDER_API_KEY`
- `POLY_BUILDER_TIMESTAMP`
- `POLY_BUILDER_PASSPHRASE`
- `POLY_BUILDER_SIGNATURE`
**Relayer API Key auth headers:**
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
## OpenAPI
````yaml /api-spec/relayer-openapi.yaml post /submit
openapi: 3.0.3
info:
title: Polymarket Relayer API
version: 1.0.0
description: HTTP API for the Polymarket Relayer. Submit and track gasless transactions.
servers:
- url: https://relayer-v2.polymarket.com
description: Polymarket Relayer API
security: []
tags:
- name: Relayer
description: Relayer transaction operations
- name: Relayer API Keys
description: >
Relayer API keys let a user authenticate requests to relayer endpoints
without Gamma auth.
However, Relayer API keys can only be created using Gamma auth. Every
address can create a maximum of 100 keys.
The API key auth headers are:
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
`RELAYER_API_KEY_ADDRESS` must match the address that owns the key.
paths:
/submit:
post:
tags:
- Relayer
summary: Submit a transaction
description: >
Submit a transaction request to the Relayer. Authenticated using Builder
API Keys or Relayer API Keys.
**Builder API Key auth headers:**
- `POLY_BUILDER_API_KEY`
- `POLY_BUILDER_TIMESTAMP`
- `POLY_BUILDER_PASSPHRASE`
- `POLY_BUILDER_SIGNATURE`
**Relayer API Key auth headers:**
- `RELAYER_API_KEY`
- `RELAYER_API_KEY_ADDRESS`
parameters:
- name: POLY_BUILDER_API_KEY
in: header
required: false
description: Builder API key (when using Builder API Key auth)
schema:
type: string
- name: POLY_BUILDER_TIMESTAMP
in: header
required: false
description: Unix timestamp (when using Builder API Key auth)
schema:
type: string
- name: POLY_BUILDER_PASSPHRASE
in: header
required: false
description: Builder passphrase (when using Builder API Key auth)
schema:
type: string
- name: POLY_BUILDER_SIGNATURE
in: header
required: false
description: HMAC-SHA256 signature (when using Builder API Key auth)
schema:
type: string
- name: RELAYER_API_KEY
in: header
required: false
description: Relayer API key (when using Relayer API Key auth)
schema:
type: string
- name: RELAYER_API_KEY_ADDRESS
in: header
required: false
description: Address that owns the key (when using Relayer API Key auth)
schema:
$ref: '#/components/schemas/Address'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SubmitRequest'
example:
from: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
to: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
proxyWallet: '0x6d8c4e9aDF5748Af82Dabe2C6225207770d6B4fa'
data: 0x...
nonce: '60'
signature: >-
0x01a060c734d7bdf4adde50c4a7e574036b1f8b12890911bdd1c1cfdcd77502381b89fa8a47c36f62a0b9f1cdfee7b260fd8108536db9f6b2089c02637e7de9fc20
signatureParams:
gasPrice: '0'
operation: '0'
safeTxnGas: '0'
baseGas: '0'
gasToken: '0x0000000000000000000000000000000000000000'
refundReceiver: '0x0000000000000000000000000000000000000000'
type: SAFE
responses:
'200':
description: Transaction submitted successfully
content:
application/json:
schema:
$ref: '#/components/schemas/SubmitResponse'
example:
transactionID: 0190b317-a1d3-7bec-9b91-eeb6dcd3a620
transactionHash: ''
state: STATE_NEW
'400':
description: Bad Request - Invalid transaction payload, fields, or signature
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
invalidPayload:
value:
error: invalid transaction request payload
validationError:
value:
error: bad request
'401':
description: Unauthorized - Invalid authentication
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: invalid authorization
'429':
description: Too Many Requests - Quota exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error: quota exceeded
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
internalError:
value:
error: internal error
serverError:
value:
error: internal server error
components:
schemas:
Address:
type: string
description: Ethereum address (0x-prefixed, 40 hex chars)
pattern: ^0x[a-fA-F0-9]{40}$
example: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
SubmitRequest:
type: object
required:
- from
- to
- proxyWallet
- data
- nonce
- signature
- signatureParams
- type
properties:
from:
$ref: '#/components/schemas/Address'
description: Signer address
to:
$ref: '#/components/schemas/Address'
description: Target contract address
proxyWallet:
$ref: '#/components/schemas/Address'
description: User's Polymarket proxy wallet address
data:
type: string
description: Encoded transaction data (0x-prefixed hex string)
example: 0x...
nonce:
type: string
description: Transaction nonce
example: '60'
signature:
type: string
description: Transaction signature (0x-prefixed hex string)
example: >-
0x01a060c734d7bdf4adde50c4a7e574036b1f8b12890911bdd1c1cfdcd77502381b89fa8a47c36f62a0b9f1cdfee7b260fd8108536db9f6b2089c02637e7de9fc20
signatureParams:
$ref: '#/components/schemas/SignatureParams'
type:
type: string
description: Transaction type
enum:
- SAFE
- PROXY
example: SAFE
SubmitResponse:
type: object
properties:
transactionID:
type: string
description: Unique identifier for the submitted transaction
example: 0190b317-a1d3-7bec-9b91-eeb6dcd3a620
transactionHash:
type: string
description: Onchain transaction hash (empty on initial submission)
example: ''
state:
type: string
description: Current state of the transaction
example: STATE_NEW
ErrorResponse:
type: object
properties:
error:
type: string
required:
- error
SignatureParams:
type: object
properties:
gasPrice:
type: string
description: Gas price
example: '0'
operation:
type: string
description: Operation type
example: '0'
safeTxnGas:
type: string
description: Safe transaction gas
example: '0'
baseGas:
type: string
description: Base gas
example: '0'
gasToken:
$ref: '#/components/schemas/Address'
description: Gas token address
example: '0x0000000000000000000000000000000000000000'
refundReceiver:
$ref: '#/components/schemas/Address'
description: Refund receiver address
example: '0x0000000000000000000000000000000000000000'
````
Built with [Mintlify](https://mintlify.com).
@@ -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).
+73
View File
@@ -0,0 +1,73 @@
> ## 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.
# Data Resources
> Access Polymarket on-chain activity for data & analytics
Polymarket data that lands on the blockchain, such as trades, balances, positions, and redeems, is available through various on-chain analytics platforms and blockchain data providers. Polymarket also provides its own APIs and WebSockets. See the [API Endpoints reference](/quickstart/reference/endpoints) for more information.
The purpose of this page is to serve as a public good for Polymarket builders, researches, and analysts alike.
***
## Data
### Goldsky
[Goldsky](https://docs.goldsky.com/chains/polymarket) provides real-time streaming pipelines for Polymarket on-chain activity (i.e. trades, balances, positions, etc...) into your own database/data warehouse.
Goldsky also partnered with [ClickHouse](https://clickhouse.com) to create [CryptoHouse](https://crypto.clickhouse.com), where you can query Polymarket on-chain data using SQL.
### Dune
[Dune](https://dune.com) is a blockchain analytics platform that has Polymarket on-chain activity (i.e. trades, balances, positions, etc...). Query Polymarket data using SQL, create custom dashboards, and more.
Here are a few simple queries to get started:
| Query | Description | Link |
| ------------- | --------------------------------------------- | --------------------------------------------------- |
| Volume | Notional Volume and Maker & Taker USDC Volume | [View Dune Query](https://dune.com/queries/6545441) |
| TVL | USDC locked in Polymarket smart contracts | [View Dune Query](https://dune.com/queries/6588784) |
| Open Interest | Estimated market open interest, and over time | [View Dune Query](https://dune.com/queries/6555478) |
### Allium
[Allium](https://docs.allium.so/historical-data/predictions) is a blockchain analytics platform that has Polymarket on-chain activity (i.e. trades, balances, positions, etc...). Query Polymarket data using SQL, create custom dashboards, and more.
\--
## Dashboards
Third-party blockchain analytics platforms that aggregate and visualize Polymarket data:
<CardGroup cols={4}>
<Card title="Blockworks" img="https://pbs.twimg.com/profile_images/1651677302634483712/7s2FxV2K_400x400.jpg" href="https://blockworks.com/analytics/polymarket" />
<Card title="Artemis" img="https://pbs.twimg.com/profile_images/1896982195723546624/2XeO9mPb_400x400.png" href="https://app.artemisanalytics.com/asset/polymarket?from=assets" />
<Card title="Dune" img="https://pbs.twimg.com/profile_images/1986458079248986112/qq80s3hx_400x400.jpg" href="https://dune.com/discover/content/popular?q=polymarket&resource-type=dashboards" />
<Card title="DeFiLlama" img="https://pbs.twimg.com/profile_images/1915756547705036800/rAeLzZqs_400x400.jpg" href="https://defillama.com/protocol/polymarket" />
<Card title="The Block" img="https://pbs.twimg.com/profile_images/1944749695525425152/9babG7Df_400x400.jpg" href="https://www.theblock.co/data/decentralized-finance/prediction-markets-and-betting" />
<Card title="Token Terminal" img="https://pbs.twimg.com/profile_images/1594678659222306817/SMum_RcQ_400x400.jpg" href="https://tokenterminal.com/explorer/projects/polymarket" />
<Card title="Allium" img="https://pbs.twimg.com/profile_images/1778926940407132160/UEwR3lHt_400x400.jpg" href="https://predictions.allium.so" />
</CardGroup>
### Community Dashboards
Community-created Dune dashboards of Polymarket on-chain analytics:
| Dashboard | Created By | Link |
| ------------------------------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------- |
| Polymarket Overview | [@datadashboards](https://x.com/datadashboards) | [View Dashboard](https://dune.com/datadashboards/polymarket-overview) |
| Polymarket Volume, OI, Markets, Addresses and TVL | [@hildobby](https://x.com/hildobby) | [View Dashboard](https://dune.com/hildobby/polymarket) |
| Polymarket Historical Accuracy | [@alexmccullaaa](https://x.com/alexmccullaaa) | [View Dashboard](https://dune.com/alexmccullough/how-accurate-is-polymarket) |
| Polymarket Builders Dashboard | [@defioasis](https://x.com/defioasis) | [View Dashboard](https://dune.com/gateresearch/pmbuilders) |
Built with [Mintlify](https://mintlify.com).
+37
View File
@@ -0,0 +1,37 @@
> ## 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.
# Referral Program
> Earn rewards by referring users to Polymarket
We're excited to announce Polymarket's referral program. Existing users who have traded at least \$10,000 in volume are eligible to sign up. Get paid to refer users to Polymarket, and be eligible for future Polymarket rewards.
## Referral Link
You can create a referral link at [polymarket.com/refer](http://polymarket.com/refer). When someone signs up using your link, you'll earn a percentage of the fees generated from their trades. Instead of manually creating referral links, you can also find a unique referral link on each market page when signed in to your Polymarket account.
The referral rewards are unlimited. The more that users you refer trade, the more you'll earn — also increasing your allocation in all future rewards.
## Boosted Rebate Period
For a limited time, you'll earn:
* 30% of fees generated from direct referrals
* 10% of fees generated from indirect referrals
Direct referrals are those you personally refer, and indirect referrals are those referred by someone you've referred (i.e. if you refer Alice and Alice refers Bob, you'll earn 10% of trading fees generated from Bob's trading volume as well).
These rewards will be for the first 180 days after a user has signed up to Polymarket, and this period is subject to change without notice.
## Notes
* You will earn referral rewards based on the gross trading fee that a user pays on polymarkets.
* Not all polymarkets have fees, so you won't make \$ from volume on every polymarket.
* Rewards are paid out once a day at midnight UTC.
* Rewards are unlimited. You will earn more money the more the users you refer trade on the platform.
* Polymarket reserves the right, in its sole discretion, to disqualify referrals that violate our Terms of Service — including but not limited to self-referrals or inauthentic trading.
Built with [Mintlify](https://mintlify.com).
+169
View File
@@ -0,0 +1,169 @@
> ## 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.
# Matching Engine Restarts
> Restart schedule, maintenance windows, and how to handle downtime
The Polymarket matching engine undergoes periodic restarts for maintenance and upgrades. This page covers the restart schedule, how to detect and handle downtime, and where to get advance notice of changes.
***
## Restart Schedule
The matching engine restarts **weekly on Tuesdays at 7:00 AM ET**. During a restart window, the engine is temporarily unavailable — typically for about **90 seconds**.
| | Details |
| -------------------- | ------------------------------------------- |
| **Cadence** | Weekly |
| **Day & time** | Tuesday, 7:00 AM ET |
| **Typical duration** | \~90 seconds |
| **What happens** | Order matching is paused, API returns `425` |
<Note>
Unscheduled restarts may occur for critical updates or hotfixes. These are announced with as much advance notice as possible.
</Note>
***
## Announcements
Matching engine changes — planned restarts, updates, and maintenance windows — are announced **before they happen** in these channels:
<CardGroup cols={2}>
<Card title="Telegram" icon="telegram" href="https://t.me/polytradingapis">
Join the Polymarket Trading APIs channel for real-time announcements.
</Card>
<Card title="Discord" icon="discord" href="https://discord.com/channels/710897173927297116/1473553279421255803">
Join the #trading-apis channel in the Polymarket Discord.
</Card>
</CardGroup>
Announcements typically include **what's changing**, the **scheduled time**, and the **expected downtime window**. The goal is \~2 days notice when possible.
***
## Handling HTTP 425
During a restart window, the CLOB API returns **HTTP 425 (Too Early)** on all order-related endpoints. This tells your client that the matching engine is restarting and will be back shortly.
### Recommended Retry Strategy
<Steps>
<Step title="Detect 425">
When you receive an HTTP `425` response, the matching engine is restarting. Do not treat this as a permanent error.
</Step>
<Step title="Back off and retry">
Wait and retry with exponential backoff. Start at 12 seconds and increase the interval on each retry.
</Step>
<Step title="Resume normal operation">
Once you receive a successful response, the engine is back online. Resume normal order flow.
</Step>
</Steps>
### Code Examples
Check the HTTP status code on responses to the CLOB API and retry on `425`:
<CodeGroup>
```typescript TypeScript theme={null}
const CLOB_HOST = "https://clob.polymarket.com";
async function postWithRetry(path: string, body: any, headers: Record<string, string>) {
const MAX_RETRIES = 10;
let delay = 1000;
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
const response = await fetch(`${CLOB_HOST}${path}`, {
method: "POST",
headers: { "Content-Type": "application/json", ...headers },
body: JSON.stringify(body),
});
if (response.status === 425) {
console.log(`Engine restarting, retrying in ${delay / 1000}s...`);
await new Promise((r) => setTimeout(r, delay));
delay = Math.min(delay * 2, 30000);
continue;
}
return response;
}
throw new Error("Engine restart exceeded maximum retry attempts");
}
```
```python Python theme={null}
import time
import requests
CLOB_HOST = "https://clob.polymarket.com"
def post_with_retry(path, body, headers, max_retries=10):
delay = 1
for attempt in range(max_retries):
response = requests.post(
f"{CLOB_HOST}{path}",
json=body,
headers=headers,
)
if response.status_code == 425:
print(f"Engine restarting, retrying in {delay}s...")
time.sleep(delay)
delay = min(delay * 2, 30)
continue
return response
raise Exception("Engine restart exceeded maximum retry attempts")
```
```rust Rust theme={null}
use polymarket_client_sdk::error::{Kind, StatusCode};
// Wrap SDK calls with retry logic for HTTP 425.
// Re-build and re-sign the order each attempt since SignedOrder is consumed.
let mut delay = std::time::Duration::from_secs(1);
for _ in 0..10 {
let order = client.limit_order()
.token_id(token_id).price(price).size(size).side(side)
.build().await?;
let signed = client.sign(&signer, order).await?;
match client.post_order(signed).await {
Ok(response) => return Ok(response),
Err(err) if err.kind() == Kind::Status => {
if let Some(status) = err.downcast_ref::<polymarket_client_sdk::error::Status>() {
if status.status_code == StatusCode::from_u16(425).unwrap() {
eprintln!("Engine restarting, retrying in {delay:?}...");
tokio::time::sleep(delay).await;
delay = (delay * 2).min(std::time::Duration::from_secs(30));
continue;
}
}
return Err(err);
}
Err(err) => return Err(err),
}
}
```
</CodeGroup>
***
## Best Practices
* **Subscribe to announcement channels** — get notified before restarts happen so you can prepare
* **Handle 425 gracefully** — treat it as a temporary condition, not an error; your retry logic should resume automatically
* **Avoid aggressive retries** — the engine needs time to reload orderbooks; rapid-fire retries won't speed things up and may hit rate limits once the engine is back
* **Log restart events** — track when your client encounters 425s to correlate with announced maintenance windows
Built with [Mintlify](https://mintlify.com).