全面优化实盘对接没有验证

This commit is contained in:
2026-07-14 07:29:03 +08:00
parent a1963e58ed
commit b3f770c55f
391 changed files with 114674 additions and 528 deletions
@@ -0,0 +1,144 @@
> ## 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 batch prices history
> Retrieve historical price data for multiple markets in a single request.
## OpenAPI
````yaml /api-spec/clob-openapi.yaml post /batch-prices-history
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:
/batch-prices-history:
post:
tags:
- Markets
summary: Get batch prices history
description: Retrieve historical price data for multiple markets in a single request.
operationId: getBatchPricesHistory
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BatchPricesHistoryRequest'
responses:
'200':
description: Successful response with price history for each market
content:
application/json:
schema:
$ref: '#/components/schemas/BatchPricesHistoryResponse'
'400':
description: Bad Request - Missing or invalid parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security: []
components:
schemas:
BatchPricesHistoryRequest:
type: object
required:
- markets
properties:
markets:
type: array
items:
type: string
description: List of market asset ids to query. Maximum 20.
maxItems: 20
start_ts:
type: number
format: double
description: Filter by items after this unix timestamp (seconds).
end_ts:
type: number
format: double
description: Filter by items before this unix timestamp (seconds).
interval:
type: string
enum:
- max
- all
- 1m
- 1w
- 1d
- 6h
- 1h
description: Time interval for data aggregation.
fidelity:
type: integer
description: Accuracy of the data expressed in minutes. Default is 1 minute.
BatchPricesHistoryResponse:
type: object
properties:
history:
type: object
additionalProperties:
type: array
items:
$ref: '#/components/schemas/MarketPrice'
description: Map of market asset id to array of price data points.
ErrorResponse:
type: object
required:
- error
properties:
error:
type: string
description: Error message
code:
type: string
description: Machine-readable error code, when provided
retry_after_seconds:
type: integer
description: Number of seconds to wait before retrying, when provided
MarketPrice:
type: object
properties:
t:
type: integer
format: uint32
p:
type: number
format: float
````
@@ -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.
# Get CLOB market info
> Returns all CLOB-level parameters for a market in a single call —
tokens, tick size, base fees, rewards, RFQ status, and fee details.
## OpenAPI
````yaml /api-spec/clob-openapi.yaml get /clob-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:
/clob-markets/{condition_id}:
get:
tags:
- Markets
summary: Get CLOB market info
description: |
Returns all CLOB-level parameters for a market in a single call —
tokens, tick size, base fees, rewards, RFQ status, and fee details.
operationId: getClobMarketInfo
parameters:
- name: condition_id
in: path
required: true
description: The condition ID of the market
schema:
type: string
example: '0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af'
responses:
'200':
description: Successfully retrieved CLOB market info
content:
application/json:
schema:
$ref: '#/components/schemas/ClobMarketDetails'
'400':
description: Bad request - Invalid condition ID
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
ClobMarketDetails:
type: object
description: >-
CLOB-level parameters for a market — tokens, tick size, base fees,
rewards, RFQ status, and fee details.
properties:
gst:
type: string
format: date-time
nullable: true
description: >-
Game start time (used for sports markets), ISO 8601 timestamp or
null
r:
$ref: '#/components/schemas/ClobRewards'
t:
type: array
description: Tokens for this market
items:
$ref: '#/components/schemas/ClobToken'
mos:
type: number
format: float
description: Minimum order size
example: 5
mts:
type: number
format: float
description: Minimum tick size (price increment)
example: 0.01
mbf:
type: integer
format: int64
description: Maker base fee in basis points
example: 0
tbf:
type: integer
format: int64
description: Taker base fee in basis points
example: 0
rfqe:
type: boolean
description: Whether RFQ (Request for Quote) is enabled for this market
itode:
type: boolean
description: >-
Whether taker order delay is enabled for this market. When true,
marketable orders are held for the 250 ms taker-delay window before
synchronous processing. This field is omitted when false.
ibce:
type: boolean
description: Whether Blockaid check is enabled
fd:
$ref: '#/components/schemas/FeeDetails'
oas:
type: integer
description: Minimum order age in seconds
ErrorResponse:
type: object
required:
- error
properties:
error:
type: string
description: Error message
code:
type: string
description: Machine-readable error code, when provided
retry_after_seconds:
type: integer
description: Number of seconds to wait before retrying, when provided
ClobRewards:
type: object
description: Rewards configuration for a market.
additionalProperties: true
ClobToken:
type: object
description: A token in a CLOB market with its ID and outcome label.
properties:
t:
type: string
description: The token ID
example: >-
71321045679252212594626385532706912750332728571942532289631379312455583992563
o:
type: string
description: Outcome label for the token (e.g. "Yes", "No")
example: 'Yes'
FeeDetails:
type: object
description: Fee curve parameters for a market.
properties:
r:
type: number
format: float
nullable: true
description: Fee rate
example: 0.02
e:
type: number
format: float
nullable: true
description: Fee curve exponent
example: 2
to:
type: boolean
nullable: true
description: Whether fees apply to takers only
example: true
````
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -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 market by token
> Returns the parent market for a given token ID. Useful when you have
a token ID and need to resolve its parent market without knowing the
condition ID in advance.
## OpenAPI
````yaml /api-spec/clob-openapi.yaml get /markets-by-token/{token_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:
/markets-by-token/{token_id}:
get:
tags:
- Markets
summary: Get market by token
description: |
Returns the parent market for a given token ID. Useful when you have
a token ID and need to resolve its parent market without knowing the
condition ID in advance.
operationId: getMarketByToken
parameters:
- name: token_id
in: path
required: true
description: The token ID to look up the parent market for
schema:
type: string
responses:
'200':
description: Successfully retrieved market
content:
application/json:
schema:
$ref: '#/components/schemas/MarketByTokenResponse'
'400':
description: Invalid market - empty token_id
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Market not found for token
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
MarketByTokenResponse:
type: object
description: >-
Response for GET /markets-by-token/{token_id} — condition ID and both
token IDs in the market.
required:
- condition_id
- primary_token_id
- secondary_token_id
properties:
condition_id:
type: string
description: The condition ID of the market containing the given token
example: '0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af'
primary_token_id:
type: string
description: The primary (Yes) token ID
example: >-
71321045679252212594626385532706912750332728571942532289631379312455583992563
secondary_token_id:
type: string
description: The secondary (No) token ID
example: >-
52114319501245915516055106046884209969926127482827954674443846427813813222426
ErrorResponse:
type: object
required:
- error
properties:
error:
type: string
description: Error message
code:
type: string
description: Machine-readable error code, when provided
retry_after_seconds:
type: integer
description: Number of seconds to wait before retrying, when provided
````
@@ -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.
# Get market tags by id
## OpenAPI
````yaml /api-spec/gamma-openapi.yaml get /markets/{id}/tags
openapi: 3.0.3
info:
title: Markets API
version: 1.0.0
description: REST API specification for public endpoints used by the Markets service.
servers:
- url: https://gamma-api.polymarket.com
description: Polymarket Gamma API Production Server
security: []
tags:
- name: Gamma Status
description: Gamma API status and health check
- name: Sports
description: Sports-related endpoints including teams and game data
- name: Tags
description: Tag management and related tag operations
- name: Events
description: Event management and event-related operations
- name: Markets
description: Market data and market-related operations
- name: Comments
description: Comment system and user interactions
- name: Series
description: Series management and related operations
- name: Profiles
description: User profile management
- name: Search
description: Search functionality across different entity types
paths:
/markets/{id}/tags:
get:
tags:
- Markets
- Tags
summary: Get market tags by id
operationId: getMarketTags
parameters:
- $ref: '#/components/parameters/pathId'
responses:
'200':
description: Tags attached to the market
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Tag'
'404':
description: Not found
components:
parameters:
pathId:
name: id
in: path
required: true
schema:
type: integer
schemas:
Tag:
type: object
properties:
id:
type: string
label:
type: string
nullable: true
slug:
type: string
nullable: true
forceShow:
type: boolean
nullable: true
publishedAt:
type: string
nullable: true
createdBy:
type: integer
nullable: true
updatedBy:
type: integer
nullable: true
createdAt:
type: string
format: date-time
nullable: true
updatedAt:
type: string
format: date-time
nullable: true
forceHide:
type: boolean
nullable: true
isCarousel:
type: boolean
nullable: true
````
@@ -0,0 +1,143 @@
> ## 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 prices history
> Retrieve historical price data for a market.
## OpenAPI
````yaml /api-spec/clob-openapi.yaml get /prices-history
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:
/prices-history:
get:
tags:
- Markets
summary: Get prices history
description: Retrieve historical price data for a market.
operationId: getPricesHistory
parameters:
- name: market
in: query
required: true
description: The market (asset id) to query.
schema:
type: string
- name: startTs
in: query
required: false
description: Filter by items after this unix timestamp.
schema:
type: number
format: double
- name: endTs
in: query
required: false
description: Filter by items before this unix timestamp.
schema:
type: number
format: double
- name: interval
in: query
required: false
description: Time interval for data aggregation.
schema:
type: string
enum:
- max
- all
- 1m
- 1w
- 1d
- 6h
- 1h
- name: fidelity
in: query
required: false
description: Accuracy of the data expressed in minutes. Default is 1 minute.
schema:
type: integer
responses:
'200':
description: Successful response with price history
content:
application/json:
schema:
$ref: '#/components/schemas/PricesHistoryResponse'
'400':
description: Bad Request - Missing or invalid query parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security: []
components:
schemas:
PricesHistoryResponse:
type: object
properties:
history:
type: array
items:
$ref: '#/components/schemas/MarketPrice'
ErrorResponse:
type: object
required:
- error
properties:
error:
type: string
description: Error message
code:
type: string
description: Machine-readable error code, when provided
retry_after_seconds:
type: integer
description: Number of seconds to wait before retrying, when provided
MarketPrice:
type: object
properties:
t:
type: integer
format: uint32
p:
type: number
format: float
````
@@ -0,0 +1,183 @@
> ## 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 sampling markets
## OpenAPI
````yaml /api-spec/clob-openapi.yaml get /sampling-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:
/sampling-markets:
get:
tags:
- Markets
summary: Get sampling markets
operationId: getSamplingMarkets
parameters:
- name: next_cursor
in: query
required: false
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedMarkets'
'400':
description: Invalid request
'500':
description: Internal server error
security: []
components:
schemas:
PaginatedMarkets:
type: object
properties:
limit:
type: integer
next_cursor:
type: string
count:
type: integer
data:
type: array
items:
$ref: '#/components/schemas/Market'
Market:
type: object
properties:
enable_order_book:
type: boolean
active:
type: boolean
closed:
type: boolean
archived:
type: boolean
accepting_orders:
type: boolean
accepting_order_timestamp:
type: string
format: date-time
minimum_order_size:
type: number
format: double
minimum_tick_size:
type: number
format: double
condition_id:
type: string
question_id:
type: string
question:
type: string
description:
type: string
market_slug:
type: string
end_date_iso:
type: string
format: date-time
game_start_time:
type: string
format: date-time
seconds_delay:
type: integer
fpmm:
type: string
maker_base_fee:
type: integer
format: int64
taker_base_fee:
type: integer
format: int64
notifications_enabled:
type: boolean
neg_risk:
type: boolean
neg_risk_market_id:
type: string
neg_risk_request_id:
type: string
icon:
type: string
image:
type: string
rewards:
$ref: '#/components/schemas/Rewards'
is_50_50_outcome:
type: boolean
tokens:
type: array
items:
$ref: '#/components/schemas/Token'
tags:
type: array
items:
type: string
Rewards:
type: object
properties:
rates:
type: array
items:
type: object
properties:
asset_address:
type: string
rewards_daily_rate:
type: number
format: double
min_size:
type: number
format: double
max_spread:
type: number
format: double
Token:
type: object
properties:
token_id:
type: string
outcome:
type: string
price:
type: number
format: double
winner:
type: boolean
````
@@ -0,0 +1,130 @@
> ## 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 sampling simplified markets
## OpenAPI
````yaml /api-spec/clob-openapi.yaml get /sampling-simplified-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:
/sampling-simplified-markets:
get:
tags:
- Markets
summary: Get sampling simplified markets
operationId: getSamplingSimplifiedMarkets
parameters:
- name: next_cursor
in: query
required: false
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedSimplifiedMarkets'
'400':
description: Invalid request
'500':
description: Internal server error
security: []
components:
schemas:
PaginatedSimplifiedMarkets:
type: object
properties:
limit:
type: integer
next_cursor:
type: string
count:
type: integer
data:
type: array
items:
$ref: '#/components/schemas/SimplifiedMarket'
SimplifiedMarket:
type: object
properties:
condition_id:
type: string
rewards:
$ref: '#/components/schemas/Rewards'
tokens:
type: array
items:
$ref: '#/components/schemas/Token'
active:
type: boolean
closed:
type: boolean
archived:
type: boolean
accepting_orders:
type: boolean
Rewards:
type: object
properties:
rates:
type: array
items:
type: object
properties:
asset_address:
type: string
rewards_daily_rate:
type: number
format: double
min_size:
type: number
format: double
max_spread:
type: number
format: double
Token:
type: object
properties:
token_id:
type: string
outcome:
type: string
price:
type: number
format: double
winner:
type: boolean
````
@@ -0,0 +1,130 @@
> ## 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 simplified markets
## OpenAPI
````yaml /api-spec/clob-openapi.yaml get /simplified-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:
/simplified-markets:
get:
tags:
- Markets
summary: Get simplified markets
operationId: getSimplifiedMarkets
parameters:
- name: next_cursor
in: query
required: false
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedSimplifiedMarkets'
'400':
description: Invalid request
'500':
description: Internal server error
security: []
components:
schemas:
PaginatedSimplifiedMarkets:
type: object
properties:
limit:
type: integer
next_cursor:
type: string
count:
type: integer
data:
type: array
items:
$ref: '#/components/schemas/SimplifiedMarket'
SimplifiedMarket:
type: object
properties:
condition_id:
type: string
rewards:
$ref: '#/components/schemas/Rewards'
tokens:
type: array
items:
$ref: '#/components/schemas/Token'
active:
type: boolean
closed:
type: boolean
archived:
type: boolean
accepting_orders:
type: boolean
Rewards:
type: object
properties:
rates:
type: array
items:
type: object
properties:
asset_address:
type: string
rewards_daily_rate:
type: number
format: double
min_size:
type: number
format: double
max_spread:
type: number
format: double
Token:
type: object
properties:
token_id:
type: string
outcome:
type: string
price:
type: number
format: double
winner:
type: boolean
````
File diff suppressed because it is too large Load Diff