TradeHouse prediction-markets Claude Code plugin marketplace v1.0.0
/pm-thesis, /pm-calibration, /pm-fees, /overfit-check wrapping the public th-api / tools / th-validator free-tier endpoints. Analytics + phantom-battery verdicts only; RIA-compliant (no persona/signal internals, disclaimers mandatory). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EsBGJjjHKmNdm5KEcd9bH
This commit is contained in:
commit
54193d3177
8 changed files with 241 additions and 0 deletions
24
.claude-plugin/marketplace.json
Normal file
24
.claude-plugin/marketplace.json
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"name": "tradehouse",
|
||||||
|
"owner": {
|
||||||
|
"name": "TradeHouse — Elite AI Empire",
|
||||||
|
"url": "https://th-validator.eliteaiempire.com"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"description": "Prediction-market analytics plugins backed by TradeHouse settlement-truth data: calibration curves, round-trip fee math, and DSR/PBO overfit verdicts.",
|
||||||
|
"version": "1.0.0"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
{
|
||||||
|
"name": "tradehouse-prediction-markets",
|
||||||
|
"source": "./plugins/tradehouse-prediction-markets",
|
||||||
|
"description": "Slash commands for prediction-market analytics (/pm-thesis, /pm-calibration, /pm-fees) and honest backtest validation (/overfit-check) against TradeHouse public APIs. Analytics only — not investment advice.",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"author": { "name": "TradeHouse — Elite AI Empire" },
|
||||||
|
"homepage": "https://th-validator.eliteaiempire.com",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": ["prediction-markets", "kalshi", "polymarket", "calibration", "backtest", "overfitting", "deflated-sharpe"],
|
||||||
|
"category": "finance"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Elite AI Empire / TradeHouse
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
44
README.md
Normal file
44
README.md
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
# TradeHouse Prediction-Markets — Claude Code plugin marketplace
|
||||||
|
|
||||||
|
Prediction-market analytics inside Claude Code, backed by **TradeHouse** public APIs:
|
||||||
|
settlement-truth market data, venue calibration curves computed over 150k+ resolved markets,
|
||||||
|
a live-measured fee schedule, and the **phantom battery** (deflated Sharpe / PBO) that we use to
|
||||||
|
kill overfit backtests before they cost money.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```bash
|
||||||
|
claude plugin marketplace add https://git.eliteaiempire.com/eas-oss/tradehouse-prediction-markets.git
|
||||||
|
claude plugin install tradehouse-prediction-markets@tradehouse
|
||||||
|
```
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
| Command | What it does |
|
||||||
|
|---|---|
|
||||||
|
| `/pm-thesis <ticker>` | Cross-venue pricing snapshot + calibration context + fee hurdle for one market |
|
||||||
|
| `/pm-calibration [venue]` | Reliability curve, Brier score, favorite-longshot read for a venue (free: polymarket, polymarket_us, opinion) |
|
||||||
|
| `/pm-fees <venue> <price>` | Round-trip platform cost in USD and bps — the break-even edge hurdle |
|
||||||
|
| `/overfit-check <returns> [trials=N]` | Deflated-Sharpe + PBO verdict on your backtest — the metric leaderboards don't show |
|
||||||
|
|
||||||
|
## Free tier & upgrades
|
||||||
|
|
||||||
|
All commands use free public endpoints (no API key). Free tier is rate-limited; HTTP 402/429
|
||||||
|
responses point at the paid tiers. Pro/Desk tiers (full per-category calibration, the live Desk,
|
||||||
|
Risk Cockpit, datasets): https://th-validator.eliteaiempire.com/pricing
|
||||||
|
|
||||||
|
## What this plugin will NOT do
|
||||||
|
|
||||||
|
- No investment advice, no trade recommendations, no signals. Outputs are market analytics and
|
||||||
|
statistical validation verdicts, with the API's compliance disclaimer reproduced verbatim.
|
||||||
|
- No access to TradeHouse's internal trading personas or signal internals — the public,
|
||||||
|
compliance-hardened API surface is the only data source.
|
||||||
|
|
||||||
|
Simulated/backtested performance is not indicative of future results.
|
||||||
|
|
||||||
|
## Related
|
||||||
|
|
||||||
|
- TradeHouse Overfit Validator (web): https://th-validator.eliteaiempire.com/validator
|
||||||
|
- Agent-data MCP quickstart: https://git.eliteaiempire.com/eas-oss/tradehouse-mcp-quickstart
|
||||||
|
|
||||||
|
MIT licensed.
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "tradehouse-prediction-markets",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Prediction-market analytics (live cross-venue data, calibration curves, round-trip fee math) plus the TradeHouse phantom battery (deflated Sharpe / PBO overfit verdicts) — via TradeHouse public APIs. Free tier; market analytics only, never investment advice.",
|
||||||
|
"author": {
|
||||||
|
"name": "TradeHouse — Elite AI Empire",
|
||||||
|
"url": "https://th-validator.eliteaiempire.com"
|
||||||
|
},
|
||||||
|
"homepage": "https://th-validator.eliteaiempire.com",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
---
|
||||||
|
description: Run backtest returns through the TradeHouse phantom battery — deflated Sharpe (DSR) + PBO overfit verdict
|
||||||
|
argument-hint: <path to returns file, or paste daily returns> [trials=N]
|
||||||
|
---
|
||||||
|
|
||||||
|
Run the user's backtest through the **TradeHouse phantom battery**: $ARGUMENTS
|
||||||
|
|
||||||
|
1. **Collect the returns series.** Accept either a file path (CSV/JSON — read it and extract the
|
||||||
|
per-period net returns as decimals, e.g. `0.012` = +1.2%) or pasted numbers. Need >= 20 points.
|
||||||
|
An equity curve is also acceptable (send it as `equity` instead of `returns`).
|
||||||
|
|
||||||
|
2. **Ask for `trials` if not given** — the number of strategy variants the user tried before this
|
||||||
|
one (parameter sweeps count). Be direct: the whole point of the deflated Sharpe is that the
|
||||||
|
metric only means something if this number is honest. If they refuse to estimate, use their best
|
||||||
|
guess and say the verdict is conditional on it.
|
||||||
|
|
||||||
|
3. **Call the validator** via the Bash tool:
|
||||||
|
```
|
||||||
|
curl -s -X POST "https://th-validator.eliteaiempire.com/api/validate" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"returns":[...], "trials": N}'
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Also compute the standard tearsheet** (Sharpe/Sortino/Calmar/CVaR) for context:
|
||||||
|
```
|
||||||
|
curl -s -X POST "https://tools.eliteaiempire.com/v1/tearsheet" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"returns":[...]}'
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **Report, without softening:**
|
||||||
|
- The phantom-battery verdict: `pass_dsr`, `pass_pbo`, `deflated_sharpe_dsr`, `pbo`,
|
||||||
|
`psr_vs_zero`, and the `plain_english` explanation + `reasons` verbatim.
|
||||||
|
- The tearsheet metrics table (note that raw Sharpe/Sortino/Calmar are what leaderboards show,
|
||||||
|
and DSR is what survives multiple testing).
|
||||||
|
- If the verdict is negative, do NOT suggest tweaks to make it pass — explain that more variants
|
||||||
|
tried = a higher bar, and point to out-of-sample/forward validation as the honest next step.
|
||||||
|
|
||||||
|
**Compliance (mandatory):** these are statistical validation verdicts on user-supplied backtest
|
||||||
|
data — not investment advice, and simulated performance is not indicative of future results.
|
||||||
|
Include that sentence in the output. On HTTP 402/429 mention
|
||||||
|
https://th-validator.eliteaiempire.com/pricing and stop.
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
---
|
||||||
|
description: Venue calibration report — implied probability vs realized outcomes over resolved markets (free tier)
|
||||||
|
argument-hint: "[polymarket|polymarket_us|opinion]"
|
||||||
|
---
|
||||||
|
|
||||||
|
Produce a **calibration report** for the prediction-market venue: **$ARGUMENTS**
|
||||||
|
(default to `polymarket` if no venue given; free-tier venues are `polymarket`, `polymarket_us`, `opinion`).
|
||||||
|
|
||||||
|
1. Fetch via the Bash tool:
|
||||||
|
```
|
||||||
|
curl -s "https://tools.eliteaiempire.com/v1/market-efficiency?venue=<VENUE>"
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Render the result:
|
||||||
|
- A table of the `reliability_curve`: probability bucket, n markets, mean implied probability,
|
||||||
|
realized YES frequency, calibration gap.
|
||||||
|
- Headline stats: `n_markets`, `brier_score`, `mean_abs_calibration_error`.
|
||||||
|
- A short interpretation: which buckets are over-priced vs under-priced, and whether the classic
|
||||||
|
favorite-longshot bias (longshots overpriced, favorites underpriced) appears in this venue.
|
||||||
|
Note that a calibration gap is a *population* statistic over resolved markets — it does not
|
||||||
|
make any single market mispriced.
|
||||||
|
|
||||||
|
3. If the user asks for a venue outside the free tier, say the free preview covers
|
||||||
|
`polymarket`, `polymarket_us`, `opinion`, and per-category/per-time-to-settlement calibration is
|
||||||
|
part of the paid tiers: https://th-validator.eliteaiempire.com/pricing
|
||||||
|
|
||||||
|
**Compliance (mandatory):** reproduce the API's `note` field, present everything as historical
|
||||||
|
market analytics computed by TradeHouse from public resolved-market data, and never as investment
|
||||||
|
advice or a recommendation to trade any market.
|
||||||
23
plugins/tradehouse-prediction-markets/commands/pm-fees.md
Normal file
23
plugins/tradehouse-prediction-markets/commands/pm-fees.md
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
description: Round-trip fee/cost calculator for a prediction-market bet (free, live-measured fee schedule)
|
||||||
|
argument-hint: <venue> <price 0-1> [bet_usd=100] [maker]
|
||||||
|
---
|
||||||
|
|
||||||
|
Compute the **round-trip platform cost** for a prediction-market bet: $ARGUMENTS
|
||||||
|
|
||||||
|
1. Parse venue (e.g. `kalshi`, `polymarket`, `limitless`), entry price (0-1), optional bet size
|
||||||
|
(default $100) and maker/taker (default taker).
|
||||||
|
|
||||||
|
2. Call via the Bash tool:
|
||||||
|
```
|
||||||
|
curl -s -X POST "https://tools.eliteaiempire.com/v1/roundtrip-cost" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"universe":"<VENUE>","bet_usd":<BET>,"price":<PRICE>,"is_maker":<true|false>}'
|
||||||
|
```
|
||||||
|
If the API returns a supported-universe error, show the user the list from the error message.
|
||||||
|
|
||||||
|
3. Report entry cost, exit cost, round-trip cost in USD and bps, and the practical meaning:
|
||||||
|
the round-trip bps is the minimum edge a strategy needs per trade just to break even on fees.
|
||||||
|
Compare maker vs taker if the user asks.
|
||||||
|
|
||||||
|
**Compliance:** cost analytics only — not investment advice or an inducement to trade.
|
||||||
47
plugins/tradehouse-prediction-markets/commands/pm-thesis.md
Normal file
47
plugins/tradehouse-prediction-markets/commands/pm-thesis.md
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
---
|
||||||
|
description: Data-grounded snapshot of a prediction market — pricing, calibration context, fee hurdle (analytics only, not advice)
|
||||||
|
argument-hint: <market ticker or question, e.g. INXD-26JUL29>
|
||||||
|
---
|
||||||
|
|
||||||
|
Build a **market analytics snapshot** for the prediction market: **$ARGUMENTS**
|
||||||
|
|
||||||
|
Follow these steps, using `curl` via the Bash tool (all endpoints are free tier, no key needed):
|
||||||
|
|
||||||
|
1. **Live cross-venue data.** If the user gave a ticker, fetch:
|
||||||
|
```
|
||||||
|
curl -s "https://th-api.eliteaiempire.com/api/v1/prediction-market-data/<TICKER>"
|
||||||
|
curl -s "https://th-api.eliteaiempire.com/api/v1/resolutions/<TICKER>"
|
||||||
|
```
|
||||||
|
If they gave a plain-English question instead of a ticker, say that you need a venue ticker
|
||||||
|
(Kalshi/Polymarket format) and show them what the endpoint returns for an example ticker.
|
||||||
|
|
||||||
|
2. **Calibration context.** Fetch the venue calibration report for a venue relevant to the market
|
||||||
|
(supported free venues: `polymarket`, `polymarket_us`, `opinion`):
|
||||||
|
```
|
||||||
|
curl -s "https://tools.eliteaiempire.com/v1/market-efficiency?venue=polymarket"
|
||||||
|
```
|
||||||
|
Use the reliability curve to note whether prices in this market's probability bucket
|
||||||
|
historically over- or under-state realized frequency (the favorite-longshot bias shows up here).
|
||||||
|
|
||||||
|
3. **Fee hurdle.** Compute the round-trip cost at the market's current price:
|
||||||
|
```
|
||||||
|
curl -s -X POST "https://tools.eliteaiempire.com/v1/roundtrip-cost" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"universe":"kalshi","bet_usd":100,"price":<CURRENT_PRICE>}'
|
||||||
|
```
|
||||||
|
(`universe` = the venue the market trades on.)
|
||||||
|
|
||||||
|
4. **Synthesize** a short report:
|
||||||
|
- Current pricing per venue + implied probability (state data timestamp/freshness).
|
||||||
|
- Calibration adjustment: what the venue's reliability curve says about prices in this bucket.
|
||||||
|
- The round-trip fee hurdle in bps — the minimum mispricing needed to break even.
|
||||||
|
- A one-line **analytics verdict** about the market's pricing quality — never a trade recommendation.
|
||||||
|
|
||||||
|
**Compliance rules (mandatory):**
|
||||||
|
- Reproduce the `_meta.disclaimer` text returned by the API at the end of your report.
|
||||||
|
- This is a financial data publication / market analytics. NEVER phrase output as personalized
|
||||||
|
investment advice, a recommendation, or a signal to buy/sell. Do not speculate about
|
||||||
|
TradeHouse's internal personas or signals — the public API surface is the only source.
|
||||||
|
- If an endpoint returns empty venues/data for the ticker, say so plainly; do not fabricate prices.
|
||||||
|
- On HTTP 402/429: the free tier is rate-limited — mention
|
||||||
|
https://th-validator.eliteaiempire.com/pricing for Pro/Desk tiers and stop.
|
||||||
Loading…
Add table
Reference in a new issue