Kalshi Weather Trader
Trade temperature markets on Kalshi using NOAA forecast data, via DFlow on Solana.
This is a template. The default signal is NOAA temperature forecasts — remix it with other weather APIs, different forecast models, or additional market types (precipitation, wind, etc.). The skill handles all the plumbing (market discovery, NOAA parsing, trade execution, safeguards). Your agent provides the alpha.
Powered by DFlow. Kalshi trades execute via DFlow's Solana-based prediction market infrastructure. KYC verification through Proof is required for buys.
When to Use This Skill
Use this skill when the user wants to:
- - Trade weather markets on Kalshi (not Polymarket)
- Set up automated temperature trading on Kalshi
- Check their Kalshi weather trading positions
- Configure trading thresholds or locations
Setup Flow
When user asks to install or configure this skill:
- 1. Ask for Simmer API key
- They can get it from simmer.markets/dashboard → SDK tab
- Store in environment as INLINECODE0
- 2. Ask for Solana private key (required for live trading)
- This is the base58-encoded secret key for their Solana wallet
- Store in environment as
SOLANA_PRIVATE_KEY
- The SDK uses this to sign transactions client-side automatically
- 3. Verify KYC
- Required for Kalshi buys (not sells)
- Complete at
dflow.net/proof
- Check status: INLINECODE2
- 4. Fund the wallet
- SOL on Solana mainnet for transaction fees (~0.01 SOL)
- USDC on Solana mainnet for trading capital
- 5. Ask about settings (or confirm defaults)
- Entry threshold: When to buy (default 15¢)
- Exit threshold: When to sell (default 45¢)
- Max position: Amount per trade (default $2.00)
- Locations: Which cities to trade (default NYC)
- 6. Save settings to environment variables
- 7. Set up cron (disabled by default — user must enable scheduling)
Configuration
| Setting | Environment Variable | Default | Description |
|---|
| Entry threshold | INLINECODE3 | 0.15 | Buy when price below this |
| Exit threshold |
SIMMER_WEATHER_EXIT_THRESHOLD | 0.45 | Sell when price above this |
| Max position |
SIMMER_WEATHER_MAX_POSITION_USD | 2.00 | Maximum USD per trade |
| Max trades/run |
SIMMER_WEATHER_MAX_TRADES_PER_RUN | 5 | Maximum trades per scan cycle |
| Locations |
SIMMER_WEATHER_LOCATIONS | NYC | Comma-separated cities (NYC, Chicago, Seattle, Atlanta, Dallas, Miami) |
| Binary only |
SIMMER_WEATHER_BINARY_ONLY | false | Skip range-bucket events, only trade binary yes/no markets |
| Smart sizing % |
SIMMER_WEATHER_SIZING_PCT | 0.05 | % of balance per trade |
| Slippage max |
SIMMER_WEATHER_SLIPPAGE_MAX | 0.15 | Skip trades with slippage above this (0.15 = 15%) |
| Min liquidity |
SIMMER_WEATHER_MIN_LIQUIDITY | 0 | Skip markets with liquidity below this USD amount (0 = disabled) |
Supported locations: NYC, Chicago, Seattle, Atlanta, Dallas, Miami
Quick Commands
CODEBLOCK0
API Reference:
- - Base URL: INLINECODE12
- Auth: INLINECODE13
- Portfolio: INLINECODE14
- Positions: INLINECODE15
Running the Skill
CODEBLOCK1
How It Works
Each cycle the script:
- 1. Fetches active weather markets from Simmer API
- Groups markets by event (each temperature day is one event)
- Parses event names to get location and date
- Fetches NOAA forecast for that location/date
- Finds the temperature bucket that matches the forecast
- Safeguards: Checks context for flip-flop warnings, slippage, time decay
- Trend Detection: Looks for recent price drops (stronger buy signal)
- Entry: If bucket price < threshold and safeguards pass → BUY
- Exit: Checks open positions, sells if price > exit threshold
- Tagging: All trades tagged with
sdk:kalshi-weather for tracking
Safeguards
Before trading, the skill checks:
- - Flip-flop warning: Skips if you've been reversing too much
- Slippage: Skips if estimated slippage > 15%
- Time decay: Skips if market resolves in < 2 hours
- Market status: Skips if market already resolved
- Kalshi maintenance: Kalshi's clearinghouse has a weekly maintenance window on Thursdays 3:00-5:00 AM ET — orders during this window will fail
Disable with --no-safeguards (not recommended).
Troubleshooting
"Safeguard blocked: Severe flip-flop warning"
- - You've been changing direction too much on this market
- Wait before trading again
"Slippage too high"
- - Market is illiquid, reduce position size or skip
"No weather markets found"
- - Weather markets may not be active (seasonal)
- Make sure you've imported Kalshi weather markets first: INLINECODE18
"KYC verification required"
- - Complete verification at dflow.net/proof
- Only required for buys, not sells
"SOLANAPRIVATEKEY not set"
- - The SDK signs transactions automatically when this env var is present
- Fix: INLINECODE19
"Insufficient SOL for transaction fees"
- - Fund your Solana wallet with at least 0.05 SOL for gas
"API key invalid"
- - Get new key from simmer.markets/dashboard → SDK tab
Kalshi 天气交易员
使用 NOAA 预报数据,通过 Solana 上的 DFlow 在 Kalshi 交易温度市场。
这是一个模板。 默认信号是 NOAA 温度预报——可与其他天气 API、不同的预报模型或额外的市场类型(降水、风等)进行混搭。该技能处理所有底层工作(市场发现、NOAA 解析、交易执行、安全防护)。您的智能体提供阿尔法收益。
由 DFlow 提供支持。 Kalshi 交易通过 DFlow 基于 Solana 的预测市场基础设施执行。买入需要通 Proof 完成 KYC 验证。
何时使用此技能
当用户想要以下操作时使用此技能:
- - 在 Kalshi(而非 Polymarket)上交易天气市场
- 在 Kalshi 上设置自动温度交易
- 查看他们的 Kalshi 天气交易持仓
- 配置交易阈值或地点
设置流程
当用户要求安装或配置此技能时:
- 1. 询问 Simmer API 密钥
- 可从 simmer.markets/dashboard → SDK 标签页获取
- 存储到环境变量 SIMMER
APIKEY 中
- 2. 询问 Solana 私钥(实盘交易必需)
- 这是其 Solana 钱包的 base58 编码密钥
- 存储到环境变量 SOLANA
PRIVATEKEY 中
- SDK 使用此密钥在客户端自动签署交易
- 3. 验证 KYC
- Kalshi 买入(非卖出)必需
- 在
dflow.net/proof 完成
- 检查状态:curl https://api.simmer.markets/api/proof/status?wallet=YOUR
SOLANAADDRESS
- 4. 为钱包充值
- Solana 主网上的 SOL 用于交易费用(约 0.01 SOL)
- Solana 主网上的 USDC 用于交易资金
- 5. 询问设置(或确认默认值)
- 入场阈值:何时买入(默认 15 美分)
- 出场阈值:何时卖出(默认 45 美分)
- 最大持仓:每笔交易金额(默认 2.00 美元)
- 地点:交易哪些城市(默认纽约市)
- 6. 将设置保存到环境变量
- 7. 设置定时任务(默认禁用——用户必须启用调度)
配置
| 设置 | 环境变量 | 默认值 | 描述 |
|---|
| 入场阈值 | SIMMERWEATHERENTRYTHRESHOLD | 0.15 | 价格低于此值时买入 |
| 出场阈值 |
SIMMERWEATHER
EXITTHRESHOLD | 0.45 | 价格高于此值时卖出 |
| 最大持仓 | SIMMER
WEATHERMAX
POSITIONUSD | 2.00 | 每笔交易最大美元金额 |
| 每轮最大交易数 | SIMMER
WEATHERMAX
TRADESPER_RUN | 5 | 每次扫描周期的最大交易数 |
| 地点 | SIMMER
WEATHERLOCATIONS | NYC | 逗号分隔的城市列表(NYC, Chicago, Seattle, Atlanta, Dallas, Miami) |
| 仅二元市场 | SIMMER
WEATHERBINARY_ONLY | false | 跳过区间桶事件,仅交易二元是/否市场 |
| 智能仓位比例 | SIMMER
WEATHERSIZING_PCT | 0.05 | 每笔交易占余额的百分比 |
| 最大滑点 | SIMMER
WEATHERSLIPPAGE_MAX | 0.15 | 跳过滑点高于此值的交易(0.15 = 15%) |
| 最低流动性 | SIMMER
WEATHERMIN_LIQUIDITY | 0 | 跳过流动性低于此美元金额的市场(0 = 禁用) |
支持的地点: NYC, Chicago, Seattle, Atlanta, Dallas, Miami
快速命令
bash
检查账户余额和持仓
python scripts/status.py
详细持仓列表
python scripts/status.py --positions
API 参考:
- - 基础 URL:https://api.simmer.markets
- 认证:Authorization: Bearer $SIMMERAPIKEY
- 投资组合:GET /api/sdk/portfolio
- 持仓:GET /api/sdk/positions
运行技能
bash
模拟运行(默认——显示机会,不执行交易)
python weather_trader.py
执行真实交易
python weather_trader.py --live
使用智能仓位调整(使用投资组合余额)
python weather_trader.py --live --smart-sizing
仅检查持仓
python weather_trader.py --positions
查看配置
python weather_trader.py --config
静默模式——仅在交易/错误时输出(适合高频运行)
python weather_trader.py --live --smart-sizing --quiet
工作原理
每个周期脚本:
- 1. 从 Simmer API 获取活跃的天气市场
- 按事件对市场进行分组(每个温度日为一个事件)
- 解析事件名称以获取地点和日期
- 获取该地点/日期的 NOAA 预报
- 找到与预报匹配的温度桶
- 安全防护:检查上下文中的反复警告、滑点、时间衰减
- 趋势检测:寻找近期价格下跌(更强的买入信号)
- 入场:如果桶价格 < 阈值且安全防护通过 → 买入
- 出场:检查未平仓持仓,如果价格 > 出场阈值则卖出
- 标记:所有交易标记为 sdk:kalshi-weather 以便追踪
安全防护
交易前,技能会检查:
- - 反复警告:如果近期反转过多则跳过
- 滑点:如果预估滑点 > 15% 则跳过
- 时间衰减:如果市场在 < 2 小时内结算则跳过
- 市场状态:如果市场已结算则跳过
- Kalshi 维护:Kalshi 的清算所每周四美国东部时间 3:00-5:00 AM 有维护窗口——此期间的订单将失败
使用 --no-safeguards 禁用(不推荐)。
故障排除
安全防护阻止:严重反复警告
滑点过高
未找到天气市场
- - 天气市场可能未激活(季节性)
- 确保您已先导入 Kalshi 天气市场:POST /api/sdk/markets/import/kalshi
需要 KYC 验证
SOLANAPRIVATEKEY 未设置
- - 当此环境变量存在时,SDK 会自动签署交易
- 修复:export SOLANAPRIVATEKEY=<您的-base58-密钥>
SOL 不足以支付交易费用
- - 向您的 Solana 钱包充值至少 0.05 SOL 作为燃料费
API 密钥无效
- - 从 simmer.markets/dashboard → SDK 标签页获取新密钥