{"id":"3de4c801-4f32-4a92-8394-99ebce2fd2d8","entityType":"agent","slug":"clawhub-simmer-polymarket-btc-up-down-trader","name":"polymarket-btc-up-down-trader","canonicalUrl":"https://www.xpersona.co/agent/clawhub-simmer-polymarket-btc-up-down-trader","canonicalPath":"/agent/clawhub-simmer-polymarket-btc-up-down-trader","generatedAt":"2026-10-11T07:40:59.772Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T04:06:38.700Z","emptyReason":null},"description":"Trade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. Enters on CEX momentum divergence; exits automatically on time cap, volume spike, or target capture. Use when the user wants to trade BTC direction markets (hours/days duration), not fast 5-minute markets.","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s17eez0vajry6hjb97y9mbtv2s85wekv:polymarket-btc-up-down-trader","sourceUrl":"https://clawhub.ai/simmer/polymarket-btc-up-down-trader","homepage":"https://clawhub.ai/simmer/skills/polymarket-btc-up-down-trader","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/simmer/polymarket-btc-up-down-trader","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/simmer/skills/polymarket-btc-up-down-trader","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"polymarket-btc-up-down-trader technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T04:06:38.700Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T04:06:38.700Z","emptyReason":null},"stars":null,"forks":null,"downloads":1165,"packageName":null,"latestVersion":"1.2.5","tractionLabel":"1.2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T04:06:38.687Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T04:06:38.700Z","lastCrawledAt":"2026-10-11T04:06:38.687Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T04:06:38.687Z","lastVerifiedAt":null,"highlights":[{"version":"1.2.5","createdAt":"2026-09-17T16:41:01.377Z","changelog":"Version 1.2.5 - Removed unused test files to simplify the codebase. - Updated documentation in CHANGELOG.md and SKILL.md for clarity and version alignment. - Refined clawhub.json and strategy.py for internal consistency. - No changes to exit or entry logic; production strategy remains the same.","fileCount":7,"zipByteSize":23354},{"version":"1.2.3","createdAt":"2026-09-17T03:29:37.906Z","changelog":"Version 1.2.3 – Documentation update only - Removed the \"Oracle-Engineering Halt Gate\" section from documentation; this skill never used the detector and does not trade the short-duration markets that section targeted. - No code changes or behavior modifications.","fileCount":10,"zipByteSize":32902},{"version":"1.2.2","createdAt":"2026-09-16T10:14:56.781Z","changelog":"polymarket-btc-up-down-trader v1.2.2 - Fixed position accounting: Live NO entries now log entry price in YES-scale (`avg_cost` held-side), enabling correct `target_hit` detection for both YES and NO sides. - Replay rows (backtests) are unaffected; no change to their data structure/handling. - Updated documentation (SKILL.md) for new position handling details. - Added unit test for replay plane compatibility. - Removed obsolete skill-card.md.","fileCount":10,"zipByteSize":33108},{"version":"1.1.0","createdAt":"2026-06-13T02:28:10.029Z","changelog":"## Version 1.1.0 – Changelog - Updated documentation in SKILL.md for improved clarity and detail. - Removed skill-card.md for streamlined project structure. - General maintenance and minor fixes across key files. - No core logic changes to strategy or algorithmic behavior.","fileCount":8,"zipByteSize":23315},{"version":"1.0.2","createdAt":"2026-06-11T05:42:38.146Z","changelog":"Fix live mode to execute entries and exits through SimmerClient.trade() instead of nonexistent buy()/sell() methods.","fileCount":8,"zipByteSize":22731},{"version":"1.0.1","createdAt":"2026-05-18T03:42:29.279Z","changelog":"- Improved documentation for setup, configuration, and usage. - Added detailed explanations of entry and exit logic, including new FAQ and troubleshooting. - Clarified intended use for daily/weekly BTC UP/DOWN markets vs. fast markets. - Provided sample configurations and CLI usage examples for convenience. - Outlined Polymarket fee structure and trading considerations in more depth.","fileCount":7,"zipByteSize":20063}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17eez0vajry6hjb97y9mbtv2s85wekv:polymarket-btc-up-down-trader","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17eez0vajry6hjb97y9mbtv2s85wekv:polymarket-btc-up-down-trader` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/simmer/polymarket-btc-up-down-trader before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-simmer-polymarket-btc-up-down-trader/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-simmer-polymarket-btc-up-down-trader/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-simmer-polymarket-btc-up-down-trader/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-simmer-polymarket-btc-up-down-trader/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-simmer-polymarket-btc-up-down-trader/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-simmer-polymarket-btc-up-down-trader/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T07:40:59.769Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-simmer-polymarket-btc-up-down-trader/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-simmer-polymarket-btc-up-down-trader/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-simmer-polymarket-btc-up-down-trader/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-simmer-polymarket-btc-up-down-trader/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T04:06:38.700Z","emptyReason":null},"readme":"Skill: polymarket-btc-up-down-trader\n\nOwner: simmer\n\nSummary: Trade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. Enters on CEX momentum divergence; exits automatically on time cap, volume spike, or target capture. Use when the user wants to trade BTC direction markets (hours/days duration), not fast 5-minute markets.\n\nTags: latest:1.2.5\n\nVersion history:\n\nv1.2.5 | 2026-09-17T16:41:01.377Z | auto\n\nVersion 1.2.5\n\n- Removed unused test files to simplify the codebase.\n- Updated documentation in CHANGELOG.md and SKILL.md for clarity and version alignment.\n- Refined clawhub.json and strategy.py for internal consistency.\n- No changes to exit or entry logic; production strategy remains the same.\n\nv1.2.3 | 2026-09-17T03:29:37.906Z | auto\n\nVersion 1.2.3 – Documentation update only\n\n- Removed the \"Oracle-Engineering Halt Gate\" section from documentation; this skill never used the detector and does not trade the short-duration markets that section targeted.\n- No code changes or behavior modifications.\n\nv1.2.2 | 2026-09-16T10:14:56.781Z | auto\n\npolymarket-btc-up-down-trader v1.2.2\n\n- Fixed position accounting: Live NO entries now log entry price in YES-scale (`avg_cost` held-side), enabling correct `target_hit` detection for both YES and NO sides.\n- Replay rows (backtests) are unaffected; no change to their data structure/handling.\n- Updated documentation (SKILL.md) for new position handling details.\n- Added unit test for replay plane compatibility.\n- Removed obsolete skill-card.md.\n\nv1.1.0 | 2026-06-13T02:28:10.029Z | auto\n\n## Version 1.1.0 – Changelog\n\n- Updated documentation in SKILL.md for improved clarity and detail.\n- Removed skill-card.md for streamlined project structure.\n- General maintenance and minor fixes across key files.\n- No core logic changes to strategy or algorithmic behavior.\n\nv1.0.2 | 2026-06-11T05:42:38.146Z | user\n\nFix live mode to execute entries and exits through SimmerClient.trade() instead of nonexistent buy()/sell() methods.\n\nv1.0.1 | 2026-05-18T03:42:29.279Z | auto\n\n- Improved documentation for setup, configuration, and usage.\n- Added detailed explanations of entry and exit logic, including new FAQ and troubleshooting.\n- Clarified intended use for daily/weekly BTC UP/DOWN markets vs. fast markets.\n- Provided sample configurations and CLI usage examples for convenience.\n- Outlined Polymarket fee structure and trading considerations in more depth.\n\nArchive index:\n\nArchive v1.2.5: 7 files, 23354 bytes\n\nFiles: CHANGELOG.md (3585b), clawhub.json (2097b), DISCLAIMER.md (1925b), skill-card.md (2170b), SKILL.md (11507b), strategy.py (46204b), _meta.json (148b)\n\nFile v1.2.5:SKILL.md\n\n---\nname: polymarket-btc-up-down-trader\ndescription: Trade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. Enters on CEX momentum divergence; exits automatically on time cap, volume spike, or target capture. Use when the user wants to trade BTC direction markets (hours/days duration), not fast 5-minute markets.\nmetadata:\n  author: Simmer (@simmer_markets)\n  version: \"1.2.5\"\n  displayName: Polymarket BTC Up-Down Trader\n  difficulty: intermediate\n---\n# Polymarket BTC Up-Down Trader\n\nTrade Polymarket's BTC daily and weekly UP/DOWN markets with built-in exit discipline. Enters on Binance momentum signals, exits automatically before resolution tail risk bites.\n\n> 🚨 **Framework, not a production trading system.** Read [DISCLAIMER.md](./DISCLAIMER.md) before connecting to a wallet with real funds.\n\n> **Polymarket only.** All trades execute on Polymarket with real USDC. Use `--live` for real trades; default is dry run.\n\n> **Not for fast (5m/15m) markets.** Use `polymarket-fast-loop` for those. This skill targets daily and weekly BTC direction markets with hours-to-days of duration.\n\n## What's New in v1.2.3\n\n- **Removed the \"Oracle-Engineering Halt Gate\" section.** This skill never called that detector, and it does not trade the ≤5-minute markets the gate targets. No code change.\n\n## What's New in v1.2.2\n\n- **Live NO entry is YES-scale.** `avg_cost` is the held-side price. A NO bought at 0.30 now stores entry 0.70 so `target_hit` can fire. Replay rows have no `avg_cost` and were already correct.\n\n## What's New in v1.2.1\n\n- **Exit monitor reads real `Position` objects.** `client.get_positions()` returns dataclasses, not dicts. Replay rows have shares + `cost_basis` only. Side, size, and YES-scale entry are derived. A missing `sources` list under replay is this skill.\n\n## What's New in v1.2.0\n\n- **Replay plane (SIM-5442).** Under `simmer backtest` (`SIMMER_REPLAY=1`) discovery, prices, and the clock come from the existing replay harness — same `SIMMER_REPLAY` / `SIMMER_REPLAY_NOW` pattern as weather. Live Gamma and CLOB midpoint stay dark. Candles were already replay-safe. The exit monitor reads SDK `Position` objects and replay share-rows (no `.get` crash after the first fill).\n- **Keep / kill / fix** for this path is in Troubleshooting. Do not add a second capital lane until a full-tape run can produce an honest KEEP or KILL.\n\n> ⚠️ **BTC UP/DOWN markets carry Polymarket's crypto taker fee.** Effective rate is 3.5% at 50¢, up to ~6.6% on cheap shares. Makers pay 0% and earn a 20% rebate from collected taker fees. Factor this into your minimum edge threshold.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Trade BTC daily or weekly UP/DOWN prediction markets on Polymarket\n- Apply systematic exit discipline (don't hold to settlement)\n- Use CEX price momentum as the entry signal\n- Monitor open positions and auto-exit when targets are hit\n\n## Setup Flow\n\n1. **Install the Simmer SDK**\n   ```bash\n   pip install simmer-sdk\n   ```\n\n2. **Set your API key**\n   - Get from simmer.markets/dashboard → SDK tab\n   - `export SIMMER_API_KEY=\"your-key-here\"`\n\n3. **Set wallet private key** (required for live trading)\n   - `export WALLET_PRIVATE_KEY=\"0x...\"`\n   - Not needed for dry-run or managed wallets.\n\n4. **Configure exit discipline** (optional — defaults are well-tuned)\n   ```bash\n   python strategy.py --config\n   ```\n\n## Quick Start\n\n```bash\n# Dry run — see what would happen\npython strategy.py\n\n# Go live\npython strategy.py --live\n\n# Monitor-only (check exits without new entries)\npython strategy.py --live --monitor\n\n# Quiet mode for cron\npython strategy.py --live --quiet\n```\n\n## How to Run on a Loop\n\n**Linux crontab:**\n```\n# Every 30 minutes\n*/30 * * * * cd /path/to/skill && python strategy.py --live --quiet\n```\n\n**OpenClaw native cron:**\n```bash\nopenclaw cron add \\\n  --name \"BTC Up-Down Trader\" \\\n  --cron \"*/30 * * * *\" \\\n  --session isolated \\\n  --message \"Run BTC up-down trader: cd /path/to/skill && python strategy.py --live --quiet\"\n```\n\n## Configuration\n\nAll settings configurable via `config.json`, environment variables, or `--set`:\n\n```bash\npython strategy.py --set exit_before_resolution_hours=2.0\npython strategy.py --set volume_spike_exit_multiplier=4.0\npython strategy.py --set target_hit_capture_pct=0.75\n```\n\n### Exit Discipline Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `exit_before_resolution_hours` | `1.0` | `SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS` | Close position this many hours before scheduled resolution. Disable with `0`. |\n| `volume_spike_exit_multiplier` | `3.0` | `SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER` | Exit when 10-minute CLOB volume hits N× the rolling baseline. Disable with `0`. |\n| `target_hit_capture_pct` | `0.85` | `SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT` | Exit when position has captured 85% of the theoretical max gain. Disable with `0`. |\n| `volume_baseline_windows` | `6` | `SIMMER_BTCUD_VOLUME_BASELINE_WINDOWS` | Number of prior 10-minute windows used to compute volume baseline. |\n\n**Why these defaults?** Exit behavior on short-dated prediction markets skews heavily toward early exits — the final hours before resolution compress remaining upside while tail risk (last-minute reversals, oracle variance) stays constant. The defaults are calibrated to exit early while capturing the bulk of the move. Empirical work on short-dated crypto UP/DOWN exit patterns informed the calibration; adjust based on your own backtest results.\n\n### Entry Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `entry_threshold` | `0.05` | `SIMMER_BTCUD_ENTRY_THRESHOLD` | Min discount from 50¢ toward the momentum-opposing side. Entry only fires when the market *disagrees* with momentum: UP signal requires YES < 0.50 (edge = `0.50 − YES`); DOWN signal requires YES > 0.50 (edge = `YES − 0.50`). Skips when market already agrees with momentum. |\n| `min_momentum_pct` | `0.3` | `SIMMER_BTCUD_MOMENTUM_THRESHOLD` | Min BTC % move (30-min lookback) to trigger |\n| `max_position` | `10.0` | `SIMMER_BTCUD_MAX_POSITION_USD` | Max $ per trade |\n| `daily_budget` | `50.0` | `SIMMER_BTCUD_DAILY_BUDGET_USD` | Max total entry spend per UTC day |\n| `lookback_minutes` | `30` | `SIMMER_BTCUD_LOOKBACK_MINUTES` | Lookback window for BTC momentum signal |\n| `min_hours_to_resolution` | `4.0` | `SIMMER_BTCUD_MIN_HOURS_TO_RESOLUTION` | Skip entry if market resolves in fewer than N hours |\n\n### Example config.json\n\n```json\n{\n  \"exit_before_resolution_hours\": 1.0,\n  \"volume_spike_exit_multiplier\": 3.0,\n  \"target_hit_capture_pct\": 0.85,\n  \"entry_threshold\": 0.05,\n  \"min_momentum_pct\": 0.3,\n  \"max_position\": 10.0,\n  \"daily_budget\": 50.0\n}\n```\n\n## Exit Logic\n\nEach run cycle evaluates open positions against three triggers, in priority order:\n\n### 1. `time_cap` — Time-based exit\nCloses position when the market is within `exit_before_resolution_hours` of resolution.\n\n```\nhours_to_resolution ≤ exit_before_resolution_hours → EXIT (time_cap)\n```\n\nThis is the hard floor. Holding to settlement adds tail risk (oracle variance, thin liquidity, last-minute manipulation) with little remaining upside on a near-resolved market.\n\n### 2. `target_hit` — Profit capture exit\nCloses position when it has captured `target_hit_capture_pct` of the theoretical maximum gain.\n\n```\nYES positions: (current_price - entry_price) / (1.0 - entry_price) ≥ 0.85 → EXIT (target_hit)\nNO positions:  (entry_price - current_price) / entry_price ≥ 0.85 → EXIT (target_hit)\n```\n\nExample: Bought YES at $0.40. Maximum gain = 1.0 - 0.40 = $0.60/share. At $0.91, captured = (0.91 - 0.40) / 0.60 = 85% → exit.\n\n### 3. `volume_spike` — Smart-money volume exit\nCloses position when 10-minute CLOB volume exceeds `volume_spike_exit_multiplier`× the rolling baseline.\n\n```\ncurrent_10m_volume / avg_baseline_volume ≥ 3.0 → EXIT (volume_spike)\n```\n\nA sudden surge in volume near resolution typically signals that informed traders have positioned ahead of outcome certainty. Exiting into the spike captures the liquidity premium.\n\n## Exit Reasons\n\nEvery exit logs one of four reasons:\n\n| Reason | Trigger |\n|--------|---------|\n| `time_cap` | Hours to resolution ≤ `exit_before_resolution_hours` |\n| `target_hit` | Captured ≥ `target_hit_capture_pct` of max gain |\n| `volume_spike` | 10m volume ≥ `volume_spike_exit_multiplier` × baseline |\n| `manual` | User-initiated close via dashboard or SDK |\n\n## CLI Reference\n\n```bash\npython strategy.py                      # Dry run (show positions + opportunities)\npython strategy.py --live               # Execute real trades\npython strategy.py --monitor            # Only run exit checks (no new entries)\npython strategy.py --positions          # Show open positions\npython strategy.py --config             # Show current config\npython strategy.py --set KEY=VALUE      # Update config\npython strategy.py --quiet              # Only output on trades/errors\n```\n\n## Source Tagging\n\nAll trades are tagged `source: \"sdk:btcupdown\"`. This keeps BTC UP/DOWN P&L separate from other strategies in your Simmer portfolio.\n\n## Troubleshooting\n\n### Replay KEEP / KILL (SIM-5442)\n\nReuse `simmer backtest` / `SIMMER_REPLAY=1`. Do not invent a second harness. Pinned path check:\n\n```bash\npython -m pytest skills/polymarket-btc-up-down-trader/tests/test_replay_plane.py -q\n```\n\n| Verdict | What it means |\n|---------|----------------|\n| **FIX** | Path is broken or the tape cannot evaluate the skill. Do not add capital. Repair: live Gamma / CLOB under replay (look-ahead); wall-clock horizon dropping historical dailies; `yes_price` ignored; listing 422 from `tags`/`status`; failed fills burning daily spend; exit monitor crashing on `Position` (no `.get`); replay positions dropped for missing `source`; 0 BTC Up/Down rows on the slice (`--q \"bitcoin up or down\"`, lower `--min-volume`). |\n| **KILL** | Pinned pytest fails, **or** a full-tape run has evals > 0 and the skill still cannot reach `trade()` on a tape daily, **or** P&L after costs is clearly ≤ 0 on honest (not live-Gamma) prices. No second-lane capital. |\n| **KEEP** | Full-tape `simmer backtest` with evals > 0 **and** trades > 0 on tape prices and `SIMMER_REPLAY_NOW`. Pinned unit tests are a path check only — not KEEP. |\n\n**\"No active BTC UP/DOWN markets found\"**\n- Live: Gamma API may be slow or markets may not be trading. Try again in a few minutes.\n- Replay: the skill lists from the tape with `q=bitcoin up or down`. A high-volume slice with 0 Up/Down dailies is FIX, not \"no edge\".\n- Check polymarket.com directly for active BTC UP/DOWN markets.\n\n**\"Could not fetch BTC momentum\"**\n- Binance API rate-limited. Increase `lookback_minutes` or wait.\n\n**\"Momentum X% < minimum Y%\"**\n- Signal not strong enough. Entry threshold working correctly. Adjust `min_momentum_pct` if too conservative.\n\n**Volume spike trigger not firing**\n- Default baseline needs 6 prior 10-minute windows of data. In low-volume markets, set `volume_baseline_windows` lower or increase `volume_spike_exit_multiplier`.\n\n**\"External wallet requires a pre-signed order\"**\n- `WALLET_PRIVATE_KEY` is not set. Export the private key for your Polymarket wallet.\n- The SDK handles all signing automatically once the env var is set.\n\n**\"Balance shows $0 but I have funds on Polygon\"**\n- Polymarket V2 uses pUSD (PolyUSD). Migrate at simmer.markets/dashboard (one click, ~30s).\n\nFile v1.2.5:_meta.json\n\n{\n  \"ownerId\": \"kn7axnp7bzqsf5fkx0z8px7han7zyq1x\",\n  \"slug\": \"polymarket-btc-up-down-trader\",\n  \"version\": \"1.2.5\",\n  \"publishedAt\": 1789663261377\n}\n\nFile v1.2.5:CHANGELOG.md\n\n# Changelog — polymarket-btc-up-down-trader\n\n## [1.2.5] - 2026-09-17\n\n### Changed\n- Requires `simmer-sdk>=0.25.8`, the first release whose `preflight()` is replay-aware. On an older SDK a backtest of this skill stops filling, because preflight blocks replay trades now that the skill no longer passes `skip_preflight`. Live trading is unaffected.\n\n## [1.2.4] - 2026-09-17\n\n### Changed\n- **Replay trades no longer pass the deprecated `skip_preflight` valve (SIM-5430).** `_trade_kwargs` stops injecting `skip_preflight=True` under `SIMMER_REPLAY=1`; `SimmerClient.preflight()` is now replay-aware on a loopback base URL. Live behaviour unchanged.\n\n## [1.2.3] - 2026-09-17\n\n### Fixed\n- **SKILL.md no longer claims an oracle-engineering halt gate.** The section said `simmer_sdk.risk.OracleEngineeringDetector` was built in and enabled by default. No code in this skill calls it, the skill skips the ≤5-minute markets the gate covers, and it has no market-maker or copytrade mode. ClawHub's scan flagged the claim. Docs only; `strategy.py` behaviour is unchanged.\n\n## [1.2.2] - 2026-09-16\n\n### Fixed\n- **Live NO `avg_cost` is held-side, not YES-scale (SIM-5442 F4).** `_normalize_open_position` preferred `avg_cost` over the `cost_basis` derivation. A NO bought at 0.30 (YES 0.70) stored `entry_price=0.30`, so `check_target_hit_exit` never fired when YES fell. Replay rows omit `avg_cost`, so a backtest looked right. Entry now comes from `cost_basis / shares` (NO: `1 - avg`). `avg_cost` is last-resort and is flipped for NO.\n\n## [1.2.1] - 2026-09-16\n\n### Fixed\n- **Exit monitor no longer crashes on SDK `Position` (SIM-5442 hold-merge).** `get_open_positions` used `p.get(\"source\")` on a dataclass. That `AttributeError` killed every tick after the first fill. The skill now reads Position attributes. Replay share-rows (`market_id`, `shares_yes`/`shares_no`, `cost_basis`, no `source`) normalize to side, size, and YES-scale entry (`cost_basis/shares`; NO is `1 - cost_basis/shares_no`). Missing `sources` under replay is this skill.\n\n## [1.2.0] - 2026-09-16\n\n### Added\n- **Replay plane for markets + prices + clock (SIM-5442).** Under `SIMMER_REPLAY=1` the skill lists BTC Up/Down dailies from the Simmer tape (`GET /api/sdk/markets?q=bitcoin up or down`, no `tags`/`status` — those 422 on replay). Horizon uses `SIMMER_REPLAY_NOW`. Prices come from tape `yes_price` / `current_probability`. Live Gamma and CLOB midpoint stay dark. Volume-spike exits are live-only (CLOB trades would be look-ahead). Replay trades pass `skip_preflight=True` so `WALLET_UNVERIFIED` cannot block SimState fills.\n\n### Fixed\n- Failed `trade()` results no longer increment `daily_spend.json`. A miss must not burn the UTC-day budget.\n- Discovery no longer look-aheads to today's live \"Bitcoin Up or Down on …?\" row while a full tape of historical dailies sits unused.\n- **Exit monitor accepts SDK `Position` objects and replay share-rows.** `get_positions()` returns dataclasses (`shares_yes` / `shares_no` / `cost_basis` / `sources`), not dicts. Calling `p.get(\"source\")` crashed after the first fill and killed every later tick. Replay rows have no `source`/`side`/`quantity`/`entry_price` — side and size come from shares; YES-scale entry is `cost_basis/shares` (NO: `1 - cost_basis/shares_no`). Under replay a missing `sources` list is this skill (the session only runs it).\n- Unparseable `SIMMER_REPLAY_NOW` now raises `ReplayClockError` instead of falling through to wall clock (look-ahead).\n- Replay listing `q` is `bitcoin up or down` so ETH/SOL/hourly rows do not burn the eval budget.\n\nFile v1.2.5:DISCLAIMER.md\n\n# Disclaimer\n\nThis skill is a **framework**, not a production trading system. Read this\nin full before connecting it to a wallet with real funds.\n\n## No financial advice\n\nNothing in this skill constitutes financial, investment, or trading\nadvice. The default strategy implemented here is a starting point, not a\ntested edge. Suitability for any account size or risk tolerance is your\nresponsibility to assess.\n\n## Default parameters are not validated\n\nDefault parameters are calibrated for testing the plumbing, not for live\nprofit. They have not been validated to produce positive returns under\ncurrent market conditions. Run paper mode for an extended period before\nscaling beyond default position sizes.\n\n## Automated trading carries irreversible risk\n\nWhen this skill runs with `--live`, it places real on-chain orders.\nOn-chain trades cannot be recalled. Strategy errors, signal lag, market\nregime shifts, and operator misconfiguration can produce losses\nexceeding any specific position size.\n\n## Risk monitoring may not apply to all market types\n\nStop-loss and take-profit monitors run on a fixed schedule. Markets that\nresolve faster than the monitor cycle cannot be exited automatically.\nPosition sizing is the only risk control on these markets — set it\nconservatively.\n\n## Use of this skill is at your own risk\n\nBy installing and running this skill you agree that the authors are not\nliable for any losses, direct or indirect, that arise from its use. This\napplies regardless of skill provenance — official Simmer skills,\ncommunity skills, and skills imported from external repositories all\ncarry this same disclaimer.\n\n## Where to learn more before going live\n\n- The skill's own `SKILL.md` documents the strategy and parameters\n- Your trading venue's documentation covers fee structure, order types,\n  and resolution rules\n- Simmer SDK documentation covers paper mode, dry-run flags, and\n  position monitoring\n\nFile v1.2.5:skill-card.md\n\n## Description:\n\nTrade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[simmer](https://clawhub.ai/user/simmer)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nTraders and automation operators use this skill to scan Polymarket BTC daily and weekly direction markets, run dry-run checks, and optionally execute live entries and exits with configurable position and budget controls.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Live mode can place irreversible real-money Polymarket trades.\n\nMitigation: Start in dry run, use conservative position and daily-budget settings, and enable live mode only after reviewing the strategy and account risk.\n\nRisk: Exporting WALLET_PRIVATE_KEY increases wallet custody exposure.\n\nMitigation: Avoid setting WALLET_PRIVATE_KEY unless external-wallet live trading is required; prefer managed-wallet or dry-run operation where appropriate.\n\nRisk: Cron or looped execution can automate repeated trading decisions.\n\nMitigation: Review cron schedules and run monitor-only or dry-run checks before enabling unattended live execution.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/simmer/skills/polymarket-btc-up-down-trader)\n- [Skill instructions](artifact/SKILL.md)\n- [Disclaimer](artifact/DISCLAIMER.md)\n- [Changelog](artifact/CHANGELOG.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with inline shell commands and Python strategy execution output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May place live Polymarket trades only when explicitly run with live-trading configuration.]\n\n## Skill Version(s):\n\n1.2.5 (source: server release evidence, frontmatter, and changelog)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.2.5:clawhub.json\n\n{\n  \"emoji\": \"🪙\",\n  \"primaryEnv\": \"SIMMER_API_KEY\",\n  \"requires\": {\n    \"env\": [\n      \"SIMMER_API_KEY\"\n    ],\n    \"pip\": [\n      \"simmer-sdk>=0.25.8\"\n    ]\n  },\n  \"envVars\": [\n    {\n      \"name\": \"SIMMER_API_KEY\",\n      \"required\": true,\n      \"description\": \"Your Simmer SDK API key — get from simmer.markets/dashboard\"\n    },\n    {\n      \"name\": \"WALLET_PRIVATE_KEY\",\n      \"required\": false,\n      \"description\": \"Only needed for external-wallet self-custody trading. Not required when using managed wallets.\"\n    }\n  ],\n  \"cron\": null,\n  \"autostart\": false,\n  \"automaton\": {\n    \"managed\": true,\n    \"entrypoint\": \"strategy.py\"\n  },\n  \"tunables\": [\n    {\n      \"env\": \"SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS\",\n      \"type\": \"number\",\n      \"default\": 1.0,\n      \"range\": [0, 6],\n      \"step\": 0.5,\n      \"label\": \"Exit before resolution (hours)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER\",\n      \"type\": \"number\",\n      \"default\": 3.0,\n      \"range\": [0, 10],\n      \"step\": 0.5,\n      \"label\": \"Volume spike exit multiplier (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT\",\n      \"type\": \"number\",\n      \"default\": 0.85,\n      \"range\": [0, 1.0],\n      \"step\": 0.05,\n      \"label\": \"Target capture % exit (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MAX_POSITION_USD\",\n      \"type\": \"number\",\n      \"default\": 10,\n      \"range\": [1, 100],\n      \"step\": 5,\n      \"label\": \"Max position size (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_DAILY_BUDGET_USD\",\n      \"type\": \"number\",\n      \"default\": 50,\n      \"range\": [10, 500],\n      \"step\": 10,\n      \"label\": \"Daily budget (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_ENTRY_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.05,\n      \"range\": [0.01, 0.3],\n      \"step\": 0.01,\n      \"label\": \"Entry edge threshold (min divergence from 50¢)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MOMENTUM_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.3,\n      \"range\": [0.1, 2.0],\n      \"step\": 0.1,\n      \"label\": \"Minimum BTC momentum % to trigger entry\"\n    }\n  ]\n}\n\nArchive v1.2.3: 10 files, 32902 bytes\n\nFiles: CHANGELOG.md (2983b), clawhub.json (2098b), DISCLAIMER.md (1925b), skill-card.md (2609b), SKILL.md (11507b), strategy.py (46265b), tests/__init__.py (0b), tests/test_exits.py (21649b), tests/test_replay_plane.py (18817b), _meta.json (148b)\n\nFile v1.2.3:SKILL.md\n\n---\nname: polymarket-btc-up-down-trader\ndescription: Trade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. Enters on CEX momentum divergence; exits automatically on time cap, volume spike, or target capture. Use when the user wants to trade BTC direction markets (hours/days duration), not fast 5-minute markets.\nmetadata:\n  author: Simmer (@simmer_markets)\n  version: \"1.2.3\"\n  displayName: Polymarket BTC Up-Down Trader\n  difficulty: intermediate\n---\n# Polymarket BTC Up-Down Trader\n\nTrade Polymarket's BTC daily and weekly UP/DOWN markets with built-in exit discipline. Enters on Binance momentum signals, exits automatically before resolution tail risk bites.\n\n> 🚨 **Framework, not a production trading system.** Read [DISCLAIMER.md](./DISCLAIMER.md) before connecting to a wallet with real funds.\n\n> **Polymarket only.** All trades execute on Polymarket with real USDC. Use `--live` for real trades; default is dry run.\n\n> **Not for fast (5m/15m) markets.** Use `polymarket-fast-loop` for those. This skill targets daily and weekly BTC direction markets with hours-to-days of duration.\n\n## What's New in v1.2.3\n\n- **Removed the \"Oracle-Engineering Halt Gate\" section.** This skill never called that detector, and it does not trade the ≤5-minute markets the gate targets. No code change.\n\n## What's New in v1.2.2\n\n- **Live NO entry is YES-scale.** `avg_cost` is the held-side price. A NO bought at 0.30 now stores entry 0.70 so `target_hit` can fire. Replay rows have no `avg_cost` and were already correct.\n\n## What's New in v1.2.1\n\n- **Exit monitor reads real `Position` objects.** `client.get_positions()` returns dataclasses, not dicts. Replay rows have shares + `cost_basis` only. Side, size, and YES-scale entry are derived. A missing `sources` list under replay is this skill.\n\n## What's New in v1.2.0\n\n- **Replay plane (SIM-5442).** Under `simmer backtest` (`SIMMER_REPLAY=1`) discovery, prices, and the clock come from the existing replay harness — same `SIMMER_REPLAY` / `SIMMER_REPLAY_NOW` pattern as weather. Live Gamma and CLOB midpoint stay dark. Candles were already replay-safe. The exit monitor reads SDK `Position` objects and replay share-rows (no `.get` crash after the first fill).\n- **Keep / kill / fix** for this path is in Troubleshooting. Do not add a second capital lane until a full-tape run can produce an honest KEEP or KILL.\n\n> ⚠️ **BTC UP/DOWN markets carry Polymarket's crypto taker fee.** Effective rate is 3.5% at 50¢, up to ~6.6% on cheap shares. Makers pay 0% and earn a 20% rebate from collected taker fees. Factor this into your minimum edge threshold.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Trade BTC daily or weekly UP/DOWN prediction markets on Polymarket\n- Apply systematic exit discipline (don't hold to settlement)\n- Use CEX price momentum as the entry signal\n- Monitor open positions and auto-exit when targets are hit\n\n## Setup Flow\n\n1. **Install the Simmer SDK**\n   ```bash\n   pip install simmer-sdk\n   ```\n\n2. **Set your API key**\n   - Get from simmer.markets/dashboard → SDK tab\n   - `export SIMMER_API_KEY=\"your-key-here\"`\n\n3. **Set wallet private key** (required for live trading)\n   - `export WALLET_PRIVATE_KEY=\"0x...\"`\n   - Not needed for dry-run or managed wallets.\n\n4. **Configure exit discipline** (optional — defaults are well-tuned)\n   ```bash\n   python strategy.py --config\n   ```\n\n## Quick Start\n\n```bash\n# Dry run — see what would happen\npython strategy.py\n\n# Go live\npython strategy.py --live\n\n# Monitor-only (check exits without new entries)\npython strategy.py --live --monitor\n\n# Quiet mode for cron\npython strategy.py --live --quiet\n```\n\n## How to Run on a Loop\n\n**Linux crontab:**\n```\n# Every 30 minutes\n*/30 * * * * cd /path/to/skill && python strategy.py --live --quiet\n```\n\n**OpenClaw native cron:**\n```bash\nopenclaw cron add \\\n  --name \"BTC Up-Down Trader\" \\\n  --cron \"*/30 * * * *\" \\\n  --session isolated \\\n  --message \"Run BTC up-down trader: cd /path/to/skill && python strategy.py --live --quiet\"\n```\n\n## Configuration\n\nAll settings configurable via `config.json`, environment variables, or `--set`:\n\n```bash\npython strategy.py --set exit_before_resolution_hours=2.0\npython strategy.py --set volume_spike_exit_multiplier=4.0\npython strategy.py --set target_hit_capture_pct=0.75\n```\n\n### Exit Discipline Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `exit_before_resolution_hours` | `1.0` | `SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS` | Close position this many hours before scheduled resolution. Disable with `0`. |\n| `volume_spike_exit_multiplier` | `3.0` | `SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER` | Exit when 10-minute CLOB volume hits N× the rolling baseline. Disable with `0`. |\n| `target_hit_capture_pct` | `0.85` | `SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT` | Exit when position has captured 85% of the theoretical max gain. Disable with `0`. |\n| `volume_baseline_windows` | `6` | `SIMMER_BTCUD_VOLUME_BASELINE_WINDOWS` | Number of prior 10-minute windows used to compute volume baseline. |\n\n**Why these defaults?** Exit behavior on short-dated prediction markets skews heavily toward early exits — the final hours before resolution compress remaining upside while tail risk (last-minute reversals, oracle variance) stays constant. The defaults are calibrated to exit early while capturing the bulk of the move. Empirical work on short-dated crypto UP/DOWN exit patterns informed the calibration; adjust based on your own backtest results.\n\n### Entry Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `entry_threshold` | `0.05` | `SIMMER_BTCUD_ENTRY_THRESHOLD` | Min discount from 50¢ toward the momentum-opposing side. Entry only fires when the market *disagrees* with momentum: UP signal requires YES < 0.50 (edge = `0.50 − YES`); DOWN signal requires YES > 0.50 (edge = `YES − 0.50`). Skips when market already agrees with momentum. |\n| `min_momentum_pct` | `0.3` | `SIMMER_BTCUD_MOMENTUM_THRESHOLD` | Min BTC % move (30-min lookback) to trigger |\n| `max_position` | `10.0` | `SIMMER_BTCUD_MAX_POSITION_USD` | Max $ per trade |\n| `daily_budget` | `50.0` | `SIMMER_BTCUD_DAILY_BUDGET_USD` | Max total entry spend per UTC day |\n| `lookback_minutes` | `30` | `SIMMER_BTCUD_LOOKBACK_MINUTES` | Lookback window for BTC momentum signal |\n| `min_hours_to_resolution` | `4.0` | `SIMMER_BTCUD_MIN_HOURS_TO_RESOLUTION` | Skip entry if market resolves in fewer than N hours |\n\n### Example config.json\n\n```json\n{\n  \"exit_before_resolution_hours\": 1.0,\n  \"volume_spike_exit_multiplier\": 3.0,\n  \"target_hit_capture_pct\": 0.85,\n  \"entry_threshold\": 0.05,\n  \"min_momentum_pct\": 0.3,\n  \"max_position\": 10.0,\n  \"daily_budget\": 50.0\n}\n```\n\n## Exit Logic\n\nEach run cycle evaluates open positions against three triggers, in priority order:\n\n### 1. `time_cap` — Time-based exit\nCloses position when the market is within `exit_before_resolution_hours` of resolution.\n\n```\nhours_to_resolution ≤ exit_before_resolution_hours → EXIT (time_cap)\n```\n\nThis is the hard floor. Holding to settlement adds tail risk (oracle variance, thin liquidity, last-minute manipulation) with little remaining upside on a near-resolved market.\n\n### 2. `target_hit` — Profit capture exit\nCloses position when it has captured `target_hit_capture_pct` of the theoretical maximum gain.\n\n```\nYES positions: (current_price - entry_price) / (1.0 - entry_price) ≥ 0.85 → EXIT (target_hit)\nNO positions:  (entry_price - current_price) / entry_price ≥ 0.85 → EXIT (target_hit)\n```\n\nExample: Bought YES at $0.40. Maximum gain = 1.0 - 0.40 = $0.60/share. At $0.91, captured = (0.91 - 0.40) / 0.60 = 85% → exit.\n\n### 3. `volume_spike` — Smart-money volume exit\nCloses position when 10-minute CLOB volume exceeds `volume_spike_exit_multiplier`× the rolling baseline.\n\n```\ncurrent_10m_volume / avg_baseline_volume ≥ 3.0 → EXIT (volume_spike)\n```\n\nA sudden surge in volume near resolution typically signals that informed traders have positioned ahead of outcome certainty. Exiting into the spike captures the liquidity premium.\n\n## Exit Reasons\n\nEvery exit logs one of four reasons:\n\n| Reason | Trigger |\n|--------|---------|\n| `time_cap` | Hours to resolution ≤ `exit_before_resolution_hours` |\n| `target_hit` | Captured ≥ `target_hit_capture_pct` of max gain |\n| `volume_spike` | 10m volume ≥ `volume_spike_exit_multiplier` × baseline |\n| `manual` | User-initiated close via dashboard or SDK |\n\n## CLI Reference\n\n```bash\npython strategy.py                      # Dry run (show positions + opportunities)\npython strategy.py --live               # Execute real trades\npython strategy.py --monitor            # Only run exit checks (no new entries)\npython strategy.py --positions          # Show open positions\npython strategy.py --config             # Show current config\npython strategy.py --set KEY=VALUE      # Update config\npython strategy.py --quiet              # Only output on trades/errors\n```\n\n## Source Tagging\n\nAll trades are tagged `source: \"sdk:btcupdown\"`. This keeps BTC UP/DOWN P&L separate from other strategies in your Simmer portfolio.\n\n## Troubleshooting\n\n### Replay KEEP / KILL (SIM-5442)\n\nReuse `simmer backtest` / `SIMMER_REPLAY=1`. Do not invent a second harness. Pinned path check:\n\n```bash\npython -m pytest skills/polymarket-btc-up-down-trader/tests/test_replay_plane.py -q\n```\n\n| Verdict | What it means |\n|---------|----------------|\n| **FIX** | Path is broken or the tape cannot evaluate the skill. Do not add capital. Repair: live Gamma / CLOB under replay (look-ahead); wall-clock horizon dropping historical dailies; `yes_price` ignored; listing 422 from `tags`/`status`; failed fills burning daily spend; exit monitor crashing on `Position` (no `.get`); replay positions dropped for missing `source`; 0 BTC Up/Down rows on the slice (`--q \"bitcoin up or down\"`, lower `--min-volume`). |\n| **KILL** | Pinned pytest fails, **or** a full-tape run has evals > 0 and the skill still cannot reach `trade()` on a tape daily, **or** P&L after costs is clearly ≤ 0 on honest (not live-Gamma) prices. No second-lane capital. |\n| **KEEP** | Full-tape `simmer backtest` with evals > 0 **and** trades > 0 on tape prices and `SIMMER_REPLAY_NOW`. Pinned unit tests are a path check only — not KEEP. |\n\n**\"No active BTC UP/DOWN markets found\"**\n- Live: Gamma API may be slow or markets may not be trading. Try again in a few minutes.\n- Replay: the skill lists from the tape with `q=bitcoin up or down`. A high-volume slice with 0 Up/Down dailies is FIX, not \"no edge\".\n- Check polymarket.com directly for active BTC UP/DOWN markets.\n\n**\"Could not fetch BTC momentum\"**\n- Binance API rate-limited. Increase `lookback_minutes` or wait.\n\n**\"Momentum X% < minimum Y%\"**\n- Signal not strong enough. Entry threshold working correctly. Adjust `min_momentum_pct` if too conservative.\n\n**Volume spike trigger not firing**\n- Default baseline needs 6 prior 10-minute windows of data. In low-volume markets, set `volume_baseline_windows` lower or increase `volume_spike_exit_multiplier`.\n\n**\"External wallet requires a pre-signed order\"**\n- `WALLET_PRIVATE_KEY` is not set. Export the private key for your Polymarket wallet.\n- The SDK handles all signing automatically once the env var is set.\n\n**\"Balance shows $0 but I have funds on Polygon\"**\n- Polymarket V2 uses pUSD (PolyUSD). Migrate at simmer.markets/dashboard (one click, ~30s).\n\nFile v1.2.3:_meta.json\n\n{\n  \"ownerId\": \"kn7axnp7bzqsf5fkx0z8px7han7zyq1x\",\n  \"slug\": \"polymarket-btc-up-down-trader\",\n  \"version\": \"1.2.3\",\n  \"publishedAt\": 1789615777906\n}\n\nFile v1.2.3:CHANGELOG.md\n\n# Changelog — polymarket-btc-up-down-trader\n\n## [1.2.3] - 2026-09-17\n\n### Fixed\n- **SKILL.md no longer claims an oracle-engineering halt gate.** The section said `simmer_sdk.risk.OracleEngineeringDetector` was built in and enabled by default. No code in this skill calls it, the skill skips the ≤5-minute markets the gate covers, and it has no market-maker or copytrade mode. ClawHub's scan flagged the claim. Docs only; `strategy.py` behaviour is unchanged.\n\n## [1.2.2] - 2026-09-16\n\n### Fixed\n- **Live NO `avg_cost` is held-side, not YES-scale (SIM-5442 F4).** `_normalize_open_position` preferred `avg_cost` over the `cost_basis` derivation. A NO bought at 0.30 (YES 0.70) stored `entry_price=0.30`, so `check_target_hit_exit` never fired when YES fell. Replay rows omit `avg_cost`, so a backtest looked right. Entry now comes from `cost_basis / shares` (NO: `1 - avg`). `avg_cost` is last-resort and is flipped for NO.\n\n## [1.2.1] - 2026-09-16\n\n### Fixed\n- **Exit monitor no longer crashes on SDK `Position` (SIM-5442 hold-merge).** `get_open_positions` used `p.get(\"source\")` on a dataclass. That `AttributeError` killed every tick after the first fill. The skill now reads Position attributes. Replay share-rows (`market_id`, `shares_yes`/`shares_no`, `cost_basis`, no `source`) normalize to side, size, and YES-scale entry (`cost_basis/shares`; NO is `1 - cost_basis/shares_no`). Missing `sources` under replay is this skill.\n\n## [1.2.0] - 2026-09-16\n\n### Added\n- **Replay plane for markets + prices + clock (SIM-5442).** Under `SIMMER_REPLAY=1` the skill lists BTC Up/Down dailies from the Simmer tape (`GET /api/sdk/markets?q=bitcoin up or down`, no `tags`/`status` — those 422 on replay). Horizon uses `SIMMER_REPLAY_NOW`. Prices come from tape `yes_price` / `current_probability`. Live Gamma and CLOB midpoint stay dark. Volume-spike exits are live-only (CLOB trades would be look-ahead). Replay trades pass `skip_preflight=True` so `WALLET_UNVERIFIED` cannot block SimState fills.\n\n### Fixed\n- Failed `trade()` results no longer increment `daily_spend.json`. A miss must not burn the UTC-day budget.\n- Discovery no longer look-aheads to today's live \"Bitcoin Up or Down on …?\" row while a full tape of historical dailies sits unused.\n- **Exit monitor accepts SDK `Position` objects and replay share-rows.** `get_positions()` returns dataclasses (`shares_yes` / `shares_no` / `cost_basis` / `sources`), not dicts. Calling `p.get(\"source\")` crashed after the first fill and killed every later tick. Replay rows have no `source`/`side`/`quantity`/`entry_price` — side and size come from shares; YES-scale entry is `cost_basis/shares` (NO: `1 - cost_basis/shares_no`). Under replay a missing `sources` list is this skill (the session only runs it).\n- Unparseable `SIMMER_REPLAY_NOW` now raises `ReplayClockError` instead of falling through to wall clock (look-ahead).\n- Replay listing `q` is `bitcoin up or down` so ETH/SOL/hourly rows do not burn the eval budget.\n\nFile v1.2.3:DISCLAIMER.md\n\n# Disclaimer\n\nThis skill is a **framework**, not a production trading system. Read this\nin full before connecting it to a wallet with real funds.\n\n## No financial advice\n\nNothing in this skill constitutes financial, investment, or trading\nadvice. The default strategy implemented here is a starting point, not a\ntested edge. Suitability for any account size or risk tolerance is your\nresponsibility to assess.\n\n## Default parameters are not validated\n\nDefault parameters are calibrated for testing the plumbing, not for live\nprofit. They have not been validated to produce positive returns under\ncurrent market conditions. Run paper mode for an extended period before\nscaling beyond default position sizes.\n\n## Automated trading carries irreversible risk\n\nWhen this skill runs with `--live`, it places real on-chain orders.\nOn-chain trades cannot be recalled. Strategy errors, signal lag, market\nregime shifts, and operator misconfiguration can produce losses\nexceeding any specific position size.\n\n## Risk monitoring may not apply to all market types\n\nStop-loss and take-profit monitors run on a fixed schedule. Markets that\nresolve faster than the monitor cycle cannot be exited automatically.\nPosition sizing is the only risk control on these markets — set it\nconservatively.\n\n## Use of this skill is at your own risk\n\nBy installing and running this skill you agree that the authors are not\nliable for any losses, direct or indirect, that arise from its use. This\napplies regardless of skill provenance — official Simmer skills,\ncommunity skills, and skills imported from external repositories all\ncarry this same disclaimer.\n\n## Where to learn more before going live\n\n- The skill's own `SKILL.md` documents the strategy and parameters\n- Your trading venue's documentation covers fee structure, order types,\n  and resolution rules\n- Simmer SDK documentation covers paper mode, dry-run flags, and\n  position monitoring\n\nFile v1.2.3:skill-card.md\n\n## Description:\n\nTrades Polymarket BTC daily and weekly UP/DOWN markets using CEX momentum divergence and exits automatically on configured time-cap, volume-spike, or target-capture rules.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[simmer](https://clawhub.ai/user/simmer)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal traders and agent operators use this skill to evaluate and optionally run a dry-run or live Polymarket BTC daily/weekly UP/DOWN trading workflow with configurable entry, budget, and exit discipline.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Live execution can place real Polymarket trades with irreversible financial loss.\n\nMitigation: Start in dry-run mode, keep max position and daily budget low, and do not enable --live or cron until the operator understands the trading risk.\n\nRisk: Providing WALLET_PRIVATE_KEY can expose self-custody signing authority if the key is mishandled.\n\nMitigation: Avoid setting WALLET_PRIVATE_KEY unless self-custody signing is required, and protect the key using the operator's normal secret-management controls.\n\nRisk: Default parameters are not evidence of a profitable live trading edge.\n\nMitigation: Run paper or dry-run evaluation before scaling position sizes, and tune budgets and thresholds based on the operator's own testing.\n\nRisk: Exit monitoring may not protect markets that resolve faster than the monitor cycle.\n\nMitigation: Use the skill for the documented daily and weekly BTC UP/DOWN markets, avoid fast-duration markets, and size positions conservatively.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/simmer/skills/polymarket-btc-up-down-trader)\n- [Publisher Profile](https://clawhub.ai/user/simmer)\n- [Skill Documentation](artifact/SKILL.md)\n- [Disclaimer](artifact/DISCLAIMER.md)\n- [Changelog](artifact/CHANGELOG.md)\n\n## Skill Output:\n\n**Output Type(s):** [Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown with inline shell commands and configuration examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May guide dry-run execution, live execution, scheduled monitoring, and environment-variable configuration.]\n\n## Skill Version(s):\n\n1.2.3 (source: server release evidence, frontmatter, changelog released 2026-09-17)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.2.3:clawhub.json\n\n{\n  \"emoji\": \"🪙\",\n  \"primaryEnv\": \"SIMMER_API_KEY\",\n  \"requires\": {\n    \"env\": [\n      \"SIMMER_API_KEY\"\n    ],\n    \"pip\": [\n      \"simmer-sdk>=0.17.32\"\n    ]\n  },\n  \"envVars\": [\n    {\n      \"name\": \"SIMMER_API_KEY\",\n      \"required\": true,\n      \"description\": \"Your Simmer SDK API key — get from simmer.markets/dashboard\"\n    },\n    {\n      \"name\": \"WALLET_PRIVATE_KEY\",\n      \"required\": false,\n      \"description\": \"Only needed for external-wallet self-custody trading. Not required when using managed wallets.\"\n    }\n  ],\n  \"cron\": null,\n  \"autostart\": false,\n  \"automaton\": {\n    \"managed\": true,\n    \"entrypoint\": \"strategy.py\"\n  },\n  \"tunables\": [\n    {\n      \"env\": \"SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS\",\n      \"type\": \"number\",\n      \"default\": 1.0,\n      \"range\": [0, 6],\n      \"step\": 0.5,\n      \"label\": \"Exit before resolution (hours)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER\",\n      \"type\": \"number\",\n      \"default\": 3.0,\n      \"range\": [0, 10],\n      \"step\": 0.5,\n      \"label\": \"Volume spike exit multiplier (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT\",\n      \"type\": \"number\",\n      \"default\": 0.85,\n      \"range\": [0, 1.0],\n      \"step\": 0.05,\n      \"label\": \"Target capture % exit (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MAX_POSITION_USD\",\n      \"type\": \"number\",\n      \"default\": 10,\n      \"range\": [1, 100],\n      \"step\": 5,\n      \"label\": \"Max position size (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_DAILY_BUDGET_USD\",\n      \"type\": \"number\",\n      \"default\": 50,\n      \"range\": [10, 500],\n      \"step\": 10,\n      \"label\": \"Daily budget (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_ENTRY_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.05,\n      \"range\": [0.01, 0.3],\n      \"step\": 0.01,\n      \"label\": \"Entry edge threshold (min divergence from 50¢)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MOMENTUM_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.3,\n      \"range\": [0.1, 2.0],\n      \"step\": 0.1,\n      \"label\": \"Minimum BTC momentum % to trigger entry\"\n    }\n  ]\n}\n\nArchive v1.2.2: 10 files, 33108 bytes\n\nFiles: CHANGELOG.md (2566b), clawhub.json (2098b), DISCLAIMER.md (1925b), skill-card.md (2662b), SKILL.md (12384b), strategy.py (46265b), tests/__init__.py (0b), tests/test_exits.py (21649b), tests/test_replay_plane.py (18817b), _meta.json (148b)\n\nFile v1.2.2:SKILL.md\n\n---\nname: polymarket-btc-up-down-trader\ndescription: Trade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. Enters on CEX momentum divergence; exits automatically on time cap, volume spike, or target capture. Use when the user wants to trade BTC direction markets (hours/days duration), not fast 5-minute markets.\nmetadata:\n  author: Simmer (@simmer_markets)\n  version: \"1.2.2\"\n  displayName: Polymarket BTC Up-Down Trader\n  difficulty: intermediate\n---\n# Polymarket BTC Up-Down Trader\n\nTrade Polymarket's BTC daily and weekly UP/DOWN markets with built-in exit discipline. Enters on Binance momentum signals, exits automatically before resolution tail risk bites.\n\n> 🚨 **Framework, not a production trading system.** Read [DISCLAIMER.md](./DISCLAIMER.md) before connecting to a wallet with real funds.\n\n> **Polymarket only.** All trades execute on Polymarket with real USDC. Use `--live` for real trades; default is dry run.\n\n> **Not for fast (5m/15m) markets.** Use `polymarket-fast-loop` for those. This skill targets daily and weekly BTC direction markets with hours-to-days of duration.\n\n## What's New in v1.2.2\n\n- **Live NO entry is YES-scale.** `avg_cost` is the held-side price. A NO bought at 0.30 now stores entry 0.70 so `target_hit` can fire. Replay rows have no `avg_cost` and were already correct.\n\n## What's New in v1.2.1\n\n- **Exit monitor reads real `Position` objects.** `client.get_positions()` returns dataclasses, not dicts. Replay rows have shares + `cost_basis` only. Side, size, and YES-scale entry are derived. A missing `sources` list under replay is this skill.\n\n## What's New in v1.2.0\n\n- **Replay plane (SIM-5442).** Under `simmer backtest` (`SIMMER_REPLAY=1`) discovery, prices, and the clock come from the existing replay harness — same `SIMMER_REPLAY` / `SIMMER_REPLAY_NOW` pattern as weather. Live Gamma and CLOB midpoint stay dark. Candles were already replay-safe. The exit monitor reads SDK `Position` objects and replay share-rows (no `.get` crash after the first fill).\n- **Keep / kill / fix** for this path is in Troubleshooting. Do not add a second capital lane until a full-tape run can produce an honest KEEP or KILL.\n\n> ⚠️ **BTC UP/DOWN markets carry Polymarket's crypto taker fee.** Effective rate is 3.5% at 50¢, up to ~6.6% on cheap shares. Makers pay 0% and earn a 20% rebate from collected taker fees. Factor this into your minimum edge threshold.\n\n## Oracle-Engineering Halt Gate\n\nThis skill includes a built-in **oracle-engineering risk detector** (`simmer_sdk.risk.OracleEngineeringDetector`). It is **enabled by default** for all short-dated markets (≤ 5 minutes to resolution).\n\nThe gate fires a `RESOLUTION_TAMPER_RISK` halt when **both** signals diverge within the final 5 minutes of the resolution window:\n- **PM concentration** ≥ 60% of one side's open interest held by the top wallet(s)\n- **Spot flow imbalance** ≥ 2σ on the underlying (Binance BTC/USDC) in the *same* direction that benefits the concentrated PM position\n\nWhen the gate fires:\n- **Market-maker mode**: spreads widened ≥ 3×; no new fills accepted\n- **Copytrade mode**: trade skipped for this cycle\n- **All modes**: decision logged with `risk_flag=oracle_engineering`\n\nThis is a **defensive halt only**. Do not use it as a buy signal or to copy the attacker's position. See `simmer_sdk/risk/oracle_engineering.py` for the full detector implementation and `shared-knowledge/entities/concepts/oracle-engineering.md` for threat-model background.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Trade BTC daily or weekly UP/DOWN prediction markets on Polymarket\n- Apply systematic exit discipline (don't hold to settlement)\n- Use CEX price momentum as the entry signal\n- Monitor open positions and auto-exit when targets are hit\n\n## Setup Flow\n\n1. **Install the Simmer SDK**\n   ```bash\n   pip install simmer-sdk\n   ```\n\n2. **Set your API key**\n   - Get from simmer.markets/dashboard → SDK tab\n   - `export SIMMER_API_KEY=\"your-key-here\"`\n\n3. **Set wallet private key** (required for live trading)\n   - `export WALLET_PRIVATE_KEY=\"0x...\"`\n   - Not needed for dry-run or managed wallets.\n\n4. **Configure exit discipline** (optional — defaults are well-tuned)\n   ```bash\n   python strategy.py --config\n   ```\n\n## Quick Start\n\n```bash\n# Dry run — see what would happen\npython strategy.py\n\n# Go live\npython strategy.py --live\n\n# Monitor-only (check exits without new entries)\npython strategy.py --live --monitor\n\n# Quiet mode for cron\npython strategy.py --live --quiet\n```\n\n## How to Run on a Loop\n\n**Linux crontab:**\n```\n# Every 30 minutes\n*/30 * * * * cd /path/to/skill && python strategy.py --live --quiet\n```\n\n**OpenClaw native cron:**\n```bash\nopenclaw cron add \\\n  --name \"BTC Up-Down Trader\" \\\n  --cron \"*/30 * * * *\" \\\n  --session isolated \\\n  --message \"Run BTC up-down trader: cd /path/to/skill && python strategy.py --live --quiet\"\n```\n\n## Configuration\n\nAll settings configurable via `config.json`, environment variables, or `--set`:\n\n```bash\npython strategy.py --set exit_before_resolution_hours=2.0\npython strategy.py --set volume_spike_exit_multiplier=4.0\npython strategy.py --set target_hit_capture_pct=0.75\n```\n\n### Exit Discipline Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `exit_before_resolution_hours` | `1.0` | `SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS` | Close position this many hours before scheduled resolution. Disable with `0`. |\n| `volume_spike_exit_multiplier` | `3.0` | `SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER` | Exit when 10-minute CLOB volume hits N× the rolling baseline. Disable with `0`. |\n| `target_hit_capture_pct` | `0.85` | `SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT` | Exit when position has captured 85% of the theoretical max gain. Disable with `0`. |\n| `volume_baseline_windows` | `6` | `SIMMER_BTCUD_VOLUME_BASELINE_WINDOWS` | Number of prior 10-minute windows used to compute volume baseline. |\n\n**Why these defaults?** Exit behavior on short-dated prediction markets skews heavily toward early exits — the final hours before resolution compress remaining upside while tail risk (last-minute reversals, oracle variance) stays constant. The defaults are calibrated to exit early while capturing the bulk of the move. Empirical work on short-dated crypto UP/DOWN exit patterns informed the calibration; adjust based on your own backtest results.\n\n### Entry Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `entry_threshold` | `0.05` | `SIMMER_BTCUD_ENTRY_THRESHOLD` | Min discount from 50¢ toward the momentum-opposing side. Entry only fires when the market *disagrees* with momentum: UP signal requires YES < 0.50 (edge = `0.50 − YES`); DOWN signal requires YES > 0.50 (edge = `YES − 0.50`). Skips when market already agrees with momentum. |\n| `min_momentum_pct` | `0.3` | `SIMMER_BTCUD_MOMENTUM_THRESHOLD` | Min BTC % move (30-min lookback) to trigger |\n| `max_position` | `10.0` | `SIMMER_BTCUD_MAX_POSITION_USD` | Max $ per trade |\n| `daily_budget` | `50.0` | `SIMMER_BTCUD_DAILY_BUDGET_USD` | Max total entry spend per UTC day |\n| `lookback_minutes` | `30` | `SIMMER_BTCUD_LOOKBACK_MINUTES` | Lookback window for BTC momentum signal |\n| `min_hours_to_resolution` | `4.0` | `SIMMER_BTCUD_MIN_HOURS_TO_RESOLUTION` | Skip entry if market resolves in fewer than N hours |\n\n### Example config.json\n\n```json\n{\n  \"exit_before_resolution_hours\": 1.0,\n  \"volume_spike_exit_multiplier\": 3.0,\n  \"target_hit_capture_pct\": 0.85,\n  \"entry_threshold\": 0.05,\n  \"min_momentum_pct\": 0.3,\n  \"max_position\": 10.0,\n  \"daily_budget\": 50.0\n}\n```\n\n## Exit Logic\n\nEach run cycle evaluates open positions against three triggers, in priority order:\n\n### 1. `time_cap` — Time-based exit\nCloses position when the market is within `exit_before_resolution_hours` of resolution.\n\n```\nhours_to_resolution ≤ exit_before_resolution_hours → EXIT (time_cap)\n```\n\nThis is the hard floor. Holding to settlement adds tail risk (oracle variance, thin liquidity, last-minute manipulation) with little remaining upside on a near-resolved market.\n\n### 2. `target_hit` — Profit capture exit\nCloses position when it has captured `target_hit_capture_pct` of the theoretical maximum gain.\n\n```\nYES positions: (current_price - entry_price) / (1.0 - entry_price) ≥ 0.85 → EXIT (target_hit)\nNO positions:  (entry_price - current_price) / entry_price ≥ 0.85 → EXIT (target_hit)\n```\n\nExample: Bought YES at $0.40. Maximum gain = 1.0 - 0.40 = $0.60/share. At $0.91, captured = (0.91 - 0.40) / 0.60 = 85% → exit.\n\n### 3. `volume_spike` — Smart-money volume exit\nCloses position when 10-minute CLOB volume exceeds `volume_spike_exit_multiplier`× the rolling baseline.\n\n```\ncurrent_10m_volume / avg_baseline_volume ≥ 3.0 → EXIT (volume_spike)\n```\n\nA sudden surge in volume near resolution typically signals that informed traders have positioned ahead of outcome certainty. Exiting into the spike captures the liquidity premium.\n\n## Exit Reasons\n\nEvery exit logs one of four reasons:\n\n| Reason | Trigger |\n|--------|---------|\n| `time_cap` | Hours to resolution ≤ `exit_before_resolution_hours` |\n| `target_hit` | Captured ≥ `target_hit_capture_pct` of max gain |\n| `volume_spike` | 10m volume ≥ `volume_spike_exit_multiplier` × baseline |\n| `manual` | User-initiated close via dashboard or SDK |\n\n## CLI Reference\n\n```bash\npython strategy.py                      # Dry run (show positions + opportunities)\npython strategy.py --live               # Execute real trades\npython strategy.py --monitor            # Only run exit checks (no new entries)\npython strategy.py --positions          # Show open positions\npython strategy.py --config             # Show current config\npython strategy.py --set KEY=VALUE      # Update config\npython strategy.py --quiet              # Only output on trades/errors\n```\n\n## Source Tagging\n\nAll trades are tagged `source: \"sdk:btcupdown\"`. This keeps BTC UP/DOWN P&L separate from other strategies in your Simmer portfolio.\n\n## Troubleshooting\n\n### Replay KEEP / KILL (SIM-5442)\n\nReuse `simmer backtest` / `SIMMER_REPLAY=1`. Do not invent a second harness. Pinned path check:\n\n```bash\npython -m pytest skills/polymarket-btc-up-down-trader/tests/test_replay_plane.py -q\n```\n\n| Verdict | What it means |\n|---------|----------------|\n| **FIX** | Path is broken or the tape cannot evaluate the skill. Do not add capital. Repair: live Gamma / CLOB under replay (look-ahead); wall-clock horizon dropping historical dailies; `yes_price` ignored; listing 422 from `tags`/`status`; failed fills burning daily spend; exit monitor crashing on `Position` (no `.get`); replay positions dropped for missing `source`; 0 BTC Up/Down rows on the slice (`--q \"bitcoin up or down\"`, lower `--min-volume`). |\n| **KILL** | Pinned pytest fails, **or** a full-tape run has evals > 0 and the skill still cannot reach `trade()` on a tape daily, **or** P&L after costs is clearly ≤ 0 on honest (not live-Gamma) prices. No second-lane capital. |\n| **KEEP** | Full-tape `simmer backtest` with evals > 0 **and** trades > 0 on tape prices and `SIMMER_REPLAY_NOW`. Pinned unit tests are a path check only — not KEEP. |\n\n**\"No active BTC UP/DOWN markets found\"**\n- Live: Gamma API may be slow or markets may not be trading. Try again in a few minutes.\n- Replay: the skill lists from the tape with `q=bitcoin up or down`. A high-volume slice with 0 Up/Down dailies is FIX, not \"no edge\".\n- Check polymarket.com directly for active BTC UP/DOWN markets.\n\n**\"Could not fetch BTC momentum\"**\n- Binance API rate-limited. Increase `lookback_minutes` or wait.\n\n**\"Momentum X% < minimum Y%\"**\n- Signal not strong enough. Entry threshold working correctly. Adjust `min_momentum_pct` if too conservative.\n\n**Volume spike trigger not firing**\n- Default baseline needs 6 prior 10-minute windows of data. In low-volume markets, set `volume_baseline_windows` lower or increase `volume_spike_exit_multiplier`.\n\n**\"External wallet requires a pre-signed order\"**\n- `WALLET_PRIVATE_KEY` is not set. Export the private key for your Polymarket wallet.\n- The SDK handles all signing automatically once the env var is set.\n\n**\"Balance shows $0 but I have funds on Polygon\"**\n- Polymarket V2 uses pUSD (PolyUSD). Migrate at simmer.markets/dashboard (one click, ~30s).\n\nFile v1.2.2:_meta.json\n\n{\n  \"ownerId\": \"kn7axnp7bzqsf5fkx0z8px7han7zyq1x\",\n  \"slug\": \"polymarket-btc-up-down-trader\",\n  \"version\": \"1.2.2\",\n  \"publishedAt\": 1789553696781\n}\n\nFile v1.2.2:CHANGELOG.md\n\n# Changelog — polymarket-btc-up-down-trader\n\n## [1.2.2] - 2026-09-16\n\n### Fixed\n- **Live NO `avg_cost` is held-side, not YES-scale (SIM-5442 F4).** `_normalize_open_position` preferred `avg_cost` over the `cost_basis` derivation. A NO bought at 0.30 (YES 0.70) stored `entry_price=0.30`, so `check_target_hit_exit` never fired when YES fell. Replay rows omit `avg_cost`, so a backtest looked right. Entry now comes from `cost_basis / shares` (NO: `1 - avg`). `avg_cost` is last-resort and is flipped for NO.\n\n## [1.2.1] - 2026-09-16\n\n### Fixed\n- **Exit monitor no longer crashes on SDK `Position` (SIM-5442 hold-merge).** `get_open_positions` used `p.get(\"source\")` on a dataclass. That `AttributeError` killed every tick after the first fill. The skill now reads Position attributes. Replay share-rows (`market_id`, `shares_yes`/`shares_no`, `cost_basis`, no `source`) normalize to side, size, and YES-scale entry (`cost_basis/shares`; NO is `1 - cost_basis/shares_no`). Missing `sources` under replay is this skill.\n\n## [1.2.0] - 2026-09-16\n\n### Added\n- **Replay plane for markets + prices + clock (SIM-5442).** Under `SIMMER_REPLAY=1` the skill lists BTC Up/Down dailies from the Simmer tape (`GET /api/sdk/markets?q=bitcoin up or down`, no `tags`/`status` — those 422 on replay). Horizon uses `SIMMER_REPLAY_NOW`. Prices come from tape `yes_price` / `current_probability`. Live Gamma and CLOB midpoint stay dark. Volume-spike exits are live-only (CLOB trades would be look-ahead). Replay trades pass `skip_preflight=True` so `WALLET_UNVERIFIED` cannot block SimState fills.\n\n### Fixed\n- Failed `trade()` results no longer increment `daily_spend.json`. A miss must not burn the UTC-day budget.\n- Discovery no longer look-aheads to today's live \"Bitcoin Up or Down on …?\" row while a full tape of historical dailies sits unused.\n- **Exit monitor accepts SDK `Position` objects and replay share-rows.** `get_positions()` returns dataclasses (`shares_yes` / `shares_no` / `cost_basis` / `sources`), not dicts. Calling `p.get(\"source\")` crashed after the first fill and killed every later tick. Replay rows have no `source`/`side`/`quantity`/`entry_price` — side and size come from shares; YES-scale entry is `cost_basis/shares` (NO: `1 - cost_basis/shares_no`). Under replay a missing `sources` list is this skill (the session only runs it).\n- Unparseable `SIMMER_REPLAY_NOW` now raises `ReplayClockError` instead of falling through to wall clock (look-ahead).\n- Replay listing `q` is `bitcoin up or down` so ETH/SOL/hourly rows do not burn the eval budget.\n\nFile v1.2.2:DISCLAIMER.md\n\n# Disclaimer\n\nThis skill is a **framework**, not a production trading system. Read this\nin full before connecting it to a wallet with real funds.\n\n## No financial advice\n\nNothing in this skill constitutes financial, investment, or trading\nadvice. The default strategy implemented here is a starting point, not a\ntested edge. Suitability for any account size or risk tolerance is your\nresponsibility to assess.\n\n## Default parameters are not validated\n\nDefault parameters are calibrated for testing the plumbing, not for live\nprofit. They have not been validated to produce positive returns under\ncurrent market conditions. Run paper mode for an extended period before\nscaling beyond default position sizes.\n\n## Automated trading carries irreversible risk\n\nWhen this skill runs with `--live`, it places real on-chain orders.\nOn-chain trades cannot be recalled. Strategy errors, signal lag, market\nregime shifts, and operator misconfiguration can produce losses\nexceeding any specific position size.\n\n## Risk monitoring may not apply to all market types\n\nStop-loss and take-profit monitors run on a fixed schedule. Markets that\nresolve faster than the monitor cycle cannot be exited automatically.\nPosition sizing is the only risk control on these markets — set it\nconservatively.\n\n## Use of this skill is at your own risk\n\nBy installing and running this skill you agree that the authors are not\nliable for any losses, direct or indirect, that arise from its use. This\napplies regardless of skill provenance — official Simmer skills,\ncommunity skills, and skills imported from external repositories all\ncarry this same disclaimer.\n\n## Where to learn more before going live\n\n- The skill's own `SKILL.md` documents the strategy and parameters\n- Your trading venue's documentation covers fee structure, order types,\n  and resolution rules\n- Simmer SDK documentation covers paper mode, dry-run flags, and\n  position monitoring\n\nFile v1.2.2:skill-card.md\n\n## Description:\n\nTrades Polymarket BTC daily and weekly UP/DOWN markets using Binance momentum signals with automated exits for time caps, volume spikes, or target capture.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[simmer](https://clawhub.ai/user/simmer)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users and trading operators use this skill to scan Polymarket BTC daily and weekly direction markets, manage position entries from momentum signals, and monitor exits before resolution. It is intended for dry-run, backtesting, and carefully limited live trading workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Live mode can place real Polymarket trades with API or wallet-key authority.\n\nMitigation: Run dry-run or backtesting first, use a managed or low-balance dedicated wallet, and set conservative trade and daily budget limits before enabling live mode.\n\nRisk: Credential exposure could broaden trading authority beyond the intended workflow.\n\nMitigation: Scope the Simmer API key tightly, avoid exposing a broad private key where possible, and prefer managed-wallet operation for live use.\n\nRisk: Dependency and configuration safeguards are under-scoped for automated live trading.\n\nMitigation: Pin and review the Simmer SDK dependency, verify all configured limits independently, and delay cron or live operation until those controls are confirmed.\n\nRisk: Fast-resolving markets may resolve before scheduled monitoring can exit a position.\n\nMitigation: Use the skill only for daily and weekly BTC UP/DOWN markets, avoid fast markets, and keep position sizing conservative.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/simmer/skills/polymarket-btc-up-down-trader)\n- [Simmer publisher profile](https://clawhub.ai/user/simmer)\n- [Skill documentation](artifact/SKILL.md)\n- [Disclaimer](artifact/DISCLAIMER.md)\n- [Changelog](artifact/CHANGELOG.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with inline shell commands and optional JSON status output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Dry run is the default; live trading requires explicit live mode and configured credentials.]\n\n## Skill Version(s):\n\n1.2.2 (source: frontmatter, changelog, server release)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.2.2:clawhub.json\n\n{\n  \"emoji\": \"🪙\",\n  \"primaryEnv\": \"SIMMER_API_KEY\",\n  \"requires\": {\n    \"env\": [\n      \"SIMMER_API_KEY\"\n    ],\n    \"pip\": [\n      \"simmer-sdk>=0.17.32\"\n    ]\n  },\n  \"envVars\": [\n    {\n      \"name\": \"SIMMER_API_KEY\",\n      \"required\": true,\n      \"description\": \"Your Simmer SDK API key — get from simmer.markets/dashboard\"\n    },\n    {\n      \"name\": \"WALLET_PRIVATE_KEY\",\n      \"required\": false,\n      \"description\": \"Only needed for external-wallet self-custody trading. Not required when using managed wallets.\"\n    }\n  ],\n  \"cron\": null,\n  \"autostart\": false,\n  \"automaton\": {\n    \"managed\": true,\n    \"entrypoint\": \"strategy.py\"\n  },\n  \"tunables\": [\n    {\n      \"env\": \"SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS\",\n      \"type\": \"number\",\n      \"default\": 1.0,\n      \"range\": [0, 6],\n      \"step\": 0.5,\n      \"label\": \"Exit before resolution (hours)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER\",\n      \"type\": \"number\",\n      \"default\": 3.0,\n      \"range\": [0, 10],\n      \"step\": 0.5,\n      \"label\": \"Volume spike exit multiplier (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT\",\n      \"type\": \"number\",\n      \"default\": 0.85,\n      \"range\": [0, 1.0],\n      \"step\": 0.05,\n      \"label\": \"Target capture % exit (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MAX_POSITION_USD\",\n      \"type\": \"number\",\n      \"default\": 10,\n      \"range\": [1, 100],\n      \"step\": 5,\n      \"label\": \"Max position size (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_DAILY_BUDGET_USD\",\n      \"type\": \"number\",\n      \"default\": 50,\n      \"range\": [10, 500],\n      \"step\": 10,\n      \"label\": \"Daily budget (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_ENTRY_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.05,\n      \"range\": [0.01, 0.3],\n      \"step\": 0.01,\n      \"label\": \"Entry edge threshold (min divergence from 50¢)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MOMENTUM_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.3,\n      \"range\": [0.1, 2.0],\n      \"step\": 0.1,\n      \"label\": \"Minimum BTC momentum % to trigger entry\"\n    }\n  ]\n}\n\nArchive v1.1.0: 8 files, 23315 bytes\n\nFiles: clawhub.json (2098b), DISCLAIMER.md (1925b), skill-card.md (2423b), SKILL.md (10026b), strategy.py (36837b), tests/__init__.py (0b), tests/test_exits.py (21649b), _meta.json (148b)\n\nFile v1.1.0:SKILL.md\n\n---\nname: polymarket-btc-up-down-trader\ndescription: Trade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. Enters on CEX momentum divergence; exits automatically on time cap, volume spike, or target capture. Use when the user wants to trade BTC direction markets (hours/days duration), not fast 5-minute markets.\nmetadata:\n  author: Simmer (@simmer_markets)\n  version: \"1.1.0\"\n  displayName: Polymarket BTC Up-Down Trader\n  difficulty: intermediate\n---\n# Polymarket BTC Up-Down Trader\n\nTrade Polymarket's BTC daily and weekly UP/DOWN markets with built-in exit discipline. Enters on Binance momentum signals, exits automatically before resolution tail risk bites.\n\n> 🚨 **Framework, not a production trading system.** Read [DISCLAIMER.md](./DISCLAIMER.md) before connecting to a wallet with real funds.\n\n> **Polymarket only.** All trades execute on Polymarket with real USDC. Use `--live` for real trades; default is dry run.\n\n> **Not for fast (5m/15m) markets.** Use `polymarket-fast-loop` for those. This skill targets daily and weekly BTC direction markets with hours-to-days of duration.\n\n> ⚠️ **BTC UP/DOWN markets carry Polymarket's crypto taker fee.** Effective rate is 3.5% at 50¢, up to ~6.6% on cheap shares. Makers pay 0% and earn a 20% rebate from collected taker fees. Factor this into your minimum edge threshold.\n\n## Oracle-Engineering Halt Gate\n\nThis skill includes a built-in **oracle-engineering risk detector** (`simmer_sdk.risk.OracleEngineeringDetector`). It is **enabled by default** for all short-dated markets (≤ 5 minutes to resolution).\n\nThe gate fires a `RESOLUTION_TAMPER_RISK` halt when **both** signals diverge within the final 5 minutes of the resolution window:\n- **PM concentration** ≥ 60% of one side's open interest held by the top wallet(s)\n- **Spot flow imbalance** ≥ 2σ on the underlying (Binance BTC/USDC) in the *same* direction that benefits the concentrated PM position\n\nWhen the gate fires:\n- **Market-maker mode**: spreads widened ≥ 3×; no new fills accepted\n- **Copytrade mode**: trade skipped for this cycle\n- **All modes**: decision logged with `risk_flag=oracle_engineering`\n\nThis is a **defensive halt only**. Do not use it as a buy signal or to copy the attacker's position. See `simmer_sdk/risk/oracle_engineering.py` for the full detector implementation and `shared-knowledge/entities/concepts/oracle-engineering.md` for threat-model background.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Trade BTC daily or weekly UP/DOWN prediction markets on Polymarket\n- Apply systematic exit discipline (don't hold to settlement)\n- Use CEX price momentum as the entry signal\n- Monitor open positions and auto-exit when targets are hit\n\n## Setup Flow\n\n1. **Install the Simmer SDK**\n   ```bash\n   pip install simmer-sdk\n   ```\n\n2. **Set your API key**\n   - Get from simmer.markets/dashboard → SDK tab\n   - `export SIMMER_API_KEY=\"your-key-here\"`\n\n3. **Set wallet private key** (required for live trading)\n   - `export WALLET_PRIVATE_KEY=\"0x...\"`\n   - Not needed for dry-run or managed wallets.\n\n4. **Configure exit discipline** (optional — defaults are well-tuned)\n   ```bash\n   python strategy.py --config\n   ```\n\n## Quick Start\n\n```bash\n# Dry run — see what would happen\npython strategy.py\n\n# Go live\npython strategy.py --live\n\n# Monitor-only (check exits without new entries)\npython strategy.py --live --monitor\n\n# Quiet mode for cron\npython strategy.py --live --quiet\n```\n\n## How to Run on a Loop\n\n**Linux crontab:**\n```\n# Every 30 minutes\n*/30 * * * * cd /path/to/skill && python strategy.py --live --quiet\n```\n\n**OpenClaw native cron:**\n```bash\nopenclaw cron add \\\n  --name \"BTC Up-Down Trader\" \\\n  --cron \"*/30 * * * *\" \\\n  --session isolated \\\n  --message \"Run BTC up-down trader: cd /path/to/skill && python strategy.py --live --quiet\"\n```\n\n## Configuration\n\nAll settings configurable via `config.json`, environment variables, or `--set`:\n\n```bash\npython strategy.py --set exit_before_resolution_hours=2.0\npython strategy.py --set volume_spike_exit_multiplier=4.0\npython strategy.py --set target_hit_capture_pct=0.75\n```\n\n### Exit Discipline Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `exit_before_resolution_hours` | `1.0` | `SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS` | Close position this many hours before scheduled resolution. Disable with `0`. |\n| `volume_spike_exit_multiplier` | `3.0` | `SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER` | Exit when 10-minute CLOB volume hits N× the rolling baseline. Disable with `0`. |\n| `target_hit_capture_pct` | `0.85` | `SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT` | Exit when position has captured 85% of the theoretical max gain. Disable with `0`. |\n| `volume_baseline_windows` | `6` | `SIMMER_BTCUD_VOLUME_BASELINE_WINDOWS` | Number of prior 10-minute windows used to compute volume baseline. |\n\n**Why these defaults?** Exit behavior on short-dated prediction markets skews heavily toward early exits — the final hours before resolution compress remaining upside while tail risk (last-minute reversals, oracle variance) stays constant. The defaults are calibrated to exit early while capturing the bulk of the move. Empirical work on short-dated crypto UP/DOWN exit patterns informed the calibration; adjust based on your own backtest results.\n\n### Entry Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `entry_threshold` | `0.05` | `SIMMER_BTCUD_ENTRY_THRESHOLD` | Min discount from 50¢ toward the momentum-opposing side. Entry only fires when the market *disagrees* with momentum: UP signal requires YES < 0.50 (edge = `0.50 − YES`); DOWN signal requires YES > 0.50 (edge = `YES − 0.50`). Skips when market already agrees with momentum. |\n| `min_momentum_pct` | `0.3` | `SIMMER_BTCUD_MOMENTUM_THRESHOLD` | Min BTC % move (30-min lookback) to trigger |\n| `max_position` | `10.0` | `SIMMER_BTCUD_MAX_POSITION_USD` | Max $ per trade |\n| `daily_budget` | `50.0` | `SIMMER_BTCUD_DAILY_BUDGET_USD` | Max total entry spend per UTC day |\n| `lookback_minutes` | `30` | `SIMMER_BTCUD_LOOKBACK_MINUTES` | Lookback window for BTC momentum signal |\n| `min_hours_to_resolution` | `4.0` | `SIMMER_BTCUD_MIN_HOURS_TO_RESOLUTION` | Skip entry if market resolves in fewer than N hours |\n\n### Example config.json\n\n```json\n{\n  \"exit_before_resolution_hours\": 1.0,\n  \"volume_spike_exit_multiplier\": 3.0,\n  \"target_hit_capture_pct\": 0.85,\n  \"entry_threshold\": 0.05,\n  \"min_momentum_pct\": 0.3,\n  \"max_position\": 10.0,\n  \"daily_budget\": 50.0\n}\n```\n\n## Exit Logic\n\nEach run cycle evaluates open positions against three triggers, in priority order:\n\n### 1. `time_cap` — Time-based exit\nCloses position when the market is within `exit_before_resolution_hours` of resolution.\n\n```\nhours_to_resolution ≤ exit_before_resolution_hours → EXIT (time_cap)\n```\n\nThis is the hard floor. Holding to settlement adds tail risk (oracle variance, thin liquidity, last-minute manipulation) with little remaining upside on a near-resolved market.\n\n### 2. `target_hit` — Profit capture exit\nCloses position when it has captured `target_hit_capture_pct` of the theoretical maximum gain.\n\n```\nYES positions: (current_price - entry_price) / (1.0 - entry_price) ≥ 0.85 → EXIT (target_hit)\nNO positions:  (entry_price - current_price) / entry_price ≥ 0.85 → EXIT (target_hit)\n```\n\nExample: Bought YES at $0.40. Maximum gain = 1.0 - 0.40 = $0.60/share. At $0.91, captured = (0.91 - 0.40) / 0.60 = 85% → exit.\n\n### 3. `volume_spike` — Smart-money volume exit\nCloses position when 10-minute CLOB volume exceeds `volume_spike_exit_multiplier`× the rolling baseline.\n\n```\ncurrent_10m_volume / avg_baseline_volume ≥ 3.0 → EXIT (volume_spike)\n```\n\nA sudden surge in volume near resolution typically signals that informed traders have positioned ahead of outcome certainty. Exiting into the spike captures the liquidity premium.\n\n## Exit Reasons\n\nEvery exit logs one of four reasons:\n\n| Reason | Trigger |\n|--------|---------|\n| `time_cap` | Hours to resolution ≤ `exit_before_resolution_hours` |\n| `target_hit` | Captured ≥ `target_hit_capture_pct` of max gain |\n| `volume_spike` | 10m volume ≥ `volume_spike_exit_multiplier` × baseline |\n| `manual` | User-initiated close via dashboard or SDK |\n\n## CLI Reference\n\n```bash\npython strategy.py                      # Dry run (show positions + opportunities)\npython strategy.py --live               # Execute real trades\npython strategy.py --monitor            # Only run exit checks (no new entries)\npython strategy.py --positions          # Show open positions\npython strategy.py --config             # Show current config\npython strategy.py --set KEY=VALUE      # Update config\npython strategy.py --quiet              # Only output on trades/errors\n```\n\n## Source Tagging\n\nAll trades are tagged `source: \"sdk:btcupdown\"`. This keeps BTC UP/DOWN P&L separate from other strategies in your Simmer portfolio.\n\n## Troubleshooting\n\n**\"No active BTC UP/DOWN markets found\"**\n- Gamma API may be slow or markets may not be trading. Try again in a few minutes.\n- Check polymarket.com directly for active BTC UP/DOWN markets.\n\n**\"Could not fetch BTC momentum\"**\n- Binance API rate-limited. Increase `lookback_minutes` or wait.\n\n**\"Momentum X% < minimum Y%\"**\n- Signal not strong enough. Entry threshold working correctly. Adjust `min_momentum_pct` if too conservative.\n\n**Volume spike trigger not firing**\n- Default baseline needs 6 prior 10-minute windows of data. In low-volume markets, set `volume_baseline_windows` lower or increase `volume_spike_exit_multiplier`.\n\n**\"External wallet requires a pre-signed order\"**\n- `WALLET_PRIVATE_KEY` is not set. Export the private key for your Polymarket wallet.\n- The SDK handles all signing automatically once the env var is set.\n\n**\"Balance shows $0 but I have funds on Polygon\"**\n- Polymarket V2 uses pUSD (PolyUSD). Migrate at simmer.markets/dashboard (one click, ~30s).\n\nFile v1.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7axnp7bzqsf5fkx0z8px7han7zyq1x\",\n  \"slug\": \"polymarket-btc-up-down-trader\",\n  \"version\": \"1.1.0\",\n  \"publishedAt\": 1781317690029\n}\n\nFile v1.1.0:DISCLAIMER.md\n\n# Disclaimer\n\nThis skill is a **framework**, not a production trading system. Read this\nin full before connecting it to a wallet with real funds.\n\n## No financial advice\n\nNothing in this skill constitutes financial, investment, or trading\nadvice. The default strategy implemented here is a starting point, not a\ntested edge. Suitability for any account size or risk tolerance is your\nresponsibility to assess.\n\n## Default parameters are not validated\n\nDefault parameters are calibrated for testing the plumbing, not for live\nprofit. They have not been validated to produce positive returns under\ncurrent market conditions. Run paper mode for an extended period before\nscaling beyond default position sizes.\n\n## Automated trading carries irreversible risk\n\nWhen this skill runs with `--live`, it places real on-chain orders.\nOn-chain trades cannot be recalled. Strategy errors, signal lag, market\nregime shifts, and operator misconfiguration can produce losses\nexceeding any specific position size.\n\n## Risk monitoring may not apply to all market types\n\nStop-loss and take-profit monitors run on a fixed schedule. Markets that\nresolve faster than the monitor cycle cannot be exited automatically.\nPosition sizing is the only risk control on these markets — set it\nconservatively.\n\n## Use of this skill is at your own risk\n\nBy installing and running this skill you agree that the authors are not\nliable for any losses, direct or indirect, that arise from its use. This\napplies regardless of skill provenance — official Simmer skills,\ncommunity skills, and skills imported from external repositories all\ncarry this same disclaimer.\n\n## Where to learn more before going live\n\n- The skill's own `SKILL.md` documents the strategy and parameters\n- Your trading venue's documentation covers fee structure, order types,\n  and resolution rules\n- Simmer SDK documentation covers paper mode, dry-run flags, and\n  position monitoring\n\nFile v1.1.0:skill-card.md\n\n## Description:\n\nTrade Polymarket BTC daily and weekly UP/DOWN markets with empirically anchored exit discipline that enters on CEX momentum divergence and exits on time cap, volume spike, or target capture.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[simmer](https://clawhub.ai/user/simmer)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal developers and traders use this skill to run or monitor a Polymarket BTC daily or weekly UP/DOWN trading strategy with configurable entry thresholds, position limits, and exit discipline. It supports dry-run review by default and can place live trades when explicitly run with live trading credentials.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can run an automated real-money trading strategy and uses high-impact trading credentials for live external-wallet execution.\n\nMitigation: Start in dry-run mode, use conservative position sizes, and use a dedicated low-balance wallet if WALLET_PRIVATE_KEY is needed.\n\nRisk: The documented oracle-engineering halt gate may be overstated.\n\nMitigation: Do not rely on that halt gate as a safety control unless the publisher fixes or removes the claim.\n\nRisk: Live trading or cron use depends on the Simmer SDK and venue behavior.\n\nMitigation: Pin and review the Simmer SDK version before live trading or unattended scheduled runs.\n\nRisk: Default parameters are not validated to produce positive returns under current market conditions.\n\nMitigation: Run paper or dry-run mode for an extended period and adjust thresholds and budgets before using real funds.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/simmer/skills/polymarket-btc-up-down-trader)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with inline shell commands and CLI text output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Requires SIMMER_API_KEY; WALLET_PRIVATE_KEY is only needed for external-wallet live trading.]\n\n## Skill Version(s):\n\n1.1.0 (source: evidence release and frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.1.0:clawhub.json\n\n{\n  \"emoji\": \"🪙\",\n  \"primaryEnv\": \"SIMMER_API_KEY\",\n  \"requires\": {\n    \"env\": [\n      \"SIMMER_API_KEY\"\n    ],\n    \"pip\": [\n      \"simmer-sdk>=0.17.32\"\n    ]\n  },\n  \"envVars\": [\n    {\n      \"name\": \"SIMMER_API_KEY\",\n      \"required\": true,\n      \"description\": \"Your Simmer SDK API key — get from simmer.markets/dashboard\"\n    },\n    {\n      \"name\": \"WALLET_PRIVATE_KEY\",\n      \"required\": false,\n      \"description\": \"Only needed for external-wallet self-custody trading. Not required when using managed wallets.\"\n    }\n  ],\n  \"cron\": null,\n  \"autostart\": false,\n  \"automaton\": {\n    \"managed\": true,\n    \"entrypoint\": \"strategy.py\"\n  },\n  \"tunables\": [\n    {\n      \"env\": \"SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS\",\n      \"type\": \"number\",\n      \"default\": 1.0,\n      \"range\": [0, 6],\n      \"step\": 0.5,\n      \"label\": \"Exit before resolution (hours)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER\",\n      \"type\": \"number\",\n      \"default\": 3.0,\n      \"range\": [0, 10],\n      \"step\": 0.5,\n      \"label\": \"Volume spike exit multiplier (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT\",\n      \"type\": \"number\",\n      \"default\": 0.85,\n      \"range\": [0, 1.0],\n      \"step\": 0.05,\n      \"label\": \"Target capture % exit (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MAX_POSITION_USD\",\n      \"type\": \"number\",\n      \"default\": 10,\n      \"range\": [1, 100],\n      \"step\": 5,\n      \"label\": \"Max position size (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_DAILY_BUDGET_USD\",\n      \"type\": \"number\",\n      \"default\": 50,\n      \"range\": [10, 500],\n      \"step\": 10,\n      \"label\": \"Daily budget (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_ENTRY_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.05,\n      \"range\": [0.01, 0.3],\n      \"step\": 0.01,\n      \"label\": \"Entry edge threshold (min divergence from 50¢)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MOMENTUM_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.3,\n      \"range\": [0.1, 2.0],\n      \"step\": 0.1,\n      \"label\": \"Minimum BTC momentum % to trigger entry\"\n    }\n  ]\n}\n\nArchive v1.0.2: 8 files, 22731 bytes\n\nFiles: clawhub.json (2097b), DISCLAIMER.md (1925b), skill-card.md (2579b), SKILL.md (10026b), strategy.py (34992b), tests/__init__.py (0b), tests/test_exits.py (21649b), _meta.json (148b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: polymarket-btc-up-down-trader\ndescription: Trade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. Enters on CEX momentum divergence; exits automatically on time cap, volume spike, or target capture. Use when the user wants to trade BTC direction markets (hours/days duration), not fast 5-minute markets.\nmetadata:\n  author: Simmer (@simmer_markets)\n  version: \"1.0.2\"\n  displayName: Polymarket BTC Up-Down Trader\n  difficulty: intermediate\n---\n# Polymarket BTC Up-Down Trader\n\nTrade Polymarket's BTC daily and weekly UP/DOWN markets with built-in exit discipline. Enters on Binance momentum signals, exits automatically before resolution tail risk bites.\n\n> 🚨 **Framework, not a production trading system.** Read [DISCLAIMER.md](./DISCLAIMER.md) before connecting to a wallet with real funds.\n\n> **Polymarket only.** All trades execute on Polymarket with real USDC. Use `--live` for real trades; default is dry run.\n\n> **Not for fast (5m/15m) markets.** Use `polymarket-fast-loop` for those. This skill targets daily and weekly BTC direction markets with hours-to-days of duration.\n\n> ⚠️ **BTC UP/DOWN markets carry Polymarket's crypto taker fee.** Effective rate is 3.5% at 50¢, up to ~6.6% on cheap shares. Makers pay 0% and earn a 20% rebate from collected taker fees. Factor this into your minimum edge threshold.\n\n## Oracle-Engineering Halt Gate\n\nThis skill includes a built-in **oracle-engineering risk detector** (`simmer_sdk.risk.OracleEngineeringDetector`). It is **enabled by default** for all short-dated markets (≤ 5 minutes to resolution).\n\nThe gate fires a `RESOLUTION_TAMPER_RISK` halt when **both** signals diverge within the final 5 minutes of the resolution window:\n- **PM concentration** ≥ 60% of one side's open interest held by the top wallet(s)\n- **Spot flow imbalance** ≥ 2σ on the underlying (Binance BTC/USDC) in the *same* direction that benefits the concentrated PM position\n\nWhen the gate fires:\n- **Market-maker mode**: spreads widened ≥ 3×; no new fills accepted\n- **Copytrade mode**: trade skipped for this cycle\n- **All modes**: decision logged with `risk_flag=oracle_engineering`\n\nThis is a **defensive halt only**. Do not use it as a buy signal or to copy the attacker's position. See `simmer_sdk/risk/oracle_engineering.py` for the full detector implementation and `shared-knowledge/entities/concepts/oracle-engineering.md` for threat-model background.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Trade BTC daily or weekly UP/DOWN prediction markets on Polymarket\n- Apply systematic exit discipline (don't hold to settlement)\n- Use CEX price momentum as the entry signal\n- Monitor open positions and auto-exit when targets are hit\n\n## Setup Flow\n\n1. **Install the Simmer SDK**\n   ```bash\n   pip install simmer-sdk\n   ```\n\n2. **Set your API key**\n   - Get from simmer.markets/dashboard → SDK tab\n   - `export SIMMER_API_KEY=\"your-key-here\"`\n\n3. **Set wallet private key** (required for live trading)\n   - `export WALLET_PRIVATE_KEY=\"0x...\"`\n   - Not needed for dry-run or managed wallets.\n\n4. **Configure exit discipline** (optional — defaults are well-tuned)\n   ```bash\n   python strategy.py --config\n   ```\n\n## Quick Start\n\n```bash\n# Dry run — see what would happen\npython strategy.py\n\n# Go live\npython strategy.py --live\n\n# Monitor-only (check exits without new entries)\npython strategy.py --live --monitor\n\n# Quiet mode for cron\npython strategy.py --live --quiet\n```\n\n## How to Run on a Loop\n\n**Linux crontab:**\n```\n# Every 30 minutes\n*/30 * * * * cd /path/to/skill && python strategy.py --live --quiet\n```\n\n**OpenClaw native cron:**\n```bash\nopenclaw cron add \\\n  --name \"BTC Up-Down Trader\" \\\n  --cron \"*/30 * * * *\" \\\n  --session isolated \\\n  --message \"Run BTC up-down trader: cd /path/to/skill && python strategy.py --live --quiet\"\n```\n\n## Configuration\n\nAll settings configurable via `config.json`, environment variables, or `--set`:\n\n```bash\npython strategy.py --set exit_before_resolution_hours=2.0\npython strategy.py --set volume_spike_exit_multiplier=4.0\npython strategy.py --set target_hit_capture_pct=0.75\n```\n\n### Exit Discipline Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `exit_before_resolution_hours` | `1.0` | `SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS` | Close position this many hours before scheduled resolution. Disable with `0`. |\n| `volume_spike_exit_multiplier` | `3.0` | `SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER` | Exit when 10-minute CLOB volume hits N× the rolling baseline. Disable with `0`. |\n| `target_hit_capture_pct` | `0.85` | `SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT` | Exit when position has captured 85% of the theoretical max gain. Disable with `0`. |\n| `volume_baseline_windows` | `6` | `SIMMER_BTCUD_VOLUME_BASELINE_WINDOWS` | Number of prior 10-minute windows used to compute volume baseline. |\n\n**Why these defaults?** Exit behavior on short-dated prediction markets skews heavily toward early exits — the final hours before resolution compress remaining upside while tail risk (last-minute reversals, oracle variance) stays constant. The defaults are calibrated to exit early while capturing the bulk of the move. Empirical work on short-dated crypto UP/DOWN exit patterns informed the calibration; adjust based on your own backtest results.\n\n### Entry Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `entry_threshold` | `0.05` | `SIMMER_BTCUD_ENTRY_THRESHOLD` | Min discount from 50¢ toward the momentum-opposing side. Entry only fires when the market *disagrees* with momentum: UP signal requires YES < 0.50 (edge = `0.50 − YES`); DOWN signal requires YES > 0.50 (edge = `YES − 0.50`). Skips when market already agrees with momentum. |\n| `min_momentum_pct` | `0.3` | `SIMMER_BTCUD_MOMENTUM_THRESHOLD` | Min BTC % move (30-min lookback) to trigger |\n| `max_position` | `10.0` | `SIMMER_BTCUD_MAX_POSITION_USD` | Max $ per trade |\n| `daily_budget` | `50.0` | `SIMMER_BTCUD_DAILY_BUDGET_USD` | Max total entry spend per UTC day |\n| `lookback_minutes` | `30` | `SIMMER_BTCUD_LOOKBACK_MINUTES` | Lookback window for BTC momentum signal |\n| `min_hours_to_resolution` | `4.0` | `SIMMER_BTCUD_MIN_HOURS_TO_RESOLUTION` | Skip entry if market resolves in fewer than N hours |\n\n### Example config.json\n\n```json\n{\n  \"exit_before_resolution_hours\": 1.0,\n  \"volume_spike_exit_multiplier\": 3.0,\n  \"target_hit_capture_pct\": 0.85,\n  \"entry_threshold\": 0.05,\n  \"min_momentum_pct\": 0.3,\n  \"max_position\": 10.0,\n  \"daily_budget\": 50.0\n}\n```\n\n## Exit Logic\n\nEach run cycle evaluates open positions against three triggers, in priority order:\n\n### 1. `time_cap` — Time-based exit\nCloses position when the market is within `exit_before_resolution_hours` of resolution.\n\n```\nhours_to_resolution ≤ exit_before_resolution_hours → EXIT (time_cap)\n```\n\nThis is the hard floor. Holding to settlement adds tail risk (oracle variance, thin liquidity, last-minute manipulation) with little remaining upside on a near-resolved market.\n\n### 2. `target_hit` — Profit capture exit\nCloses position when it has captured `target_hit_capture_pct` of the theoretical maximum gain.\n\n```\nYES positions: (current_price - entry_price) / (1.0 - entry_price) ≥ 0.85 → EXIT (target_hit)\nNO positions:  (entry_price - current_price) / entry_price ≥ 0.85 → EXIT (target_hit)\n```\n\nExample: Bought YES at $0.40. Maximum gain = 1.0 - 0.40 = $0.60/share. At $0.91, captured = (0.91 - 0.40) / 0.60 = 85% → exit.\n\n### 3. `volume_spike` — Smart-money volume exit\nCloses position when 10-minute CLOB volume exceeds `volume_spike_exit_multiplier`× the rolling baseline.\n\n```\ncurrent_10m_volume / avg_baseline_volume ≥ 3.0 → EXIT (volume_spike)\n```\n\nA sudden surge in volume near resolution typically signals that informed traders have positioned ahead of outcome certainty. Exiting into the spike captures the liquidity premium.\n\n## Exit Reasons\n\nEvery exit logs one of four reasons:\n\n| Reason | Trigger |\n|--------|---------|\n| `time_cap` | Hours to resolution ≤ `exit_before_resolution_hours` |\n| `target_hit` | Captured ≥ `target_hit_capture_pct` of max gain |\n| `volume_spike` | 10m volume ≥ `volume_spike_exit_multiplier` × baseline |\n| `manual` | User-initiated close via dashboard or SDK |\n\n## CLI Reference\n\n```bash\npython strategy.py                      # Dry run (show positions + opportunities)\npython strategy.py --live               # Execute real trades\npython strategy.py --monitor            # Only run exit checks (no new entries)\npython strategy.py --positions          # Show open positions\npython strategy.py --config             # Show current config\npython strategy.py --set KEY=VALUE      # Update config\npython strategy.py --quiet              # Only output on trades/errors\n```\n\n## Source Tagging\n\nAll trades are tagged `source: \"sdk:btcupdown\"`. This keeps BTC UP/DOWN P&L separate from other strategies in your Simmer portfolio.\n\n## Troubleshooting\n\n**\"No active BTC UP/DOWN markets found\"**\n- Gamma API may be slow or markets may not be trading. Try again in a few minutes.\n- Check polymarket.com directly for active BTC UP/DOWN markets.\n\n**\"Could not fetch BTC momentum\"**\n- Binance API rate-limited. Increase `lookback_minutes` or wait.\n\n**\"Momentum X% < minimum Y%\"**\n- Signal not strong enough. Entry threshold working correctly. Adjust `min_momentum_pct` if too conservative.\n\n**Volume spike trigger not firing**\n- Default baseline needs 6 prior 10-minute windows of data. In low-volume markets, set `volume_baseline_windows` lower or increase `volume_spike_exit_multiplier`.\n\n**\"External wallet requires a pre-signed order\"**\n- `WALLET_PRIVATE_KEY` is not set. Export the private key for your Polymarket wallet.\n- The SDK handles all signing automatically once the env var is set.\n\n**\"Balance shows $0 but I have funds on Polygon\"**\n- Polymarket V2 uses pUSD (PolyUSD). Migrate at simmer.markets/dashboard (one click, ~30s).\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7axnp7bzqsf5fkx0z8px7han7zyq1x\",\n  \"slug\": \"polymarket-btc-up-down-trader\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1781156558146\n}\n\nFile v1.0.2:DISCLAIMER.md\n\n# Disclaimer\n\nThis skill is a **framework**, not a production trading system. Read this\nin full before connecting it to a wallet with real funds.\n\n## No financial advice\n\nNothing in this skill constitutes financial, investment, or trading\nadvice. The default strategy implemented here is a starting point, not a\ntested edge. Suitability for any account size or risk tolerance is your\nresponsibility to assess.\n\n## Default parameters are not validated\n\nDefault parameters are calibrated for testing the plumbing, not for live\nprofit. They have not been validated to produce positive returns under\ncurrent market conditions. Run paper mode for an extended period before\nscaling beyond default position sizes.\n\n## Automated trading carries irreversible risk\n\nWhen this skill runs with `--live`, it places real on-chain orders.\nOn-chain trades cannot be recalled. Strategy errors, signal lag, market\nregime shifts, and operator misconfiguration can produce losses\nexceeding any specific position size.\n\n## Risk monitoring may not apply to all market types\n\nStop-loss and take-profit monitors run on a fixed schedule. Markets that\nresolve faster than the monitor cycle cannot be exited automatically.\nPosition sizing is the only risk control on these markets — set it\nconservatively.\n\n## Use of this skill is at your own risk\n\nBy installing and running this skill you agree that the authors are not\nliable for any losses, direct or indirect, that arise from its use. This\napplies regardless of skill provenance — official Simmer skills,\ncommunity skills, and skills imported from external repositories all\ncarry this same disclaimer.\n\n## Where to learn more before going live\n\n- The skill's own `SKILL.md` documents the strategy and parameters\n- Your trading venue's documentation covers fee structure, order types,\n  and resolution rules\n- Simmer SDK documentation covers paper mode, dry-run flags, and\n  position monitoring\n\nFile v1.0.2:skill-card.md\n\n## Description: <br>\nTrade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline; it enters on CEX momentum divergence and exits automatically on time cap, volume spike, or target capture. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[simmer](https://clawhub.ai/user/simmer) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users and developers use this skill to operate a configurable Polymarket BTC daily or weekly UP/DOWN trading workflow with dry-run, live trading, monitoring, and exit-discipline controls. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can control real funds when live trading is enabled. <br>\nMitigation: Use dry-run mode by default and enable live trading only after reviewing the strategy, live-mode flags, and trade-size limits. <br>\nRisk: Wallet private-key access may expose high-value credentials. <br>\nMitigation: Use a dedicated low-balance wallet for this skill and never provide a primary wallet or seed phrase. <br>\nRisk: Automated buys and sells may occur without sufficient user-control safeguards. <br>\nMitigation: Add explicit confirmation and conservative order-size, daily-budget, and position limits before unattended live use. <br>\nRisk: On-chain trades cannot be recalled and strategy errors or market shifts can cause losses. <br>\nMitigation: Run paper or dry-run mode for an extended period and keep position sizing conservative. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/simmer/polymarket-btc-up-down-trader) <br>\n- [Skill instructions](artifact/SKILL.md) <br>\n- [Trading disclaimer](artifact/DISCLAIMER.md) <br>\n- [ClawHub manifest](artifact/clawhub.json) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Shell commands, Configuration, Code, Guidance] <br>\n**Output Format:** [Markdown guidance with bash commands, JSON configuration, and Python code artifacts] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Dry-run is the default; live mode can submit Polymarket trades when credentials and the live flag are provided.] <br>\n\n## Skill Version(s): <br>\n1.0.2 (source: server release evidence and SKILL.md frontmatter) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.2:clawhub.json\n\n{\n  \"emoji\": \"🪙\",\n  \"primaryEnv\": \"SIMMER_API_KEY\",\n  \"requires\": {\n    \"env\": [\n      \"SIMMER_API_KEY\"\n    ],\n    \"pip\": [\n      \"simmer-sdk>=0.16.0\"\n    ]\n  },\n  \"envVars\": [\n    {\n      \"name\": \"SIMMER_API_KEY\",\n      \"required\": true,\n      \"description\": \"Your Simmer SDK API key — get from simmer.markets/dashboard\"\n    },\n    {\n      \"name\": \"WALLET_PRIVATE_KEY\",\n      \"required\": false,\n      \"description\": \"Only needed for external-wallet self-custody trading. Not required when using managed wallets.\"\n    }\n  ],\n  \"cron\": null,\n  \"autostart\": false,\n  \"automaton\": {\n    \"managed\": true,\n    \"entrypoint\": \"strategy.py\"\n  },\n  \"tunables\": [\n    {\n      \"env\": \"SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS\",\n      \"type\": \"number\",\n      \"default\": 1.0,\n      \"range\": [0, 6],\n      \"step\": 0.5,\n      \"label\": \"Exit before resolution (hours)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER\",\n      \"type\": \"number\",\n      \"default\": 3.0,\n      \"range\": [0, 10],\n      \"step\": 0.5,\n      \"label\": \"Volume spike exit multiplier (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT\",\n      \"type\": \"number\",\n      \"default\": 0.85,\n      \"range\": [0, 1.0],\n      \"step\": 0.05,\n      \"label\": \"Target capture % exit (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MAX_POSITION_USD\",\n      \"type\": \"number\",\n      \"default\": 10,\n      \"range\": [1, 100],\n      \"step\": 5,\n      \"label\": \"Max position size (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_DAILY_BUDGET_USD\",\n      \"type\": \"number\",\n      \"default\": 50,\n      \"range\": [10, 500],\n      \"step\": 10,\n      \"label\": \"Daily budget (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_ENTRY_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.05,\n      \"range\": [0.01, 0.3],\n      \"step\": 0.01,\n      \"label\": \"Entry edge threshold (min divergence from 50¢)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MOMENTUM_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.3,\n      \"range\": [0.1, 2.0],\n      \"step\": 0.1,\n      \"label\": \"Minimum BTC momentum % to trigger entry\"\n    }\n  ]\n}\n\nArchive v1.0.1: 7 files, 20063 bytes\n\nFiles: clawhub.json (2097b), skill-card.md (2279b), SKILL.md (8805b), strategy.py (34732b), tests/__init__.py (0b), tests/test_exits.py (18562b), _meta.json (148b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: polymarket-btc-up-down-trader\ndescription: Trade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. Enters on CEX momentum divergence; exits automatically on time cap, volume spike, or target capture. Use when the user wants to trade BTC direction markets (hours/days duration), not fast 5-minute markets.\nmetadata:\n  author: Simmer (@simmer_markets)\n  version: \"1.0.1\"\n  displayName: Polymarket BTC Up-Down Trader\n  difficulty: intermediate\n---\n# Polymarket BTC Up-Down Trader\n\nTrade Polymarket's BTC daily and weekly UP/DOWN markets with built-in exit discipline. Enters on Binance momentum signals, exits automatically before resolution tail risk bites.\n\n> **Polymarket only.** All trades execute on Polymarket with real USDC. Use `--live` for real trades; default is dry run.\n\n> **Not for fast (5m/15m) markets.** Use `polymarket-fast-loop` for those. This skill targets daily and weekly BTC direction markets with hours-to-days of duration.\n\n> ⚠️ **BTC UP/DOWN markets carry Polymarket's crypto taker fee.** Effective rate is 3.5% at 50¢, up to ~6.6% on cheap shares. Makers pay 0% and earn a 20% rebate from collected taker fees. Factor this into your minimum edge threshold.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Trade BTC daily or weekly UP/DOWN prediction markets on Polymarket\n- Apply systematic exit discipline (don't hold to settlement)\n- Use CEX price momentum as the entry signal\n- Monitor open positions and auto-exit when targets are hit\n\n## Setup Flow\n\n1. **Install the Simmer SDK**\n   ```bash\n   pip install simmer-sdk\n   ```\n\n2. **Set your API key**\n   - Get from simmer.markets/dashboard → SDK tab\n   - `export SIMMER_API_KEY=\"your-key-here\"`\n\n3. **Set wallet private key** (required for live trading)\n   - `export WALLET_PRIVATE_KEY=\"0x...\"`\n   - Not needed for dry-run or managed wallets.\n\n4. **Configure exit discipline** (optional — defaults are well-tuned)\n   ```bash\n   python strategy.py --config\n   ```\n\n## Quick Start\n\n```bash\n# Dry run — see what would happen\npython strategy.py\n\n# Go live\npython strategy.py --live\n\n# Monitor-only (check exits without new entries)\npython strategy.py --live --monitor\n\n# Quiet mode for cron\npython strategy.py --live --quiet\n```\n\n## How to Run on a Loop\n\n**Linux crontab:**\n```\n# Every 30 minutes\n*/30 * * * * cd /path/to/skill && python strategy.py --live --quiet\n```\n\n**OpenClaw native cron:**\n```bash\nopenclaw cron add \\\n  --name \"BTC Up-Down Trader\" \\\n  --cron \"*/30 * * * *\" \\\n  --session isolated \\\n  --message \"Run BTC up-down trader: cd /path/to/skill && python strategy.py --live --quiet\"\n```\n\n## Configuration\n\nAll settings configurable via `config.json`, environment variables, or `--set`:\n\n```bash\npython strategy.py --set exit_before_resolution_hours=2.0\npython strategy.py --set volume_spike_exit_multiplier=4.0\npython strategy.py --set target_hit_capture_pct=0.75\n```\n\n### Exit Discipline Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `exit_before_resolution_hours` | `1.0` | `SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS` | Close position this many hours before scheduled resolution. Disable with `0`. |\n| `volume_spike_exit_multiplier` | `3.0` | `SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER` | Exit when 10-minute CLOB volume hits N× the rolling baseline. Disable with `0`. |\n| `target_hit_capture_pct` | `0.85` | `SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT` | Exit when position has captured 85% of the theoretical max gain. Disable with `0`. |\n| `volume_baseline_windows` | `6` | `SIMMER_BTCUD_VOLUME_BASELINE_WINDOWS` | Number of prior 10-minute windows used to compute volume baseline. |\n\n**Why these defaults?** Exit behavior on short-dated prediction markets skews heavily toward early exits — the final hours before resolution compress remaining upside while tail risk (last-minute reversals, oracle variance) stays constant. The defaults are calibrated to exit early while capturing the bulk of the move. Empirical work on short-dated crypto UP/DOWN exit patterns informed the calibration; adjust based on your own backtest results.\n\n### Entry Knobs\n\n| Setting | Default | Env Var | Description |\n|---------|---------|---------|-------------|\n| `entry_threshold` | `0.05` | `SIMMER_BTCUD_ENTRY_THRESHOLD` | Min discount from 50¢ toward the momentum-opposing side. Entry only fires when the market *disagrees* with momentum: UP signal requires YES < 0.50 (edge = `0.50 − YES`); DOWN signal requires YES > 0.50 (edge = `YES − 0.50`). Skips when market already agrees with momentum. |\n| `min_momentum_pct` | `0.3` | `SIMMER_BTCUD_MOMENTUM_THRESHOLD` | Min BTC % move (30-min lookback) to trigger |\n| `max_position` | `10.0` | `SIMMER_BTCUD_MAX_POSITION_USD` | Max $ per trade |\n| `daily_budget` | `50.0` | `SIMMER_BTCUD_DAILY_BUDGET_USD` | Max total entry spend per UTC day |\n| `lookback_minutes` | `30` | `SIMMER_BTCUD_LOOKBACK_MINUTES` | Lookback window for BTC momentum signal |\n| `min_hours_to_resolution` | `4.0` | `SIMMER_BTCUD_MIN_HOURS_TO_RESOLUTION` | Skip entry if market resolves in fewer than N hours |\n\n### Example config.json\n\n```json\n{\n  \"exit_before_resolution_hours\": 1.0,\n  \"volume_spike_exit_multiplier\": 3.0,\n  \"target_hit_capture_pct\": 0.85,\n  \"entry_threshold\": 0.05,\n  \"min_momentum_pct\": 0.3,\n  \"max_position\": 10.0,\n  \"daily_budget\": 50.0\n}\n```\n\n## Exit Logic\n\nEach run cycle evaluates open positions against three triggers, in priority order:\n\n### 1. `time_cap` — Time-based exit\nCloses position when the market is within `exit_before_resolution_hours` of resolution.\n\n```\nhours_to_resolution ≤ exit_before_resolution_hours → EXIT (time_cap)\n```\n\nThis is the hard floor. Holding to settlement adds tail risk (oracle variance, thin liquidity, last-minute manipulation) with little remaining upside on a near-resolved market.\n\n### 2. `target_hit` — Profit capture exit\nCloses position when it has captured `target_hit_capture_pct` of the theoretical maximum gain.\n\n```\nYES positions: (current_price - entry_price) / (1.0 - entry_price) ≥ 0.85 → EXIT (target_hit)\nNO positions:  (entry_price - current_price) / entry_price ≥ 0.85 → EXIT (target_hit)\n```\n\nExample: Bought YES at $0.40. Maximum gain = 1.0 - 0.40 = $0.60/share. At $0.91, captured = (0.91 - 0.40) / 0.60 = 85% → exit.\n\n### 3. `volume_spike` — Smart-money volume exit\nCloses position when 10-minute CLOB volume exceeds `volume_spike_exit_multiplier`× the rolling baseline.\n\n```\ncurrent_10m_volume / avg_baseline_volume ≥ 3.0 → EXIT (volume_spike)\n```\n\nA sudden surge in volume near resolution typically signals that informed traders have positioned ahead of outcome certainty. Exiting into the spike captures the liquidity premium.\n\n## Exit Reasons\n\nEvery exit logs one of four reasons:\n\n| Reason | Trigger |\n|--------|---------|\n| `time_cap` | Hours to resolution ≤ `exit_before_resolution_hours` |\n| `target_hit` | Captured ≥ `target_hit_capture_pct` of max gain |\n| `volume_spike` | 10m volume ≥ `volume_spike_exit_multiplier` × baseline |\n| `manual` | User-initiated close via dashboard or SDK |\n\n## CLI Reference\n\n```bash\npython strategy.py                      # Dry run (show positions + opportunities)\npython strategy.py --live               # Execute real trades\npython strategy.py --monitor            # Only run exit checks (no new entries)\npython strategy.py --positions          # Show open positions\npython strategy.py --config             # Show current config\npython strategy.py --set KEY=VALUE      # Update config\npython strategy.py --quiet              # Only output on trades/errors\n```\n\n## Source Tagging\n\nAll trades are tagged `source: \"sdk:btcupdown\"`. This keeps BTC UP/DOWN P&L separate from other strategies in your Simmer portfolio.\n\n## Troubleshooting\n\n**\"No active BTC UP/DOWN markets found\"**\n- Gamma API may be slow or markets may not be trading. Try again in a few minutes.\n- Check polymarket.com directly for active BTC UP/DOWN markets.\n\n**\"Could not fetch BTC momentum\"**\n- Binance API rate-limited. Increase `lookback_minutes` or wait.\n\n**\"Momentum X% < minimum Y%\"**\n- Signal not strong enough. Entry threshold working correctly. Adjust `min_momentum_pct` if too conservative.\n\n**Volume spike trigger not firing**\n- Default baseline needs 6 prior 10-minute windows of data. In low-volume markets, set `volume_baseline_windows` lower or increase `volume_spike_exit_multiplier`.\n\n**\"External wallet requires a pre-signed order\"**\n- `WALLET_PRIVATE_KEY` is not set. Export the private key for your Polymarket wallet.\n- The SDK handles all signing automatically once the env var is set.\n\n**\"Balance shows $0 but I have funds on Polygon\"**\n- Polymarket V2 uses pUSD (PolyUSD). Migrate at simmer.markets/dashboard (one click, ~30s).\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7axnp7bzqsf5fkx0z8px7han7zyq1x\",\n  \"slug\": \"polymarket-btc-up-down-trader\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1779075749279\n}\n\nFile v1.0.1:skill-card.md\n\n## Description: <br>\nTrade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[simmer](https://clawhub.ai/user/simmer) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users and developers use this skill to run or configure an automated Polymarket BTC direction-market strategy for daily and weekly markets. It is intended for disciplined entry, monitoring, and exits, not fast 5-minute or 15-minute markets. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can place automated real-money Polymarket trades when run in live mode. <br>\nMitigation: Start in dry-run mode, use small budgets, and enable live trading only after reviewing the strategy output and configuration. <br>\nRisk: External-wallet use may require sensitive wallet credentials. <br>\nMitigation: Prefer managed wallets when appropriate, or use a dedicated low-balance wallet and keep private keys in environment variables rather than shared files. <br>\nRisk: Cron or quiet mode can make repeated trading harder to observe. <br>\nMitigation: Avoid unattended cron and quiet mode until dry-run behavior, budgets, and exit settings have been verified. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/simmer/polymarket-btc-up-down-trader) <br>\n- [Publisher profile](https://clawhub.ai/user/simmer) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown with inline shell commands and configuration examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include dry-run output, position summaries, trade status, and configuration guidance when the strategy is executed.] <br>\n\n## Skill Version(s): <br>\n1.0.1 (source: server evidence release metadata and skill frontmatter) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.1:clawhub.json\n\n{\n  \"emoji\": \"🪙\",\n  \"primaryEnv\": \"SIMMER_API_KEY\",\n  \"requires\": {\n    \"env\": [\n      \"SIMMER_API_KEY\"\n    ],\n    \"pip\": [\n      \"simmer-sdk>=0.16.0\"\n    ]\n  },\n  \"envVars\": [\n    {\n      \"name\": \"SIMMER_API_KEY\",\n      \"required\": true,\n      \"description\": \"Your Simmer SDK API key — get from simmer.markets/dashboard\"\n    },\n    {\n      \"name\": \"WALLET_PRIVATE_KEY\",\n      \"required\": false,\n      \"description\": \"Only needed for external-wallet self-custody trading. Not required when using managed wallets.\"\n    }\n  ],\n  \"cron\": null,\n  \"autostart\": false,\n  \"automaton\": {\n    \"managed\": true,\n    \"entrypoint\": \"strategy.py\"\n  },\n  \"tunables\": [\n    {\n      \"env\": \"SIMMER_BTCUD_EXIT_BEFORE_RESOLUTION_HOURS\",\n      \"type\": \"number\",\n      \"default\": 1.0,\n      \"range\": [0, 6],\n      \"step\": 0.5,\n      \"label\": \"Exit before resolution (hours)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_VOLUME_SPIKE_MULTIPLIER\",\n      \"type\": \"number\",\n      \"default\": 3.0,\n      \"range\": [0, 10],\n      \"step\": 0.5,\n      \"label\": \"Volume spike exit multiplier (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_TARGET_HIT_CAPTURE_PCT\",\n      \"type\": \"number\",\n      \"default\": 0.85,\n      \"range\": [0, 1.0],\n      \"step\": 0.05,\n      \"label\": \"Target capture % exit (0 = disabled)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MAX_POSITION_USD\",\n      \"type\": \"number\",\n      \"default\": 10,\n      \"range\": [1, 100],\n      \"step\": 5,\n      \"label\": \"Max position size (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_DAILY_BUDGET_USD\",\n      \"type\": \"number\",\n      \"default\": 50,\n      \"range\": [10, 500],\n      \"step\": 10,\n      \"label\": \"Daily budget (USD)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_ENTRY_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.05,\n      \"range\": [0.01, 0.3],\n      \"step\": 0.01,\n      \"label\": \"Entry edge threshold (min divergence from 50¢)\"\n    },\n    {\n      \"env\": \"SIMMER_BTCUD_MOMENTUM_THRESHOLD\",\n      \"type\": \"number\",\n      \"default\": 0.3,\n      \"range\": [0.1, 2.0],\n      \"step\": 0.1,\n      \"label\": \"Minimum BTC momentum % to trigger entry\"\n    }\n  ]\n}","readmeExcerpt":"Skill: polymarket-btc-up-down-trader Owner: simmer Summary: Trade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. Enters on CEX momentum divergence; exits automatically on time cap, volume spike, or target capture. Use when the user wants to trade BTC direction markets (hours/days duration), not fast 5-minute markets. Tags: latest:1.2.5 Version history: v1.2.5 | 2026-09-17T1","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"pip install simmer-sdk"},{"language":"bash","snippet":"python strategy.py --config"},{"language":"bash","snippet":"# Dry run — see what would happen\npython strategy.py\n\n# Go live\npython strategy.py --live\n\n# Monitor-only (check exits without new entries)\npython strategy.py --live --monitor\n\n# Quiet mode for cron\npython strategy.py --live --quiet"},{"language":"text","snippet":"# Every 30 minutes\n*/30 * * * * cd /path/to/skill && python strategy.py --live --quiet"},{"language":"bash","snippet":"openclaw cron add \\\n  --name \"BTC Up-Down Trader\" \\\n  --cron \"*/30 * * * *\" \\\n  --session isolated \\\n  --message \"Run BTC up-down trader: cd /path/to/skill && python strategy.py --live --quiet\""},{"language":"bash","snippet":"python strategy.py --set exit_before_resolution_hours=2.0\npython strategy.py --set volume_spike_exit_multiplier=4.0\npython strategy.py --set target_hit_capture_pct=0.75"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: polymarket-btc-up-down-trader\ndescription: Trade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline. Enters on CEX momentum divergence; exits automatically on time cap, volume spike, or target capture. Use when the user wants to trade BTC direction markets (hours/days duration), not fast 5-minute markets.\nmetadata:\n  author: Simmer (@simmer_markets)\n  version: \"1.2.5\"\n  displayName: Polymarket BTC Up-Down Trader\n  difficulty: intermediate\n---\n# Polymarket BTC Up-Down Trader\n\nTrade Polymarket's BTC daily and weekly UP/DOWN markets with built-in exit discipline. Enters on Binance momentum signals, exits automatically before resolution tail risk bites.\n\n> 🚨 **Framework, not a production trading system.** Read [DISCLAIMER.md](./DISCLAIMER.md) before connecting to a wallet with real funds.\n\n> **Polymarket only.** All trades execute on Polymarket with real USDC. Use `--live` for real trades; default is dry run.\n\n> **Not for fast (5m/15m) markets.** Use `polymarket-fast-loop` for those. This skill targets daily and weekly BTC direction markets with hours-to-days of duration.\n\n## What's New in v1.2.3\n\n- **Removed the \"Oracle-Engineering Halt Gate\" section.** This skill never called that detector, and it does not trade the ≤5-minute markets the gate targets. No code change.\n\n## What's New in v1.2.2\n\n- **Live NO entry is YES-scale.** `avg_cost` is the held-side price. A NO bought at 0.30 now stores entry 0.70 so `target_hit` can fire. Replay rows have no `avg_cost` and were already correct.\n\n## What's New in v1.2.1\n\n- **Exit monitor reads real `Position` objects.** `client.get_positions()` returns dataclasses, not dicts. Replay rows have shares + `cost_basis` only. Side, size, and YES-scale entry are derived. A missing `sources` list under replay is this skill.\n\n## What's New in v1.2.0\n\n- **Replay plane (SIM-5442).** Under `simmer backtest` (`SIMMER_REPLAY=1`) discovery, prices, and the clock come from the existing replay harness — same `SIMMER_REPLAY` / `SIMMER_REPLAY_NOW` pattern as weather. Live Gamma and CLOB midpoint stay dark. Candles were already replay-safe. The exit monitor reads SDK `Position` objects and replay share-rows (no `.get` crash after the first fill).\n- **Keep / kill / fix** for this path is in Troubleshooting. Do not add a second capital lane until a full-tape run can produce an honest KEEP or KILL.\n\n> ⚠️ **BTC UP/DOWN markets carry Polymarket's crypto taker fee.** Effective rate is 3.5% at 50¢, up to ~6.6% on cheap shares. Makers pay 0% and earn a 20% rebate from collected taker fees. Factor this into your minimum edge threshold.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Trade BTC daily or weekly UP/DOWN prediction markets on Polymarket\n- Apply systematic exit discipline (don't hold to settlement)\n- Use CEX price momentum as the entry signal\n- Monitor open positions and auto-exit when targets are hit\n\n## Setup Flow\n\n1. **Install the Simmer SDK**\n   ```bash\n "},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7axnp7bzqsf5fkx0z8px7han7zyq1x\",\n  \"slug\": \"polymarket-btc-up-down-trader\",\n  \"version\": \"1.2.5\",\n  \"publishedAt\": 1789663261377\n}"},{"path":"CHANGELOG.md","content":"# Changelog — polymarket-btc-up-down-trader\n\n## [1.2.5] - 2026-09-17\n\n### Changed\n- Requires `simmer-sdk>=0.25.8`, the first release whose `preflight()` is replay-aware. On an older SDK a backtest of this skill stops filling, because preflight blocks replay trades now that the skill no longer passes `skip_preflight`. Live trading is unaffected.\n\n## [1.2.4] - 2026-09-17\n\n### Changed\n- **Replay trades no longer pass the deprecated `skip_preflight` valve (SIM-5430).** `_trade_kwargs` stops injecting `skip_preflight=True` under `SIMMER_REPLAY=1`; `SimmerClient.preflight()` is now replay-aware on a loopback base URL. Live behaviour unchanged.\n\n## [1.2.3] - 2026-09-17\n\n### Fixed\n- **SKILL.md no longer claims an oracle-engineering halt gate.** The section said `simmer_sdk.risk.OracleEngineeringDetector` was built in and enabled by default. No code in this skill calls it, the skill skips the ≤5-minute markets the gate covers, and it has no market-maker or copytrade mode. ClawHub's scan flagged the claim. Docs only; `strategy.py` behaviour is unchanged.\n\n## [1.2.2] - 2026-09-16\n\n### Fixed\n- **Live NO `avg_cost` is held-side, not YES-scale (SIM-5442 F4).** `_normalize_open_position` preferred `avg_cost` over the `cost_basis` derivation. A NO bought at 0.30 (YES 0.70) stored `entry_price=0.30`, so `check_target_hit_exit` never fired when YES fell. Replay rows omit `avg_cost`, so a backtest looked right. Entry now comes from `cost_basis / shares` (NO: `1 - avg`). `avg_cost` is last-resort and is flipped for NO.\n\n## [1.2.1] - 2026-09-16\n\n### Fixed\n- **Exit monitor no longer crashes on SDK `Position` (SIM-5442 hold-merge).** `get_open_positions` used `p.get(\"source\")` on a dataclass. That `AttributeError` killed every tick after the first fill. The skill now reads Position attributes. Replay share-rows (`market_id`, `shares_yes`/`shares_no`, `cost_basis`, no `source`) normalize to side, size, and YES-scale entry (`cost_basis/shares`; NO is `1 - cost_basis/shares_no`). Missing `sources` under replay is this skill.\n\n## [1.2.0] - 2026-09-16\n\n### Added\n- **Replay plane for markets + prices + clock (SIM-5442).** Under `SIMMER_REPLAY=1` the skill lists BTC Up/Down dailies from the Simmer tape (`GET /api/sdk/markets?q=bitcoin up or down`, no `tags`/`status` — those 422 on replay). Horizon uses `SIMMER_REPLAY_NOW`. Prices come from tape `yes_price` / `current_probability`. Live Gamma and CLOB midpoint stay dark. Volume-spike exits are live-only (CLOB trades would be look-ahead). Replay trades pass `skip_preflight=True` so `WALLET_UNVERIFIED` cannot block SimState fills.\n\n### Fixed\n- Failed `trade()` results no longer increment `daily_spend.json`. A miss must not burn the UTC-day budget.\n- Discovery no longer look-aheads to today's live \"Bitcoin Up or Down on …?\" row while a full tape of historical dailies sits unused.\n- **Exit monitor accepts SDK `Position` objects and replay share-rows.** `get_positions()` returns dataclasses (`shares_yes` / `shares_no` / `cost_basis"},{"path":"DISCLAIMER.md","content":"# Disclaimer\n\nThis skill is a **framework**, not a production trading system. Read this\nin full before connecting it to a wallet with real funds.\n\n## No financial advice\n\nNothing in this skill constitutes financial, investment, or trading\nadvice. The default strategy implemented here is a starting point, not a\ntested edge. Suitability for any account size or risk tolerance is your\nresponsibility to assess.\n\n## Default parameters are not validated\n\nDefault parameters are calibrated for testing the plumbing, not for live\nprofit. They have not been validated to produce positive returns under\ncurrent market conditions. Run paper mode for an extended period before\nscaling beyond default position sizes.\n\n## Automated trading carries irreversible risk\n\nWhen this skill runs with `--live`, it places real on-chain orders.\nOn-chain trades cannot be recalled. Strategy errors, signal lag, market\nregime shifts, and operator misconfiguration can produce losses\nexceeding any specific position size.\n\n## Risk monitoring may not apply to all market types\n\nStop-loss and take-profit monitors run on a fixed schedule. Markets that\nresolve faster than the monitor cycle cannot be exited automatically.\nPosition sizing is the only risk control on these markets — set it\nconservatively.\n\n## Use of this skill is at your own risk\n\nBy installing and running this skill you agree that the authors are not\nliable for any losses, direct or indirect, that arise from its use. This\napplies regardless of skill provenance — official Simmer skills,\ncommunity skills, and skills imported from external repositories all\ncarry this same disclaimer.\n\n## Where to learn more before going live\n\n- The skill's own `SKILL.md` documents the strategy and parameters\n- Your trading venue's documentation covers fee structure, order types,\n  and resolution rules\n- Simmer SDK documentation covers paper mode, dry-run flags, and\n  position monitoring"},{"path":"skill-card.md","content":"## Description:\n\nTrade Polymarket BTC daily and weekly UP/DOWN markets with empirically-anchored exit discipline.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[simmer](https://clawhub.ai/user/simmer)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nTraders and automation operators use this skill to scan Polymarket BTC daily and weekly direction markets, run dry-run checks, and optionally execute live entries and exits with configurable position and budget controls.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Live mode can place irreversible real-money Polymarket trades.\n\nMitigation: Start in dry run, use conservative position and daily-budget settings, and enable live mode only after reviewing the strategy and account risk.\n\nRisk: Exporting WALLET_PRIVATE_KEY increases wallet custody exposure.\n\nMitigation: Avoid setting WALLET_PRIVATE_KEY unless external-wallet live trading is required; prefer managed-wallet or dry-run operation where appropriate.\n\nRisk: Cron or looped execution can automate repeated trading decisions.\n\nMitigation: Review cron schedules and run monitor-only or dry-run checks before enabling unattended live execution.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/simmer/skills/polymarket-btc-up-down-trader)\n- [Skill instructions](artifact/SKILL.md)\n- [Disclaimer](artifact/DISCLAIMER.md)\n- [Changelog](artifact/CHANGELOG.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with inline shell commands and Python strategy execution output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May place live Polymarket trades only when explicitly run with live-trading configuration.]\n\n## Skill Version(s):\n\n1.2.5 (source: server release evidence, frontmatter, and changelog)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":2167,"uniquenessScore":41,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T04:06:38.700Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T04:06:38.700Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T07:40:59.772Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}