Polymarket 天气预测市场自动交易
简介
AION Market 官方 SDK 技能,支持一键自动化天气衍生品市场交易,默认2 USDC小额投资,适合快速参与预测市场。
原始描述
Autonomous Polymarket weather-market trading flow for AION Market agents. After the user provides AION API key and wallet private key, the agent should autom...
通过你的 Agent 添加
安装目录:polymarket-weather-bands/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
polymarket-weather-bands 是一个面向 AION Market 平台的自动化交易技能,专门用于 Polymarket 的天气预测市场。用户仅需提供 AIONMARKET_API_KEY 和 WALLET_PRIVATE_KEY 两项核心凭证,代理即可自动完成钱包地址派生、CLOB 凭证注册、余额检查、Gas 费评估、授权额度验证等全流程操作。
该技能采用"一键式"设计哲学:代理会自动抓取 Polymarket Gamma API 上最活跃的天气市场(按 24 小时交易量和流动性排序),筛选条件合理的标的,默认以 2 USDC 执行市价买入订单,并在交易完成后通过 Polymarket CLOB 验证实际成交结果。整个流程无需用户逐步骤确认,实现了真正的自动化交易体验。
显著优点
极简交互设计是该技能最突出的特点。传统去中心化预测市场交易需要用户手动处理钱包连接、授权、市场筛选、订单构建等复杂环节,而该技能将这一切压缩为两个输入字段,大幅降低了参与门槛。
智能风控机制体现在多层自动检查:USDC 余额不足自动拦截、Polygon 主网 Gas 费预估、授权额度自动补充(当 Gas 充足时),以及市价单执行价格上限保护。这些设计有效防止了常见的交易失败和资金损失。
官方生态集成方面,该技能深度绑定 AION Market SDK(PyPI 分发)和 Polymarket 官方 Gamma/CLOB API,数据来源可靠,交易链路经过标准化封装,相比野生方案具有更高的稳定性和可维护性。
潜在缺点与局限性
单一资产暴露是首要限制:该技能仅支持天气预测市场,无法扩展至政治、体育等其他 Polymarket 品类,用户需额外技能实现多市场策略。
小额默认策略虽降低了风险,但也限制了收益弹性。2 USDC 的默认仓位对于希望配置较大资金的资深用户而言需要显式覆盖参数,增加了操作复杂度。
链上依赖风险不容忽视:Polygon 网络拥堵时 Gas 费可能剧烈波动,技能虽会检查 Gas 但无法预测实时变化;USDC 合约或 Polymarket 智能合约若出现异常,自动授权和交易可能面临失败或资金锁定。
验证盲区存在:当 SDK 返回 INTERNAL_ERROR 或空结果时,技能依赖 Polymarket 交易历史回查验证,若链上数据延迟或 API 不一致,可能导致状态误判。
适合的目标群体
该技能最适合三类用户:预测市场新手希望以最小认知成本体验链上交易;量化策略开发者需要标准化的 AION Market 接口封装作为策略组件;小额资金配置者寻求通过天气事件进行投资组合多元化,且愿意接受 2-10 USDC 级别的风险敞口。
不适合高频大额交易者、需要跨市场对冲的专业机构,以及对私钥托管有安全顾虑的极端保守用户。
使用风险
私钥安全是最高优先级风险。技能要求直接输入 WALLET_PRIVATE_KEY,若环境泄露或被日志记录,将导致钱包完全失控。强烈建议在隔离环境中运行,使用专用钱包而非主钱包。
智能合约风险包括 Polymarket 合约漏洞、USDC 黑名单机制、以及 AION Market SDK 本身的潜在缺陷。历史表明预测市场合约曾出现结算争议和流动性危机。
市场风险方面,天气预测本质上是对气象数据的博弈,NOAA 预报修正、极端天气突发、或市场操纵都可能导致价格剧烈波动,2 USDC 虽小但可能快速归零。
运营依赖上,该技能依赖 AION Market 服务的持续可用性,若官方 SDK 更新或 API 变更,技能可能失效。此外 aionmarket-trading 父技能的版本兼容性也需持续关注。
技能正文
name: polymarket-weather-bands description: | Autonomous Polymarket weather-market trading flow for AION Market agents. After the user provides AION API key and wallet private key, the agent should automatically derive wallet and CLOB credentials, register them, inspect the hottest active weather markets, choose a suitable market, check USDC balance, check Polygon gas, check allowances, auto-approve when allowance is missing, prefer a market order with a default 2 USDC spend, and verify the actual trade result from Polymarket after submission.
Use when: an AI agent needs a smooth one-shot weather trading flow on AION
Market / Polymarket without repeatedly asking for confirmation on steps the
agent can safely complete itself.
metadata:
author: "AION Market"
version: "0.3.0"
tags:
[
polymarket,
weather,
temperature-bands,
weather-bands,
noaa-forecast,
prediction-market,
automated-trading,
aionmarket-sdk,
temperature-trading,
]
homepage: "https://aionmarket.com"
docs: "https://docs.aionmarket.com"
sdk: "aionmarket-sdk (PyPI)"
depends_on: "aionmarket-trading"
Skill: polymarket-weather-bands
This skill defines a compact one-shot weather trading flow on top of aionmarket-trading.
It is intentionally upload-friendly: the file describes the required behavior without depending on a separate runner.py.
Scope
- Ask only for
AIONMARKET_API_KEY and WALLET_PRIVATE_KEY
- Auto-derive wallet address and Polymarket CLOB credentials
- Auto-register wallet credentials with AION Market
- Auto-check USDC balance, Polygon gas, and required allowance
- Auto-approve if allowance is insufficient and gas is available
- Fetch the hottest active weather markets from Polymarket
- Auto-pick a suitable market and prefer a market buy order
- Default to
2 USDC spend unless the user overrides size or requests a limit order
- Verify the actual result through Polymarket if the SDK response is weak
AIONMARKET_API_KEY and WALLET_PRIVATE_KEY2 USDC spend unless the user overrides size or requests a limit orderThis skill does not implement forecasting models or unattended recurring trading.
Required Inputs
Input
Required
Default
AIONMARKET_API_KEY
yes
none
WALLET_PRIVATE_KEY
yes
none
orderMode
no
market
orderSize
no
2 USDC
outcome
no
auto
price
only for explicit limit order
auto
| Input | Required | Default |
|---|---|---|
AIONMARKET_API_KEY |
yes | none |
WALLET_PRIVATE_KEY |
yes | none |
orderMode |
no | market |
orderSize |
no | 2 USDC |
outcome |
no | auto |
price |
only for explicit limit order | auto |
The agent should not ask for additional confirmation on steps it can execute directly.
Mandatory Rules
- If either secret is missing, stop and ask for it.
- Never ask the user to manually provide Polymarket API credentials.
- After the private key is available, automatically perform wallet derivation, wallet registration, balance checks, gas checks, allowance checks, and approval when needed.
- Show the selected market snapshot and final order parameters before submission, but do not block on confirmation unless the user explicitly requested manual confirmation mode.
- Default to a market buy order.
- Default spend is
2 USDC.
- For market orders, auto-estimate an executable cap from order book or market price.
- For limit orders, ask for price only if the user explicitly requested limit mode and did not provide one.
- Always send a full signed
order object and walletAddress in the trade payload.
- If the SDK returns a generic error or empty result, automatically verify the outcome using Polymarket trades and orders.
Market Selection Policy
2 USDC.order object and walletAddress in the trade payload.Use Polymarket Gamma weather markets and rank candidates by:
volume24hrdescendingliquiditydescending- valid
conditionId,clobTokenIds, and usable YES/NO prices - prices not pinned too close to
0or1 - better immediate fill characteristics for market orders
Choose the best candidate automatically unless the user requested a specific market.
Recommended endpoint:
GET https://gamma-api.polymarket.com/events/pagination?tag_slug=weather&active=true&closed=false&archived=false&order=volume24hr&ascending=false&limit=20&offset=0
Execution Policy
The agent should follow this sequence:
- Derive wallet address and CLOB credentials from
WALLET_PRIVATE_KEY - Register wallet credentials in AION Market if missing
- Check USDC balance, Polygon gas, and allowance
- Auto-approve the needed spender if allowance is insufficient
- Fetch and rank hot weather markets
- Show the selected market snapshot
- Resolve defaults:
orderMode=market,orderSize=2,side=BUY - Build a signed Polymarket order
- Submit through
client.trade() - Verify the actual result from Polymarket CLOB if the SDK wrapper response is incomplete
Required Trade Payload
Field
Required
marketConditionId
yes
marketQuestion
yes
outcome
yes
orderSize
yes
price
yes
isLimitOrder
yes
orderType
yes
order
yes
walletAddress
yes
reasoning
yes
| Field | Required |
|---|---|
marketConditionId |
yes |
marketQuestion |
yes |
outcome |
yes |
orderSize |
yes |
price |
yes |
isLimitOrder |
yes |
orderType |
yes |
order |
yes |
walletAddress |
yes |
reasoning |
yes |
Important:
marketConditionIdmust be the sub-marketconditionId, not the event idordermust be the full signed object frompy-clob-client- market orders should use
FAKorFOKsemantics - limit orders should respect tick size and minimum size
Failure Handling
- If balance is insufficient, stop and report the deficit
- If gas is insufficient, stop and report the shortfall
- If allowance is insufficient and gas exists, auto-approve and continue
- If
get_market_context() fails in sandbox, continue using direct market data and CLOB read-only validation as fallback
- Never execute fallback orders directly through Polymarket SDK; trade and cancel actions must use AION API endpoints only
- If SDK returns
tradeResult: null or INTERNAL_ERROR, verify recent trades and open orders before reporting failure
Minimal Example
from aionmarket_sdk import AionMarketClient
from py_clob_client.client import ClobClient
client = AionMarketClient(api_key=AIONMARKET_API_KEY)
bootstrap = ClobClient("https://clob.polymarket.com", key=WALLET_PRIVATE_KEY, chain_id=137)
wallet_address = bootstrap.get_address()
creds = bootstrap.create_or_derive_api_creds()
check = client.check_wallet_credentials(wallet_address)
if not check.get("hasCredentials"):
client.register_wallet_credentials(
wallet_address=wallet_address,
api_key=creds.api_key,
api_secret=creds.api_secret,
api_passphrase=creds.api_passphrase,
)
# Then: auto-check balance/gas/allowance -> fetch hot weather markets ->
# auto-pick candidate -> build signed market order -> client.trade(payload) ->
# verify with Polymarket trades if needed.
get_market_context() fails in sandbox, continue using direct market data and CLOB read-only validation as fallbacktradeResult: null or INTERNAL_ERROR, verify recent trades and open orders before reporting failurefrom aionmarket_sdk import AionMarketClient
from py_clob_client.client import ClobClient
client = AionMarketClient(api_key=AIONMARKET_API_KEY)
bootstrap = ClobClient("https://clob.polymarket.com", key=WALLET_PRIVATE_KEY, chain_id=137)
wallet_address = bootstrap.get_address()
creds = bootstrap.create_or_derive_api_creds()
check = client.check_wallet_credentials(wallet_address)
if not check.get("hasCredentials"):
client.register_wallet_credentials(
wallet_address=wallet_address,
api_key=creds.api_key,
api_secret=creds.api_secret,
api_passphrase=creds.api_passphrase,
)
# Then: auto-check balance/gas/allowance -> fetch hot weather markets ->
# auto-pick candidate -> build signed market order -> client.trade(payload) ->
# verify with Polymarket trades if needed.
This skill file is self-contained and intended to be uploaded on its own.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。