所有 CLOB API 错误都返回一个包含 error 字段的 JSON 对象:
全局错误
以下错误可能出现在任何需要身份验证的端点上。
Unauthorized/Invalid api key — API key
缺失、过期或无效。确保你发送了所有必需的身份验证
header。
Invalid L1 Request headers — L1 身份验证 header(HMAC
签名)格式错误或签名不匹配。参见身份验证。
Trading is currently disabled. Check polymarket.com for updates —
交易所暂时停止运行。不接受任何订单(包括取消)。
Too Many Requests —
你已超过速率限制。请使用指数退避策略重试。
订单簿
订单簿端点的错误。
GET book
Invalid token id — token_id 查询参数缺失或不是有效的结果 ID。
No orderbook exists for the requested token id
POST books
Invalid payload — 请求体格式错误或缺少必填字段。
Payload exceeds the limit — 单次请求中的结果 ID 数量过多,请减少批量大小。
价格查询
价格、中间价和价差端点的错误。
GET price
Invalid token id — token_id 参数缺失或无效。
Invalid side — side 参数必须为 BUY 或 SELL。
No orderbook exists for the requested token id
POST prices
Invalid payload — 请求体格式错误或缺少必填字段。
Invalid side — side 字段必须为 BUY 或 SELL。
Payload exceeds the limit — 单次请求中的结果 ID 数量过多。
GET midpoint
Invalid token id — token_id 参数缺失或无效。
No orderbook exists for the requested token id
POST midpoints
Invalid payload — 请求体格式错误或缺少必填字段。
Payload exceeds the limit — 单次请求中的结果 ID 数量过多。
GET spread
Invalid token id — token_id 参数缺失或无效。
No orderbook exists for the requested token id
POST spreads
Invalid payload — 请求体格式错误或缺少必填字段。
Payload exceeds the limit — 单次请求中的结果 ID 数量过多。
下单
下单端点的错误。
POST order
Invalid order payload — 请求体格式错误、缺少必填字段或包含无效值。
the order owner has to be the owner of the API KEY — 订单中的 maker
地址与你的 API key 关联的地址不匹配。
the order signer address has to be the address of the API KEY
'{address}' address banned — 该地址已被禁止交易。
'{address}' address in closed only mode
Trading is currently cancel-only. New orders are not accepted, but cancels are allowed. — 交易所处于仅取消模式。你可以取消现有订单,但不能下新单。
post-only mode: only post-only orders and cancels are allowed — 交易所处于
post-only 模式。你可以取消订单,也可以提交设置了 postOnly: true 的订单;非
post-only 订单会被拒绝。响应包含 code: "post_only_mode" 和
retry_after_seconds,相同的重试延迟也会出现在 Retry-After HTTP header 中。
响应示例:
重试延迟也会通过 Retry-After HTTP header 返回。
POST orders
包含 POST /order 的端点级错误,以及:
Too many orders in payload: {N}, max allowed: {M} —
批量请求中的订单数量超过了每次请求的最大允许数量。
单个订单的错误会在 200 响应数组中返回,每个失败的订单都有独立的错误信息。
在 post-only 模式下,批量请求中的非 post-only 订单会返回单独的错误:
订单处理错误
当订单通过初始验证但在处理过程中失败时,会返回这些错误。它们出现在 POST /order 和 POST /orders 的响应体中。
invalid post-only order: order crosses book —
Post-only(maker)订单会立即成交。请调整价格使其挂在订单簿上。
order {id} is invalid. Price ({price}) breaks minimum tick size rule: {tick}
— 订单价格不符合市场的最小价格精度。使用 GET /tick-size 查看有效的价格精度。
order {id} is invalid. Size ({size}) lower than the minimum: {min} —
订单数量低于市场最小值。
order {id} is invalid. Duplicated.
order {id} crosses the book
not enough balance / allowance — pUSD
余额不足或代币授权额度不够。请确保账户持有足够的
pUSD,并按照设置交易授权授予相应的交易授权。授权错误每次只会指出一个缺失的
spender。如果错误指向 Neg Risk
Adapter(0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296),说明账户钱包缺少 CTF
负风险市场所需的 adapter 授权。
invalid expiration — 订单过期时间已过或无效。
order canceled in the CTF exchange contract
order match delayed due to market conditions
order couldn't be fully filled. FOK orders are fully filled or killed. —
Fill-or-Kill 订单无法被现有流动性完全填充,整个订单被拒绝。
no orders found to match with FAK order. FAK orders are partially filled or killed if no match is found. — Fill-and-Kill
订单未找到任何匹配订单。至少需要一个匹配。
the market is not yet ready to process new orders
order timed out — Exchange
未能在请求截止时间前处理订单。这通常发生在同一账户并发提交大量订单时。订单在进入订单簿前已被拒绝,可以安全地重新提交。
撮合引擎错误
订单执行过程中可能出现的内部撮合引擎错误。
撮合引擎正在重启。请使用指数退避策略重试。有关重启处理方式,请参阅撮合引擎重启。
there are no matching orders
FOK orders are filled or killed — Fill-or-Kill 订单无法被完全满足。
the trade contains rounding issues
the price of the taker's order has a discrepancy greater than allowed with the worst maker order
取消订单
取消订单端点的错误。
DELETE order
Invalid order payload — 请求体格式错误。
Invalid orderID — 提供的订单 ID 格式无效。
DELETE orders
Invalid order payload — 请求体格式错误。
Too many orders in payload, max allowed: {N} — 单次取消请求中的订单 ID
数量过多。
Invalid orderID — 一个或多个订单 ID 无效。
DELETE cancel-market-orders
Invalid order payload — 请求体格式错误或包含无效的筛选参数。
查询订单
查询订单端点的错误。
GET order by ID
Invalid orderID — URL 路径中的订单 ID 无效。
Internal server error — 获取订单时发生意外错误。
GET orders
invalid order params payload — 查询参数格式错误或包含无效值。
Internal server error — 获取订单时发生意外错误。
交易记录
GET trades
Invalid trade params payload — 查询参数格式错误或包含无效值。
Internal server error — 获取交易记录时发生意外错误。
GET last-trade-price
Invalid token id — token_id 参数缺失或无效。
Internal server error — 获取最近成交价时发生意外错误。
POST last-trades-prices
Invalid payload — 请求体格式错误或缺少必填字段。
Payload exceeds the limit — 单次请求中的结果 ID 数量过多。
市场信息
GET market by condition ID
Invalid market — condition ID 格式无效。
market not found — 不存在该 condition ID 对应的市场。
GET tick-size
Invalid token id — 结果 ID 无效。
market not found — 未找到该结果 ID 对应的市场。
GET neg-risk
Invalid token id — 结果 ID 无效。
market not found — 未找到该结果 ID 对应的市场。
价格历史
GET prices-history
筛选条件验证错误 —
一个或多个查询参数(market、startTs、endTs、fidelity)无效。
GET ohlc
startTs is required — 缺少 startTs 查询参数。
asset_id is required — 缺少 asset_id 查询参数。
invalid fidelity: {val} — fidelity
参数必须为以下值之一:1m、5m、15m、30m、1h、4h、1d、1w。
limit cannot exceed 1000 — 请将 limit 参数减少到 1000 或以下。
身份验证和 API Key
POST auth api-key
Invalid L1 Request headers — L1 身份验证 header 缺失或无效。
GET auth api-keys
Could not retrieve API keys — 获取 API key 时发生意外错误。
DELETE auth api-key
Could not delete API key — 删除 API key 时发生意外错误。
GET auth derive-api-key
Invalid L1 Request headers — L1 身份验证 header 缺失或无效。
Could not derive api key!
Builder API Key
POST auth builder-api-key
could not create builder api key — Builder API key 创建失败。
GET auth builder-api-key
could not get builder api keys — 获取 Builder API key 时发生意外错误。
DELETE auth builder-api-key
invalid revoke builder api key body — 请求体格式错误。
invalid revoke builder api key headers — 缺少必要的身份验证 header。
could not revoke the builder api key: {key} — 撤销 key 时发生意外错误。
Builder 交易记录
GET builder trades
invalid builder trade params — 查询参数格式错误或包含无效值。
could not fetch builder trades — 获取 Builder 交易记录时发生意外错误。
余额和授权
GET balance-allowance
Invalid asset type — asset_type 参数不是可识别的资产类型。
Invalid signature_type:signature_type 必须为
0(EOA)、1(POLY_PROXY)、2(POLY_GNOSIS_SAFE)或 3(POLY_1271)。
状态码速查
CLOB API 内部存在状态码覆盖机制:任何包含 "not found" 的错误信息会返回
404,包含 "unauthorized" 的会返回 401,包含 "context canceled"
的会返回 400,无论原始状态码是什么。