PMWallets
EN

订阅实体

跟踪一个交易者,按小时计费。

实时推送:按小时

每个实体每小时 $0.01(约 $7.20/月), 从账户余额扣。订阅时先扣第一个小时,之后每过一小时扣一次;余额不够就暂停推送,不会欠账。充值后不会自动恢复。需手动调用恢复接口,从当前链头(往回约 96 秒)恢复, 更早的暂停期空档不补。取消立即停止计费,已付的当前小时不退。

订阅一个实体

POST/v1/account/subscriptionsAPI key

entityId 支持两种写法:榜单给你的 handle(12 位,形如 7KQ2MF9X4B1C),或者你已经拿到的 0x 地址。榜单只显示 handle 和打码地址。 拿到完整地址就能在 Polymarket 查看该钱包。已订阅实体的详情和成交推送中会包含完整地址。channels 选 ws、webhook,或者两个都要。 订阅从当前链头往回 65 个块开始推(约 96 秒,和重组补推的范围一致,订阅那一刻碰上重组也不会丢块)。所以最先收到的可能是订阅前约 96 秒内的成交:请按 eventId 去重,并按每笔成交的时间判断时效。更早的历史请用导出。

先解锁地址。推送的每笔成交都写着钱包地址,所以要订阅一个实体,你必须有权查看它的地址(买下的、从套餐解锁的, 或者仍处于免费档的免费解锁);否则返回 402,error: "address_not_unlocked",不扣费。 订阅还会占用 1 次每日不同实体额度(见解锁地址)。

shell
# the handle the board shows, or the full 0x address if you already hold it — a masked one is a 400.
# The address must be unlocked first (POST /v1/account/reveals).
ENTITY=7KQ2MF9X4B1C

curl -X POST https://api.pmwallets.com/v1/account/subscriptions \
  -H "Authorization: Bearer $PMW_KEY" -H 'content-type: application/json' \
  -d "{\"entityId\":\"$ENTITY\",\"channels\":[\"ws\",\"webhook\"]}"

# 402 address_not_unlocked if you have not unlocked its address
# 402 if the balance will not cover the first hour; body carries price and balance
# 403 past the daily distinct-entity allowance (subscribing spends one unit, as unlocking does)
# 409 if the entity has had no fill in 7 days — resend with "acceptInactive": true
json
// POST /v1/account/subscriptions  →  201
{
  "id": "sub_9f2c1a7e",
  "userId": "usr_3b8d",
  "chain": 137,
  "entityId": "0x9d84ce0306f8551e02efef1680475fc0f1dc1344",
  "channels": ["ws", "webhook"],
  "status": "active",
  "fromBlock": 94146218,       // delivery starts AFTER this block
  "createdAt": "2026-09-21T02:14:07.611Z",
  "canceledAt": null
}

// GET /v1/account/subscriptions  →  200   (active + paused, newest first)
[ { "id": "sub_9f2c1a7e", "entityId": "0x9d84…", "status": "active", "fromBlock": 94146218, … } ]

// 402 — the balance will not cover the first hour
{ "statusCode": 402, "message": "insufficient balance for the first hour",
  "priceCentsPerHour": 1, "balanceCents": 0 }

// 409 — the entity has not traded recently; resend with acceptInactive
// (no figures about the entity: naming an address here would otherwise describe it for free)
{ "statusCode": 409, "message": "entity is dormant: no fill in the last 7 days",
  "status": "dormant", "hint": "resend with acceptInactive: true to subscribe anyway" }

状态 active / paused / canceled,余额耗尽自动转 paused。 最多 200 个生效订阅。实体 7 天没成交返回 409(不含该实体的任何数值,也不含最近成交时间), 带 acceptInactive: true 重新请求即可继续订阅。这项确认可避免为已经停止交易的 钱包按小时付费。

列出订阅

GET/v1/account/subscriptionsAPI key

active 和 paused,按创建时间倒序。已取消的不在里面,可通过实体是否在列表中查看订阅是否已取消。 字段见上面的示例。

取消订阅

DELETE/v1/account/subscriptions/:idAPI key

取消后停止计费,已预付的那小时不退。取消是终态,同一实体可以重新订, 重新订阅会生成新订阅和新的 fromBlock,更早的间隔成交不补。

余额不足暂停后恢复

POST/v1/account/subscriptions/:id/resumeAPI key

订阅不支持手动暂停,不再需要时请取消。余额不足时系统会自动暂停:续费时余额不够支付下一小时, 订阅变成 paused(pausedReason: "insufficient_balance"), 推送随即停止,不再扣费。充值后调用恢复接口。重新扣一个小时,从当前链头(同样往回 65 个块)开始。 暂停期最后约 96 秒的成交可能会推过来,更早的暂停期成交不补推。已 canceled 的恢复不了(409),直接重新订。

shell
# what is still being pushed — active and paused only, newest first
curl -s https://api.pmwallets.com/v1/account/subscriptions -H "Authorization: Bearer $PMW_KEY"

# stop one. Billing stops here; the hour already paid for is not refunded
curl -s -X DELETE https://api.pmwallets.com/v1/account/subscriptions/$SUB_ID \
  -H "Authorization: Bearer $PMW_KEY"

# restart one that ran out of balance. Charges another hour and resumes 65 blocks
# (~96 s) behind the head — those last fills may arrive (dedupe on eventId); anything
# older in the paused span is not backfilled
curl -s -X POST https://api.pmwallets.com/v1/account/subscriptions/$SUB_ID/resume \
  -H "Authorization: Bearer $PMW_KEY"

从出块到发出通常在一秒以内;延迟页公布的是实测的 p50 和 p95, 不作为延迟承诺。我们的服务器在英国。下单前请确认机器人所在地区:Polymarket 不接受来自英国、美国、德国、法国等国家的新 API 订单。爱尔兰(AWS eu-west-1)是最近的允许 API 下单地区,靠近我们的服务器和 Polymarket 位于伦敦的服务器。pmwallets-copytrade check 会告诉你所在地区能不能下单。