Update Polymarket documentation (2026-02-19)
- Added new documentation URLs from llms.txt index - Updated TARGET.md with 244 total documentation pages - Scraped new pages for trading, concepts, and API reference sections - Updated changelog and new index pages
This commit is contained in:
@@ -0,0 +1,168 @@
|
||||
> ## 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.
|
||||
|
||||
# Cancel all orders
|
||||
|
||||
> Cancels all open orders for the authenticated user. Works even in cancel-only mode.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml delete /cancel-all
|
||||
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
|
||||
paths:
|
||||
/cancel-all:
|
||||
delete:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Cancel all orders
|
||||
description: >
|
||||
Cancels all open orders for the authenticated user. Works even in
|
||||
cancel-only mode.
|
||||
operationId: cancelAllOrders
|
||||
responses:
|
||||
'200':
|
||||
description: Cancellation results for all orders
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CancelOrdersResponse'
|
||||
examples:
|
||||
canceled:
|
||||
summary: All orders canceled
|
||||
value:
|
||||
canceled:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
- '0xfedcba0987654321fedcba0987654321fedcba09'
|
||||
not_canceled: {}
|
||||
mixed:
|
||||
summary: Some orders canceled, some not
|
||||
value:
|
||||
canceled:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
not_canceled:
|
||||
'0xfedcba0987654321fedcba0987654321fedcba09': Order already matched
|
||||
no_orders:
|
||||
summary: No orders to cancel
|
||||
value:
|
||||
canceled: []
|
||||
not_canceled: {}
|
||||
'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
|
||||
'503':
|
||||
description: >-
|
||||
Service unavailable - Trading disabled (cancels still work in
|
||||
cancel-only mode)
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: >-
|
||||
Trading is currently disabled. Check polymarket.com for
|
||||
updates
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
CancelOrdersResponse:
|
||||
type: object
|
||||
required:
|
||||
- canceled
|
||||
- not_canceled
|
||||
properties:
|
||||
canceled:
|
||||
type: array
|
||||
description: Array of order IDs that were successfully canceled
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
not_canceled:
|
||||
type: object
|
||||
description: Map of order IDs that could not be canceled with error messages
|
||||
additionalProperties:
|
||||
type: string
|
||||
example:
|
||||
'0xabcdef1234567890abcdef1234567890abcdef12': Order not found or already canceled
|
||||
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
|
||||
|
||||
````
|
||||
@@ -0,0 +1,208 @@
|
||||
> ## 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.
|
||||
|
||||
# Cancel multiple orders
|
||||
|
||||
> Cancels multiple orders by their IDs. Maximum 3000 orders per request.
|
||||
Duplicate order IDs in the request are automatically ignored.
|
||||
Works even in cancel-only mode.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml delete /orders
|
||||
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
|
||||
paths:
|
||||
/orders:
|
||||
delete:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Cancel multiple orders
|
||||
description: |
|
||||
Cancels multiple orders by their IDs. Maximum 3000 orders per request.
|
||||
Duplicate order IDs in the request are automatically ignored.
|
||||
Works even in cancel-only mode.
|
||||
operationId: cancelOrders
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
maxItems: 3000
|
||||
example:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
- '0xfedcba0987654321fedcba0987654321fedcba09'
|
||||
- '0x1234567890abcdef1234567890abcdef12345678'
|
||||
responses:
|
||||
'200':
|
||||
description: Cancellation results for all orders
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CancelOrdersResponse'
|
||||
examples:
|
||||
all_canceled:
|
||||
summary: All orders canceled
|
||||
value:
|
||||
canceled:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
- '0xfedcba0987654321fedcba0987654321fedcba09'
|
||||
- '0x1234567890abcdef1234567890abcdef12345678'
|
||||
not_canceled: {}
|
||||
mixed:
|
||||
summary: Some orders canceled, some not
|
||||
value:
|
||||
canceled:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
- '0xfedcba0987654321fedcba0987654321fedcba09'
|
||||
not_canceled:
|
||||
'0x1234567890abcdef1234567890abcdef12345678': Order already matched
|
||||
partial:
|
||||
summary: Partial cancellation
|
||||
value:
|
||||
canceled:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
not_canceled:
|
||||
'0xfedcba0987654321fedcba0987654321fedcba09': Order not found
|
||||
'0x1234567890abcdef1234567890abcdef12345678': Order already canceled
|
||||
'400':
|
||||
description: Bad request - Invalid order IDs or payload
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
invalid_order_id:
|
||||
summary: Invalid order ID
|
||||
value:
|
||||
error: Invalid orderID
|
||||
invalid_payload:
|
||||
summary: Invalid payload
|
||||
value:
|
||||
error: Invalid order payload
|
||||
too_many_orders:
|
||||
summary: Too many orders
|
||||
value:
|
||||
error: 'Too many orders in payload, max allowed: 3000'
|
||||
'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
|
||||
'503':
|
||||
description: >-
|
||||
Service unavailable - Trading disabled (cancels still work in
|
||||
cancel-only mode)
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: >-
|
||||
Trading is currently disabled. Check polymarket.com for
|
||||
updates
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
CancelOrdersResponse:
|
||||
type: object
|
||||
required:
|
||||
- canceled
|
||||
- not_canceled
|
||||
properties:
|
||||
canceled:
|
||||
type: array
|
||||
description: Array of order IDs that were successfully canceled
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
not_canceled:
|
||||
type: object
|
||||
description: Map of order IDs that could not be canceled with error messages
|
||||
additionalProperties:
|
||||
type: string
|
||||
example:
|
||||
'0xabcdef1234567890abcdef1234567890abcdef12': Order not found or already canceled
|
||||
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
|
||||
|
||||
````
|
||||
@@ -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.
|
||||
|
||||
# Cancel orders for a market
|
||||
|
||||
> Cancels all open orders for the authenticated user in a specific market (condition) and asset.
|
||||
Works even in cancel-only mode.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml delete /cancel-market-orders
|
||||
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
|
||||
paths:
|
||||
/cancel-market-orders:
|
||||
delete:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Cancel orders for a market
|
||||
description: >
|
||||
Cancels all open orders for the authenticated user in a specific market
|
||||
(condition) and asset.
|
||||
|
||||
Works even in cancel-only mode.
|
||||
operationId: cancelMarketOrders
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/OrderMarketCancelParams'
|
||||
example:
|
||||
market: >-
|
||||
0x0000000000000000000000000000000000000000000000000000000000000001
|
||||
asset_id: 0xabc123def456...
|
||||
responses:
|
||||
'200':
|
||||
description: Cancellation results for market orders
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CancelOrdersResponse'
|
||||
examples:
|
||||
canceled:
|
||||
summary: All market orders canceled
|
||||
value:
|
||||
canceled:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
- '0xfedcba0987654321fedcba0987654321fedcba09'
|
||||
not_canceled: {}
|
||||
mixed:
|
||||
summary: Some orders canceled, some not
|
||||
value:
|
||||
canceled:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
not_canceled:
|
||||
'0xfedcba0987654321fedcba0987654321fedcba09': Order already matched
|
||||
no_orders:
|
||||
summary: No orders found for this market
|
||||
value:
|
||||
canceled: []
|
||||
not_canceled: {}
|
||||
'400':
|
||||
description: Bad request - Invalid payload
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid order payload
|
||||
'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
|
||||
'503':
|
||||
description: >-
|
||||
Service unavailable - Trading disabled (cancels still work in
|
||||
cancel-only mode)
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: >-
|
||||
Trading is currently disabled. Check polymarket.com for
|
||||
updates
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
OrderMarketCancelParams:
|
||||
type: object
|
||||
required:
|
||||
- market
|
||||
- asset_id
|
||||
properties:
|
||||
market:
|
||||
type: string
|
||||
description: Market (condition ID)
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000001'
|
||||
asset_id:
|
||||
type: string
|
||||
description: Asset ID (token ID)
|
||||
example: 0xabc123def456...
|
||||
CancelOrdersResponse:
|
||||
type: object
|
||||
required:
|
||||
- canceled
|
||||
- not_canceled
|
||||
properties:
|
||||
canceled:
|
||||
type: array
|
||||
description: Array of order IDs that were successfully canceled
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
not_canceled:
|
||||
type: object
|
||||
description: Map of order IDs that could not be canceled with error messages
|
||||
additionalProperties:
|
||||
type: string
|
||||
example:
|
||||
'0xabcdef1234567890abcdef1234567890abcdef12': Order not found or already canceled
|
||||
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
|
||||
|
||||
````
|
||||
@@ -0,0 +1,192 @@
|
||||
> ## 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.
|
||||
|
||||
# Cancel single order
|
||||
|
||||
> Cancels a single order by its ID. Works even in cancel-only mode.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml delete /order
|
||||
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
|
||||
paths:
|
||||
/order:
|
||||
delete:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Cancel single order
|
||||
description: |
|
||||
Cancels a single order by its ID. Works even in cancel-only mode.
|
||||
operationId: cancelOrder
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CancelOrderPayload'
|
||||
example:
|
||||
orderID: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
responses:
|
||||
'200':
|
||||
description: Order cancellation result
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CancelOrdersResponse'
|
||||
examples:
|
||||
canceled:
|
||||
summary: Order successfully canceled
|
||||
value:
|
||||
canceled:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
not_canceled: {}
|
||||
not_canceled:
|
||||
summary: Order could not be canceled
|
||||
value:
|
||||
canceled: []
|
||||
not_canceled:
|
||||
'0xabcdef1234567890abcdef1234567890abcdef12': Order not found or already canceled
|
||||
'400':
|
||||
description: Bad request - Invalid order ID or payload
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
invalid_order_id:
|
||||
summary: Invalid order ID
|
||||
value:
|
||||
error: Invalid orderID
|
||||
invalid_payload:
|
||||
summary: Invalid payload
|
||||
value:
|
||||
error: Invalid order payload
|
||||
'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
|
||||
'503':
|
||||
description: >-
|
||||
Service unavailable - Trading disabled (cancels still work in
|
||||
cancel-only mode)
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: >-
|
||||
Trading is currently disabled. Check polymarket.com for
|
||||
updates
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
CancelOrderPayload:
|
||||
type: object
|
||||
required:
|
||||
- orderID
|
||||
properties:
|
||||
orderID:
|
||||
type: string
|
||||
description: Order ID (order hash) to cancel
|
||||
example: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
CancelOrdersResponse:
|
||||
type: object
|
||||
required:
|
||||
- canceled
|
||||
- not_canceled
|
||||
properties:
|
||||
canceled:
|
||||
type: array
|
||||
description: Array of order IDs that were successfully canceled
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
- '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
not_canceled:
|
||||
type: object
|
||||
description: Map of order IDs that could not be canceled with error messages
|
||||
additionalProperties:
|
||||
type: string
|
||||
example:
|
||||
'0xabcdef1234567890abcdef1234567890abcdef12': Order not found or already canceled
|
||||
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
|
||||
|
||||
````
|
||||
@@ -0,0 +1,364 @@
|
||||
> ## 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 builder trades
|
||||
|
||||
> Retrieves originated trades for a given builder.
|
||||
Builders can only see their own originated trades.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml get /builder/trades
|
||||
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
|
||||
paths:
|
||||
/builder/trades:
|
||||
get:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Get builder trades
|
||||
description: |
|
||||
Retrieves originated trades for a given builder.
|
||||
Builders can only see their own originated trades.
|
||||
operationId: getBuilderTrades
|
||||
parameters:
|
||||
- name: id
|
||||
in: query
|
||||
description: Trade ID to filter by specific trade
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: trade-123
|
||||
- name: builder
|
||||
in: query
|
||||
description: >-
|
||||
Builder identifier (automatically set from authenticated builder, or
|
||||
can be specified with admin token)
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: 0199bfa0-f4c1-7a98-9c2b-b29cc6d39e10
|
||||
- name: market
|
||||
in: query
|
||||
description: Market (condition ID) to filter trades
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000001'
|
||||
- name: asset_id
|
||||
in: query
|
||||
description: Asset ID (token ID) to filter trades
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: >-
|
||||
15871154585880608648532107628464183779895785213830018178010423617714102767076
|
||||
- name: before
|
||||
in: query
|
||||
description: Filter trades before this Unix timestamp
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
pattern: ^\d+$
|
||||
example: '1700000000'
|
||||
- name: after
|
||||
in: query
|
||||
description: Filter trades after this Unix timestamp
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
pattern: ^\d+$
|
||||
example: '1600000000'
|
||||
- name: next_cursor
|
||||
in: query
|
||||
description: Cursor for pagination (base64 encoded offset)
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: MA==
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved builder trades
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BuilderTradesResponse'
|
||||
examples:
|
||||
example:
|
||||
summary: Builder trades response
|
||||
value:
|
||||
limit: 300
|
||||
next_cursor: MzAw
|
||||
count: 2
|
||||
data:
|
||||
- id: trade-123
|
||||
tradeType: TAKER
|
||||
takerOrderHash: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
builder: 0199bfa0-f4c1-7a98-9c2b-b29cc6d39e10
|
||||
market: >-
|
||||
0x0000000000000000000000000000000000000000000000000000000000000001
|
||||
assetId: >-
|
||||
15871154585880608648532107628464183779895785213830018178010423617714102767076
|
||||
side: BUY
|
||||
size: '100000000'
|
||||
sizeUsdc: '50000000'
|
||||
price: '0.5'
|
||||
status: TRADE_STATUS_CONFIRMED
|
||||
outcome: 'YES'
|
||||
outcomeIndex: 0
|
||||
owner: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
maker: '0x1234567890123456789012345678901234567890'
|
||||
transactionHash: >-
|
||||
0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
|
||||
matchTime: '1700000000'
|
||||
bucketIndex: 0
|
||||
fee: '300000'
|
||||
feeUsdc: '150000'
|
||||
createdAt: '2024-01-01T00:00:00Z'
|
||||
updatedAt: '2024-01-01T00:00:00Z'
|
||||
'400':
|
||||
description: Bad request - Invalid parameters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: invalid builder trade params
|
||||
'401':
|
||||
description: Unauthorized - Invalid builder 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: could not fetch builder trades
|
||||
security:
|
||||
- polyBuilderApiKey: []
|
||||
polyBuilderPassphrase: []
|
||||
polyBuilderSignature: []
|
||||
polyBuilderTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
BuilderTradesResponse:
|
||||
type: object
|
||||
description: Paginated builder trades response
|
||||
required:
|
||||
- limit
|
||||
- next_cursor
|
||||
- count
|
||||
- data
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
description: Maximum number of items per page
|
||||
example: 300
|
||||
next_cursor:
|
||||
type: string
|
||||
description: >-
|
||||
Cursor for next page (base64 encoded offset). "LTE=" indicates no
|
||||
more pages
|
||||
example: MzAw
|
||||
count:
|
||||
type: integer
|
||||
description: Number of items in current response
|
||||
example: 2
|
||||
data:
|
||||
type: array
|
||||
description: Array of builder trades
|
||||
items:
|
||||
$ref: '#/components/schemas/BuilderTrade'
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
BuilderTrade:
|
||||
type: object
|
||||
description: Builder trade information
|
||||
required:
|
||||
- id
|
||||
- tradeType
|
||||
- takerOrderHash
|
||||
- builder
|
||||
- market
|
||||
- assetId
|
||||
- side
|
||||
- size
|
||||
- sizeUsdc
|
||||
- price
|
||||
- status
|
||||
- outcome
|
||||
- outcomeIndex
|
||||
- owner
|
||||
- maker
|
||||
- transactionHash
|
||||
- matchTime
|
||||
- bucketIndex
|
||||
- fee
|
||||
- feeUsdc
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Trade ID
|
||||
example: trade-123
|
||||
tradeType:
|
||||
type: string
|
||||
description: Trade type
|
||||
example: TAKER
|
||||
takerOrderHash:
|
||||
type: string
|
||||
description: Taker order hash
|
||||
example: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
builder:
|
||||
type: string
|
||||
description: Builder identifier
|
||||
example: 0199bfa0-f4c1-7a98-9c2b-b29cc6d39e10
|
||||
market:
|
||||
type: string
|
||||
description: Market (condition ID)
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000001'
|
||||
assetId:
|
||||
type: string
|
||||
description: Asset ID (token ID)
|
||||
example: >-
|
||||
15871154585880608648532107628464183779895785213830018178010423617714102767076
|
||||
side:
|
||||
type: string
|
||||
description: Trade side
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
example: BUY
|
||||
size:
|
||||
type: string
|
||||
description: Trade size
|
||||
example: '100000000'
|
||||
sizeUsdc:
|
||||
type: string
|
||||
description: Trade size in USDC
|
||||
example: '50000000'
|
||||
price:
|
||||
type: string
|
||||
description: Trade price
|
||||
example: '0.5'
|
||||
status:
|
||||
type: string
|
||||
description: Trade status
|
||||
example: TRADE_STATUS_CONFIRMED
|
||||
outcome:
|
||||
type: string
|
||||
description: Market outcome
|
||||
example: 'YES'
|
||||
outcomeIndex:
|
||||
type: integer
|
||||
description: Outcome index
|
||||
example: 0
|
||||
owner:
|
||||
type: string
|
||||
description: Owner UUID
|
||||
example: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
maker:
|
||||
type: string
|
||||
description: Maker address
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
transactionHash:
|
||||
type: string
|
||||
description: Transaction hash
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
|
||||
matchTime:
|
||||
type: string
|
||||
description: Match time (Unix timestamp)
|
||||
example: '1700000000'
|
||||
bucketIndex:
|
||||
type: integer
|
||||
description: Bucket index
|
||||
example: 0
|
||||
fee:
|
||||
type: string
|
||||
description: Fee amount
|
||||
example: '300000'
|
||||
feeUsdc:
|
||||
type: string
|
||||
description: Fee amount in USDC
|
||||
example: '150000'
|
||||
err_msg:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
description: Error message (if any)
|
||||
example: null
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Creation timestamp
|
||||
example: '2024-01-01T00:00:00Z'
|
||||
updatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Last update timestamp
|
||||
example: '2024-01-01T00:00:00Z'
|
||||
securitySchemes:
|
||||
polyBuilderApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_API_KEY
|
||||
description: Builder API key for authentication
|
||||
polyBuilderPassphrase:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_PASSPHRASE
|
||||
description: Passphrase for builder authentication
|
||||
polyBuilderSignature:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_SIGNATURE
|
||||
description: HMAC signature for builder authentication
|
||||
polyBuilderTimestamp:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_TIMESTAMP
|
||||
description: Unix timestamp for builder authentication
|
||||
|
||||
````
|
||||
@@ -0,0 +1,186 @@
|
||||
> ## 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 order scoring status
|
||||
|
||||
> Checks if a specific order is currently scoring for rewards.
|
||||
|
||||
An order is considered "scoring" if it meets all the criteria for earning maker rewards:
|
||||
- The order is live on a rewards-eligible market
|
||||
- The order meets the minimum size requirements
|
||||
- The order is within the valid spread range
|
||||
- The order has been live for the required duration
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml get /order-scoring
|
||||
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
|
||||
paths:
|
||||
/order-scoring:
|
||||
get:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Get order scoring status
|
||||
description: >
|
||||
Checks if a specific order is currently scoring for rewards.
|
||||
|
||||
|
||||
An order is considered "scoring" if it meets all the criteria for
|
||||
earning maker rewards:
|
||||
|
||||
- The order is live on a rewards-eligible market
|
||||
|
||||
- The order meets the minimum size requirements
|
||||
|
||||
- The order is within the valid spread range
|
||||
|
||||
- The order has been live for the required duration
|
||||
operationId: getOrderScoring
|
||||
parameters:
|
||||
- name: order_id
|
||||
in: query
|
||||
description: The order ID (order hash) to check scoring status for
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
example: '0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890'
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved order scoring status
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/OrderScoringResponse'
|
||||
examples:
|
||||
scoring:
|
||||
summary: Order is scoring
|
||||
value:
|
||||
scoring: true
|
||||
not_scoring:
|
||||
summary: Order is not scoring
|
||||
value:
|
||||
scoring: false
|
||||
'400':
|
||||
description: Bad request - Invalid order ID
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid order_id
|
||||
'401':
|
||||
description: Unauthorized - Invalid API key or order doesn't belong to user
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid API key
|
||||
'404':
|
||||
description: Market not found for the order
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: market not found
|
||||
'500':
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Internal server error
|
||||
'503':
|
||||
description: Service unavailable - Trading disabled
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: >-
|
||||
Trading is currently disabled. Check polymarket.com for
|
||||
updates
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
OrderScoringResponse:
|
||||
type: object
|
||||
description: Response indicating whether an order is currently scoring for rewards
|
||||
required:
|
||||
- scoring
|
||||
properties:
|
||||
scoring:
|
||||
type: boolean
|
||||
description: Whether the order is currently scoring for maker rewards
|
||||
example: true
|
||||
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
|
||||
|
||||
````
|
||||
@@ -0,0 +1,251 @@
|
||||
> ## 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 single order by ID
|
||||
|
||||
> Retrieves a specific order by its ID (order hash) for the authenticated user.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml get /order/{orderID}
|
||||
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
|
||||
paths:
|
||||
/order/{orderID}:
|
||||
get:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Get single order by ID
|
||||
description: >
|
||||
Retrieves a specific order by its ID (order hash) for the authenticated
|
||||
user.
|
||||
operationId: getOrder
|
||||
parameters:
|
||||
- name: orderID
|
||||
in: path
|
||||
description: Order ID (order hash)
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000001'
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved order
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/OpenOrder'
|
||||
example:
|
||||
id: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
status: ORDER_STATUS_LIVE
|
||||
owner: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
maker_address: '0x1234567890123456789012345678901234567890'
|
||||
market: >-
|
||||
0x0000000000000000000000000000000000000000000000000000000000000001
|
||||
asset_id: 0xabc123def456...
|
||||
side: BUY
|
||||
original_size: '100000000'
|
||||
size_matched: '0'
|
||||
price: '0.5'
|
||||
outcome: 'YES'
|
||||
expiration: '1735689600'
|
||||
order_type: GTC
|
||||
associate_trades: []
|
||||
created_at: 1700000000
|
||||
'400':
|
||||
description: Bad request - Invalid order ID
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid orderID
|
||||
'401':
|
||||
description: Unauthorized - Invalid API key or authentication failed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid API key
|
||||
'404':
|
||||
description: Order not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Order not found
|
||||
'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:
|
||||
OpenOrder:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- status
|
||||
- owner
|
||||
- maker_address
|
||||
- market
|
||||
- asset_id
|
||||
- side
|
||||
- original_size
|
||||
- size_matched
|
||||
- price
|
||||
- expiration
|
||||
- order_type
|
||||
- created_at
|
||||
- outcome
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Order ID (order hash)
|
||||
example: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
status:
|
||||
type: string
|
||||
description: Order status
|
||||
enum:
|
||||
- ORDER_STATUS_LIVE
|
||||
- ORDER_STATUS_INVALID
|
||||
- ORDER_STATUS_CANCELED_MARKET_RESOLVED
|
||||
- ORDER_STATUS_CANCELED
|
||||
- ORDER_STATUS_MATCHED
|
||||
owner:
|
||||
type: string
|
||||
description: UUID of the order owner
|
||||
example: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
maker_address:
|
||||
type: string
|
||||
description: Ethereum address of the maker
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
market:
|
||||
type: string
|
||||
description: Market (condition ID)
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000001'
|
||||
asset_id:
|
||||
type: string
|
||||
description: Asset ID (token ID)
|
||||
example: 0xabc123def456...
|
||||
side:
|
||||
type: string
|
||||
description: Order side
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
example: BUY
|
||||
original_size:
|
||||
type: string
|
||||
description: Original order size in fixed-math with 6 decimals
|
||||
example: '100000000'
|
||||
size_matched:
|
||||
type: string
|
||||
description: Size that has been matched in fixed-math with 6 decimals
|
||||
example: '0'
|
||||
price:
|
||||
type: string
|
||||
description: Order price
|
||||
example: '0.5'
|
||||
outcome:
|
||||
type: string
|
||||
description: Market outcome (YES/NO)
|
||||
example: 'YES'
|
||||
expiration:
|
||||
type: string
|
||||
description: Unix timestamp when the order expires
|
||||
example: '1735689600'
|
||||
order_type:
|
||||
type: string
|
||||
description: Order type
|
||||
enum:
|
||||
- GTC
|
||||
- FOK
|
||||
- GTD
|
||||
- FAK
|
||||
example: GTC
|
||||
associate_trades:
|
||||
type: array
|
||||
description: Array of associated trade IDs
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
- trade-123
|
||||
created_at:
|
||||
type: integer
|
||||
description: Unix timestamp when the order was created
|
||||
example: 1700000000
|
||||
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
|
||||
|
||||
````
|
||||
@@ -0,0 +1,387 @@
|
||||
> ## Documentation Index
|
||||
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
|
||||
> Use this file to discover all available pages before exploring further.
|
||||
|
||||
# Get trades
|
||||
|
||||
> Retrieves trades for the authenticated user. Returns paginated results.
|
||||
Requires readonly or level 2 API key authentication.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml get /trades
|
||||
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
|
||||
paths:
|
||||
/trades:
|
||||
get:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Get trades
|
||||
description: |
|
||||
Retrieves trades for the authenticated user. Returns paginated results.
|
||||
Requires readonly or level 2 API key authentication.
|
||||
operationId: getTrades
|
||||
parameters:
|
||||
- name: id
|
||||
in: query
|
||||
description: Trade ID to filter by specific trade
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: trade-123
|
||||
- name: maker_address
|
||||
in: query
|
||||
description: Maker address to filter trades
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
- name: market
|
||||
in: query
|
||||
description: Market (condition ID) to filter trades
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000001'
|
||||
- name: asset_id
|
||||
in: query
|
||||
description: Asset ID (token ID) to filter trades
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: >-
|
||||
15871154585880608648532107628464183779895785213830018178010423617714102767076
|
||||
- name: before
|
||||
in: query
|
||||
description: Filter trades before this Unix timestamp
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
pattern: ^\d+$
|
||||
example: '1700000000'
|
||||
- name: after
|
||||
in: query
|
||||
description: Filter trades after this Unix timestamp
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
pattern: ^\d+$
|
||||
example: '1600000000'
|
||||
- name: next_cursor
|
||||
in: query
|
||||
description: Cursor for pagination (base64 encoded offset)
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: MA==
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved trades
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/TradesResponse'
|
||||
examples:
|
||||
example:
|
||||
summary: User trades response
|
||||
value:
|
||||
limit: 100
|
||||
next_cursor: MTAw
|
||||
count: 2
|
||||
data:
|
||||
- id: trade-123
|
||||
taker_order_id: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
market: >-
|
||||
0x0000000000000000000000000000000000000000000000000000000000000001
|
||||
asset_id: >-
|
||||
15871154585880608648532107628464183779895785213830018178010423617714102767076
|
||||
side: BUY
|
||||
size: '100000000'
|
||||
fee_rate_bps: '30'
|
||||
price: '0.5'
|
||||
status: TRADE_STATUS_CONFIRMED
|
||||
match_time: '1700000000'
|
||||
last_update: '1700000000'
|
||||
outcome: 'YES'
|
||||
bucket_index: 0
|
||||
owner: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
maker_address: '0x1234567890123456789012345678901234567890'
|
||||
transaction_hash: >-
|
||||
0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
|
||||
trader_side: TAKER
|
||||
maker_orders: []
|
||||
'400':
|
||||
description: Bad request - Invalid parameters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: Invalid trade params payload
|
||||
'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:
|
||||
TradesResponse:
|
||||
type: object
|
||||
description: Paginated trades response
|
||||
required:
|
||||
- limit
|
||||
- next_cursor
|
||||
- count
|
||||
- data
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
description: Maximum number of items per page
|
||||
example: 100
|
||||
next_cursor:
|
||||
type: string
|
||||
description: >-
|
||||
Cursor for next page (base64 encoded offset). "LTE=" indicates no
|
||||
more pages
|
||||
example: MTAw
|
||||
count:
|
||||
type: integer
|
||||
description: Number of items in current response
|
||||
example: 2
|
||||
data:
|
||||
type: array
|
||||
description: Array of trades
|
||||
items:
|
||||
$ref: '#/components/schemas/Trade'
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
Trade:
|
||||
type: object
|
||||
description: Trade information
|
||||
required:
|
||||
- id
|
||||
- taker_order_id
|
||||
- market
|
||||
- asset_id
|
||||
- side
|
||||
- size
|
||||
- price
|
||||
- status
|
||||
- match_time
|
||||
- last_update
|
||||
- outcome
|
||||
- bucket_index
|
||||
- owner
|
||||
- maker_address
|
||||
- trader_side
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Trade ID
|
||||
example: trade-123
|
||||
taker_order_id:
|
||||
type: string
|
||||
description: Taker order ID (hash)
|
||||
example: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
market:
|
||||
type: string
|
||||
description: Market (condition ID)
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000001'
|
||||
asset_id:
|
||||
type: string
|
||||
description: Asset ID (token ID)
|
||||
example: >-
|
||||
15871154585880608648532107628464183779895785213830018178010423617714102767076
|
||||
side:
|
||||
type: string
|
||||
description: Trade side
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
example: BUY
|
||||
size:
|
||||
type: string
|
||||
description: Trade size
|
||||
example: '100000000'
|
||||
fee_rate_bps:
|
||||
type: string
|
||||
description: Fee rate in basis points
|
||||
example: '30'
|
||||
price:
|
||||
type: string
|
||||
description: Trade price
|
||||
example: '0.5'
|
||||
status:
|
||||
type: string
|
||||
description: Trade status
|
||||
enum:
|
||||
- TRADE_STATUS_CONFIRMED
|
||||
- TRADE_STATUS_FAILED
|
||||
- TRADE_STATUS_RETRYING
|
||||
- TRADE_STATUS_MATCHED
|
||||
- TRADE_STATUS_MINED
|
||||
example: TRADE_STATUS_CONFIRMED
|
||||
match_time:
|
||||
type: string
|
||||
description: Match time (Unix timestamp)
|
||||
example: '1700000000'
|
||||
match_time_nano:
|
||||
type: string
|
||||
description: Match time in nanoseconds
|
||||
example: '1700000000000000000'
|
||||
last_update:
|
||||
type: string
|
||||
description: Last update time (Unix timestamp)
|
||||
example: '1700000000'
|
||||
outcome:
|
||||
type: string
|
||||
description: Market outcome
|
||||
example: 'YES'
|
||||
bucket_index:
|
||||
type: integer
|
||||
description: Bucket index
|
||||
example: 0
|
||||
owner:
|
||||
type: string
|
||||
description: Owner UUID
|
||||
example: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
maker_address:
|
||||
type: string
|
||||
description: Maker address
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
transaction_hash:
|
||||
type: string
|
||||
description: Transaction hash
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
|
||||
err_msg:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
description: Error message (if any)
|
||||
example: null
|
||||
maker_orders:
|
||||
type: array
|
||||
description: Array of maker orders associated with this trade
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
order_id:
|
||||
type: string
|
||||
description: Order ID (hash)
|
||||
owner:
|
||||
type: string
|
||||
description: Owner UUID
|
||||
maker_address:
|
||||
type: string
|
||||
description: Maker address
|
||||
matched_amount:
|
||||
type: string
|
||||
description: Matched amount
|
||||
price:
|
||||
type: string
|
||||
description: Price
|
||||
fee_rate_bps:
|
||||
type: string
|
||||
description: Fee rate in basis points
|
||||
asset_id:
|
||||
type: string
|
||||
description: Asset ID
|
||||
outcome:
|
||||
type: string
|
||||
description: Outcome
|
||||
side:
|
||||
type: string
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
example: []
|
||||
trader_side:
|
||||
type: string
|
||||
description: Trader side (TAKER or MAKER)
|
||||
enum:
|
||||
- TAKER
|
||||
- MAKER
|
||||
example: TAKER
|
||||
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
|
||||
|
||||
````
|
||||
@@ -0,0 +1,315 @@
|
||||
> ## 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 orders
|
||||
|
||||
> Retrieves open orders for the authenticated user. Returns paginated results.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml get /orders
|
||||
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
|
||||
paths:
|
||||
/orders:
|
||||
get:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Get user orders
|
||||
description: >
|
||||
Retrieves open orders for the authenticated user. Returns paginated
|
||||
results.
|
||||
operationId: getOrders
|
||||
parameters:
|
||||
- name: id
|
||||
in: query
|
||||
description: Order ID (hash) to filter by specific order
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
- name: market
|
||||
in: query
|
||||
description: Market (condition ID) to filter orders
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000001'
|
||||
- name: asset_id
|
||||
in: query
|
||||
description: Asset ID (token ID) to filter orders
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: 0xabc123def456...
|
||||
- name: next_cursor
|
||||
in: query
|
||||
description: Cursor for pagination (base64 encoded offset)
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: MA==
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved orders
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/OrdersResponse'
|
||||
examples:
|
||||
example:
|
||||
summary: User orders response
|
||||
value:
|
||||
limit: 100
|
||||
next_cursor: MTAw
|
||||
count: 2
|
||||
data:
|
||||
- id: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
status: ORDER_STATUS_LIVE
|
||||
owner: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
maker_address: '0x1234567890123456789012345678901234567890'
|
||||
market: >-
|
||||
0x0000000000000000000000000000000000000000000000000000000000000001
|
||||
asset_id: 0xabc123def456...
|
||||
side: BUY
|
||||
original_size: '100000000'
|
||||
size_matched: '0'
|
||||
price: '0.5'
|
||||
outcome: 'YES'
|
||||
expiration: '1735689600'
|
||||
order_type: GTC
|
||||
associate_trades: []
|
||||
created_at: 1700000000
|
||||
- id: '0xfedcba0987654321fedcba0987654321fedcba09'
|
||||
status: ORDER_STATUS_LIVE
|
||||
owner: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
maker_address: '0x1234567890123456789012345678901234567890'
|
||||
market: >-
|
||||
0x0000000000000000000000000000000000000000000000000000000000000002
|
||||
asset_id: 0xdef456abc789...
|
||||
side: SELL
|
||||
original_size: '200000000'
|
||||
size_matched: '50000000'
|
||||
price: '0.75'
|
||||
outcome: 'NO'
|
||||
expiration: '1735689600'
|
||||
order_type: GTC
|
||||
associate_trades:
|
||||
- trade-123
|
||||
created_at: 1700000001
|
||||
'400':
|
||||
description: Bad request - Invalid parameters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
example:
|
||||
error: invalid order params payload
|
||||
'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:
|
||||
OrdersResponse:
|
||||
type: object
|
||||
required:
|
||||
- limit
|
||||
- next_cursor
|
||||
- count
|
||||
- data
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
description: Maximum number of results per page
|
||||
example: 100
|
||||
next_cursor:
|
||||
type: string
|
||||
description: >-
|
||||
Cursor for pagination (base64 encoded offset). Empty if no more
|
||||
results.
|
||||
example: MTAw
|
||||
count:
|
||||
type: integer
|
||||
description: Number of orders in this response
|
||||
example: 2
|
||||
data:
|
||||
type: array
|
||||
description: Array of open orders
|
||||
items:
|
||||
$ref: '#/components/schemas/OpenOrder'
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
OpenOrder:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- status
|
||||
- owner
|
||||
- maker_address
|
||||
- market
|
||||
- asset_id
|
||||
- side
|
||||
- original_size
|
||||
- size_matched
|
||||
- price
|
||||
- expiration
|
||||
- order_type
|
||||
- created_at
|
||||
- outcome
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Order ID (order hash)
|
||||
example: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
status:
|
||||
type: string
|
||||
description: Order status
|
||||
enum:
|
||||
- ORDER_STATUS_LIVE
|
||||
- ORDER_STATUS_INVALID
|
||||
- ORDER_STATUS_CANCELED_MARKET_RESOLVED
|
||||
- ORDER_STATUS_CANCELED
|
||||
- ORDER_STATUS_MATCHED
|
||||
owner:
|
||||
type: string
|
||||
description: UUID of the order owner
|
||||
example: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
maker_address:
|
||||
type: string
|
||||
description: Ethereum address of the maker
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
market:
|
||||
type: string
|
||||
description: Market (condition ID)
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000001'
|
||||
asset_id:
|
||||
type: string
|
||||
description: Asset ID (token ID)
|
||||
example: 0xabc123def456...
|
||||
side:
|
||||
type: string
|
||||
description: Order side
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
example: BUY
|
||||
original_size:
|
||||
type: string
|
||||
description: Original order size in fixed-math with 6 decimals
|
||||
example: '100000000'
|
||||
size_matched:
|
||||
type: string
|
||||
description: Size that has been matched in fixed-math with 6 decimals
|
||||
example: '0'
|
||||
price:
|
||||
type: string
|
||||
description: Order price
|
||||
example: '0.5'
|
||||
outcome:
|
||||
type: string
|
||||
description: Market outcome (YES/NO)
|
||||
example: 'YES'
|
||||
expiration:
|
||||
type: string
|
||||
description: Unix timestamp when the order expires
|
||||
example: '1735689600'
|
||||
order_type:
|
||||
type: string
|
||||
description: Order type
|
||||
enum:
|
||||
- GTC
|
||||
- FOK
|
||||
- GTD
|
||||
- FAK
|
||||
example: GTC
|
||||
associate_trades:
|
||||
type: array
|
||||
description: Array of associated trade IDs
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
- trade-123
|
||||
created_at:
|
||||
type: integer
|
||||
description: Unix timestamp when the order was created
|
||||
example: 1700000000
|
||||
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
|
||||
|
||||
````
|
||||
@@ -0,0 +1,376 @@
|
||||
> ## 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.
|
||||
|
||||
# Post a new order
|
||||
|
||||
> Creates a new order in the order book
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml post /order
|
||||
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
|
||||
paths:
|
||||
/order:
|
||||
post:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Post a new order
|
||||
description: |
|
||||
Creates a new order in the order book
|
||||
operationId: postOrder
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SendOrder'
|
||||
examples:
|
||||
example:
|
||||
summary: Send order example
|
||||
value:
|
||||
order:
|
||||
maker: '0x1234567890123456789012345678901234567890'
|
||||
signer: '0x1234567890123456789012345678901234567890'
|
||||
taker: '0x0000000000000000000000000000000000000000'
|
||||
tokenId: 0xabc123def456...
|
||||
makerAmount: '100000000'
|
||||
takerAmount: '200000000'
|
||||
side: BUY
|
||||
expiration: '1735689600'
|
||||
nonce: '0'
|
||||
feeRateBps: '30'
|
||||
signature: 0x1234abcd...
|
||||
salt: 1234567890
|
||||
signatureType: 0
|
||||
owner: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
orderType: GTC
|
||||
deferExec: false
|
||||
responses:
|
||||
'200':
|
||||
description: Order successfully processed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SendOrderResponse'
|
||||
examples:
|
||||
live_order:
|
||||
summary: Order placed on book
|
||||
value:
|
||||
success: true
|
||||
orderID: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
status: live
|
||||
makingAmount: '100000000'
|
||||
takingAmount: '200000000'
|
||||
errorMsg: ''
|
||||
matched_order:
|
||||
summary: Order immediately matched
|
||||
value:
|
||||
success: true
|
||||
orderID: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
status: matched
|
||||
makingAmount: '100000000'
|
||||
takingAmount: '200000000'
|
||||
transactionsHashes:
|
||||
- '0x1234567890abcdef1234567890abcdef12345678'
|
||||
tradeIDs:
|
||||
- trade-123
|
||||
errorMsg: ''
|
||||
delayed_order:
|
||||
summary: Order delayed
|
||||
value:
|
||||
success: true
|
||||
orderID: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
status: delayed
|
||||
makingAmount: '100000000'
|
||||
takingAmount: '200000000'
|
||||
errorMsg: ''
|
||||
'400':
|
||||
description: Bad request - Invalid order payload or validation error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
invalid_payload:
|
||||
summary: Invalid order payload
|
||||
value:
|
||||
error: Invalid order payload
|
||||
owner_mismatch:
|
||||
summary: Owner mismatch
|
||||
value:
|
||||
error: the order owner has to be the owner of the API KEY
|
||||
signer_mismatch:
|
||||
summary: Signer mismatch
|
||||
value:
|
||||
error: >-
|
||||
the order signer address has to be the address of the API
|
||||
KEY
|
||||
banned_address:
|
||||
summary: Banned address
|
||||
value:
|
||||
error: '''0x1234...'' address banned'
|
||||
closed_only_mode:
|
||||
summary: Closed only mode violation
|
||||
value:
|
||||
error: '''0x1234...'' address in closed only mode'
|
||||
invalid_order:
|
||||
summary: Invalid order details
|
||||
value:
|
||||
error: >-
|
||||
order 0xabc... is invalid. Price (100) breaks minimum tick
|
||||
size rule: 0.1
|
||||
'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: could not insert order
|
||||
'503':
|
||||
description: Service unavailable - Trading disabled or cancel-only mode
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
trading_disabled:
|
||||
summary: Trading disabled
|
||||
value:
|
||||
error: >-
|
||||
Trading is currently disabled. Check polymarket.com for
|
||||
updates
|
||||
cancel_only:
|
||||
summary: Cancel-only mode
|
||||
value:
|
||||
error: >-
|
||||
Trading is currently cancel-only. New orders are not
|
||||
accepted, but cancels are allowed.
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
SendOrder:
|
||||
type: object
|
||||
required:
|
||||
- order
|
||||
- owner
|
||||
properties:
|
||||
order:
|
||||
$ref: '#/components/schemas/Order'
|
||||
owner:
|
||||
type: string
|
||||
description: UUID of the API key owner
|
||||
example: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
orderType:
|
||||
type: string
|
||||
description: Time in force
|
||||
enum:
|
||||
- GTC
|
||||
- FOK
|
||||
- GTD
|
||||
- FAK
|
||||
default: GTC
|
||||
deferExec:
|
||||
type: boolean
|
||||
description: Whether to defer execution
|
||||
default: false
|
||||
SendOrderResponse:
|
||||
type: object
|
||||
required:
|
||||
- success
|
||||
- orderID
|
||||
- status
|
||||
properties:
|
||||
success:
|
||||
type: boolean
|
||||
description: Whether the order was successfully processed
|
||||
example: true
|
||||
orderID:
|
||||
type: string
|
||||
description: Unique identifier for the order (order hash)
|
||||
example: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
status:
|
||||
type: string
|
||||
description: Status of the order after processing
|
||||
enum:
|
||||
- live
|
||||
- matched
|
||||
- delayed
|
||||
makingAmount:
|
||||
type: string
|
||||
description: Amount the maker is providing in fixed-math with 6 decimals
|
||||
example: '100000000'
|
||||
takingAmount:
|
||||
type: string
|
||||
description: Amount the taker is providing in fixed-math with 6 decimals
|
||||
example: '200000000'
|
||||
transactionsHashes:
|
||||
type: array
|
||||
description: Array of transaction hashes (present when status is 'matched')
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
- '0x1234567890abcdef1234567890abcdef12345678'
|
||||
tradeIDs:
|
||||
type: array
|
||||
description: Array of trade IDs (present when status is 'matched')
|
||||
items:
|
||||
type: string
|
||||
errorMsg:
|
||||
type: string
|
||||
description: Error message (empty on success)
|
||||
example: ''
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
Order:
|
||||
type: object
|
||||
required:
|
||||
- maker
|
||||
- signer
|
||||
- taker
|
||||
- tokenId
|
||||
- makerAmount
|
||||
- takerAmount
|
||||
- side
|
||||
- expiration
|
||||
- nonce
|
||||
- feeRateBps
|
||||
- signature
|
||||
- salt
|
||||
- signatureType
|
||||
properties:
|
||||
maker:
|
||||
type: string
|
||||
description: >-
|
||||
Ethereum address of the maker (In the default case, this is your
|
||||
proxy address)
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
signer:
|
||||
type: string
|
||||
description: Ethereum address of the signer
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
taker:
|
||||
type: string
|
||||
description: Ethereum address of the taker (0x0 for open orders)
|
||||
example: '0x0000000000000000000000000000000000000000'
|
||||
tokenId:
|
||||
type: string
|
||||
description: Token ID (asset ID) for the order
|
||||
example: 0xabc123def456...
|
||||
makerAmount:
|
||||
type: string
|
||||
description: Amount the maker is providing in fixed-math with 6 decimals
|
||||
example: '100000000'
|
||||
takerAmount:
|
||||
type: string
|
||||
description: Amount the taker is providing in fixed-math with 6 decimals
|
||||
example: '200000000'
|
||||
side:
|
||||
type: string
|
||||
description: Order side
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
example: BUY
|
||||
expiration:
|
||||
type: string
|
||||
description: Unix timestamp when the order expires
|
||||
example: '1735689600'
|
||||
nonce:
|
||||
type: string
|
||||
description: Order nonce
|
||||
example: '0'
|
||||
feeRateBps:
|
||||
type: string
|
||||
description: Fee rate in basis points
|
||||
example: '30'
|
||||
signature:
|
||||
type: string
|
||||
description: Cryptographic signature of the order
|
||||
example: 0x1234abcd...
|
||||
salt:
|
||||
type: integer
|
||||
description: Random salt for order uniqueness
|
||||
example: 1234567890
|
||||
signatureType:
|
||||
type: integer
|
||||
description: Type of signature (0 = EOA, 1 = POLY_PROXY, 2 = POLY_GNOSIS_SAFE)
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
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
|
||||
|
||||
````
|
||||
@@ -0,0 +1,398 @@
|
||||
> ## 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.
|
||||
|
||||
# Post multiple orders
|
||||
|
||||
> Creates multiple new orders in the order book. Orders are processed in parallel.
|
||||
Maximum 15 orders per request.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml post /orders
|
||||
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
|
||||
paths:
|
||||
/orders:
|
||||
post:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Post multiple orders
|
||||
description: >
|
||||
Creates multiple new orders in the order book. Orders are processed in
|
||||
parallel.
|
||||
|
||||
Maximum 15 orders per request.
|
||||
operationId: postOrders
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/SendOrder'
|
||||
maxItems: 15
|
||||
examples:
|
||||
example:
|
||||
summary: Send multiple orders example
|
||||
value:
|
||||
- order:
|
||||
maker: '0x1234567890123456789012345678901234567890'
|
||||
signer: '0x1234567890123456789012345678901234567890'
|
||||
taker: '0x0000000000000000000000000000000000000000'
|
||||
tokenId: 0xabc123def456...
|
||||
makerAmount: '100000000'
|
||||
takerAmount: '200000000'
|
||||
side: BUY
|
||||
expiration: '1735689600'
|
||||
nonce: '0'
|
||||
feeRateBps: '30'
|
||||
signature: 0x1234abcd...
|
||||
salt: 1234567890
|
||||
signatureType: 0
|
||||
owner: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
orderType: GTC
|
||||
deferExec: false
|
||||
- order:
|
||||
maker: '0x1234567890123456789012345678901234567890'
|
||||
signer: '0x1234567890123456789012345678901234567890'
|
||||
taker: '0x0000000000000000000000000000000000000000'
|
||||
tokenId: 0xdef456abc789...
|
||||
makerAmount: '200000000'
|
||||
takerAmount: '100000000'
|
||||
side: SELL
|
||||
expiration: '1735689600'
|
||||
nonce: '0'
|
||||
feeRateBps: '30'
|
||||
signature: 0x5678efgh...
|
||||
salt: 1234567891
|
||||
signatureType: 0
|
||||
owner: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
orderType: GTC
|
||||
deferExec: false
|
||||
responses:
|
||||
'200':
|
||||
description: >-
|
||||
Orders successfully processed. Returns an array of order responses,
|
||||
one for each order in the request.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/SendOrderResponse'
|
||||
examples:
|
||||
mixed_results:
|
||||
summary: Mixed order results
|
||||
value:
|
||||
- success: true
|
||||
orderID: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
status: live
|
||||
makingAmount: '100000000'
|
||||
takingAmount: '200000000'
|
||||
errorMsg: ''
|
||||
- success: true
|
||||
orderID: '0xfedcba0987654321fedcba0987654321fedcba09'
|
||||
status: matched
|
||||
makingAmount: '200000000'
|
||||
takingAmount: '100000000'
|
||||
transactionsHashes:
|
||||
- '0x1234567890abcdef1234567890abcdef12345678'
|
||||
tradeIDs:
|
||||
- trade-123
|
||||
errorMsg: ''
|
||||
- success: false
|
||||
orderID: ''
|
||||
status: delayed
|
||||
errorMsg: 'Rate limit exceeded for tokenId: 0xdef456abc789...'
|
||||
'400':
|
||||
description: Bad request - Invalid order payload or validation error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
invalid_payload:
|
||||
summary: Invalid order payload
|
||||
value:
|
||||
error: Invalid order payload
|
||||
empty_payload:
|
||||
summary: Empty orders array
|
||||
value:
|
||||
error: Invalid order payload
|
||||
too_many_orders:
|
||||
summary: Too many orders
|
||||
value:
|
||||
error: 'Too many orders in payload: 20, max allowed: 15'
|
||||
owner_mismatch:
|
||||
summary: Owner mismatch
|
||||
value:
|
||||
error: the order owner has to be the owner of the API KEY
|
||||
signer_mismatch:
|
||||
summary: Signer mismatch
|
||||
value:
|
||||
error: >-
|
||||
the order signer address has to be the address of the API
|
||||
KEY
|
||||
banned_address:
|
||||
summary: Banned address
|
||||
value:
|
||||
error: '''0x1234...'' address banned'
|
||||
closed_only_mode:
|
||||
summary: Closed only mode violation
|
||||
value:
|
||||
error: '''0x1234...'' address in closed only mode'
|
||||
'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: could not insert order
|
||||
'503':
|
||||
description: Service unavailable - Trading disabled or cancel-only mode
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
examples:
|
||||
trading_disabled:
|
||||
summary: Trading disabled
|
||||
value:
|
||||
error: >-
|
||||
Trading is currently disabled. Check polymarket.com for
|
||||
updates
|
||||
cancel_only:
|
||||
summary: Cancel-only mode
|
||||
value:
|
||||
error: >-
|
||||
Trading is currently cancel-only. New orders are not
|
||||
accepted, but cancels are allowed.
|
||||
security:
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
SendOrder:
|
||||
type: object
|
||||
required:
|
||||
- order
|
||||
- owner
|
||||
properties:
|
||||
order:
|
||||
$ref: '#/components/schemas/Order'
|
||||
owner:
|
||||
type: string
|
||||
description: UUID of the API key owner
|
||||
example: f4f247b7-4ac7-ff29-a152-04fda0a8755a
|
||||
orderType:
|
||||
type: string
|
||||
description: Time in force
|
||||
enum:
|
||||
- GTC
|
||||
- FOK
|
||||
- GTD
|
||||
- FAK
|
||||
default: GTC
|
||||
deferExec:
|
||||
type: boolean
|
||||
description: Whether to defer execution
|
||||
default: false
|
||||
SendOrderResponse:
|
||||
type: object
|
||||
required:
|
||||
- success
|
||||
- orderID
|
||||
- status
|
||||
properties:
|
||||
success:
|
||||
type: boolean
|
||||
description: Whether the order was successfully processed
|
||||
example: true
|
||||
orderID:
|
||||
type: string
|
||||
description: Unique identifier for the order (order hash)
|
||||
example: '0xabcdef1234567890abcdef1234567890abcdef12'
|
||||
status:
|
||||
type: string
|
||||
description: Status of the order after processing
|
||||
enum:
|
||||
- live
|
||||
- matched
|
||||
- delayed
|
||||
makingAmount:
|
||||
type: string
|
||||
description: Amount the maker is providing in fixed-math with 6 decimals
|
||||
example: '100000000'
|
||||
takingAmount:
|
||||
type: string
|
||||
description: Amount the taker is providing in fixed-math with 6 decimals
|
||||
example: '200000000'
|
||||
transactionsHashes:
|
||||
type: array
|
||||
description: Array of transaction hashes (present when status is 'matched')
|
||||
items:
|
||||
type: string
|
||||
example:
|
||||
- '0x1234567890abcdef1234567890abcdef12345678'
|
||||
tradeIDs:
|
||||
type: array
|
||||
description: Array of trade IDs (present when status is 'matched')
|
||||
items:
|
||||
type: string
|
||||
errorMsg:
|
||||
type: string
|
||||
description: Error message (empty on success)
|
||||
example: ''
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error message
|
||||
Order:
|
||||
type: object
|
||||
required:
|
||||
- maker
|
||||
- signer
|
||||
- taker
|
||||
- tokenId
|
||||
- makerAmount
|
||||
- takerAmount
|
||||
- side
|
||||
- expiration
|
||||
- nonce
|
||||
- feeRateBps
|
||||
- signature
|
||||
- salt
|
||||
- signatureType
|
||||
properties:
|
||||
maker:
|
||||
type: string
|
||||
description: >-
|
||||
Ethereum address of the maker (In the default case, this is your
|
||||
proxy address)
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
signer:
|
||||
type: string
|
||||
description: Ethereum address of the signer
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
taker:
|
||||
type: string
|
||||
description: Ethereum address of the taker (0x0 for open orders)
|
||||
example: '0x0000000000000000000000000000000000000000'
|
||||
tokenId:
|
||||
type: string
|
||||
description: Token ID (asset ID) for the order
|
||||
example: 0xabc123def456...
|
||||
makerAmount:
|
||||
type: string
|
||||
description: Amount the maker is providing in fixed-math with 6 decimals
|
||||
example: '100000000'
|
||||
takerAmount:
|
||||
type: string
|
||||
description: Amount the taker is providing in fixed-math with 6 decimals
|
||||
example: '200000000'
|
||||
side:
|
||||
type: string
|
||||
description: Order side
|
||||
enum:
|
||||
- BUY
|
||||
- SELL
|
||||
example: BUY
|
||||
expiration:
|
||||
type: string
|
||||
description: Unix timestamp when the order expires
|
||||
example: '1735689600'
|
||||
nonce:
|
||||
type: string
|
||||
description: Order nonce
|
||||
example: '0'
|
||||
feeRateBps:
|
||||
type: string
|
||||
description: Fee rate in basis points
|
||||
example: '30'
|
||||
signature:
|
||||
type: string
|
||||
description: Cryptographic signature of the order
|
||||
example: 0x1234abcd...
|
||||
salt:
|
||||
type: integer
|
||||
description: Random salt for order uniqueness
|
||||
example: 1234567890
|
||||
signatureType:
|
||||
type: integer
|
||||
description: Type of signature (0 = EOA, 1 = POLY_PROXY, 2 = POLY_GNOSIS_SAFE)
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
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
|
||||
|
||||
````
|
||||
@@ -0,0 +1,138 @@
|
||||
> ## 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.
|
||||
|
||||
# Send heartbeat
|
||||
|
||||
> Sends a heartbeat signal to maintain active session status.
|
||||
If heartbeats are not sent regularly, all open orders for the user will be automatically canceled.
|
||||
This is useful for automated trading systems that need to ensure orders are canceled
|
||||
if the system becomes unresponsive.
|
||||
|
||||
|
||||
|
||||
|
||||
## OpenAPI
|
||||
|
||||
````yaml api-spec/clob-openapi.yaml post /heartbeats
|
||||
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
|
||||
paths:
|
||||
/heartbeats:
|
||||
post:
|
||||
tags:
|
||||
- Trade
|
||||
summary: Send heartbeat
|
||||
description: >
|
||||
Sends a heartbeat signal to maintain active session status.
|
||||
|
||||
If heartbeats are not sent regularly, all open orders for the user will
|
||||
be automatically canceled.
|
||||
|
||||
This is useful for automated trading systems that need to ensure orders
|
||||
are canceled
|
||||
|
||||
if the system becomes unresponsive.
|
||||
operationId: sendHeartbeat
|
||||
responses:
|
||||
'200':
|
||||
description: Heartbeat acknowledged
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/HeartbeatResponse'
|
||||
example:
|
||||
status: ok
|
||||
'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:
|
||||
HeartbeatResponse:
|
||||
type: object
|
||||
description: Response for heartbeat request
|
||||
required:
|
||||
- status
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
description: Status of the heartbeat acknowledgment
|
||||
example: ok
|
||||
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
|
||||
|
||||
````
|
||||
Reference in New Issue
Block a user