Polymarket CLOB 交易中经典的 maker address not allowed 错误及其解决方案,并提供完整的代码示例。
Polymarket CLOB 交易签名报错指南
1. 错误解析
使用 ClobClient 进行交易时,如果收到以下报错: {'error': 'maker address not allowed, please use the deposit wallet flow'}
这句话的真实含义是: 你用来下单的钱包地址,并没有被正确授权为“交易签名钱包”,或者没有完成对应的 deposit wallet(存款钱包)绑定流程。 看不懂没关系,其实就是代理钱包地址和资金钱包地址之间关系,后面有解决方案
2. Signature Type 选择
在初始化 ClobClient 时,signature_type 的选择至关重要。
❌ 错误做法 (报错)
如果使用 signature_type=2 并混淆了签名者地址与资金地址,会导致系统无法匹配权限:
client = ClobClient(
host=HOST,
chain_id=137,
key=PRIVATE_KEY,
creds=creds,
signature_type=2,
funder=address, # 错误地使用了签名者地址,Relayer API 密钥里面那个
)
✅ 正确做法
使用 signature_type=3,并确保 funder 填入的是资金地址 个人资料中关联的 **资金地址 **,而非Relayer API 密钥里面对应的签名者地址 
clob = ClobClient(
host=HOST,
chain_id=137,
key=PRIVATE_KEY,
creds=creds,
signature_type=3, #必须是3
funder=address, # 必须填写个人资料里的资金地址
)
3. 完整交易代码实现
以下是经过验证的完整交易流程代码:
from py_clob_client.client import ClobClient
from py_clob_client.order_builder.constants import BUY, OrderType
from py_clob_client.models import MarketOrderArgs, PartialCreateOrderOptions
# 1. 初始化并获取 API Credentials
temp = ClobClient(host="https://clob.polymarket.com", chain_id=137, key=private_key)
creds = temp.create_or_derive_api_key()
# 2. 正确初始化 CLOB 客户端
# 注意:signature_type 设为 3,funder 需对应正确的资金钱包地址
client = ClobClient(
host="https://clob.polymarket.com",
chain_id=137,
key=private_key,
creds=creds,
signature_type=3,
funder=funder # 此处填入正确的资金地址
)
# 3. 执行下单操作
response = client.create_and_post_market_order(
order_args=MarketOrderArgs(
token_id=tokenID,
side=BUY,
amount=1, # 根据实际需求调整数量
price=price, # 设定价格
),
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
order_type=OrderType.FOK,
)
print(response)
#交易成功返回
{'errorMsg': '', 'orderID': 'xxxxxx', 'takingAmount': '1.492536', 'makingAmount': '0.999999', 'status': 'matched', 'transactionsHashes': ['xxxxxx'], 'success': True}
关键点总结:
- Signature Type 3:这是目前推荐的针对存款钱包模式的签名类型。
- Funder 地址:务必确认该地址在 Polymarket 个人资料中的地址,而且需要与 private_key 绑定关系正确。
最后提一下IP问题,推荐使用香港ip,提交订单前确保ip没有被拉黑,可以参考 https://polymarket.com/api/geoblock
![打卡信奥刷题(3584)用C++实现信奥题 P11523 [THUPC 2025 初赛] 摊位分配-171主机测评](https://www.171host.com/wp-content/uploads/2026/09/20260922020544-6ab1e2783b78e-220x150.png)


