hunch-agent
v0.1.0
Published
One-line CLI to bet Hunch prediction markets from any terminal or script: discover, research, quote, simulate for $0, settle real USDC bets on Base via x402, watch resolutions live, or run the tested continuous strategy 24×7.
Maintainers
Readme
hunch-agent
One-line CLI to bet Hunch prediction markets from any terminal or script — keyless, no signup, no API key. Reads and $0 simulations need nothing; real bets settle USDC on Base via x402 with your own key (gas is sponsored — the wallet never needs ETH). Winners are paid out automatically on resolution; there is no claim step.
# Look around — no wallet, no funds, nothing to install permanently
npx hunch-agent markets
npx hunch-agent discover "$BNKR flips $AERO this month"
npx hunch-agent research <marketId>
npx hunch-agent sentiment BNKR
# Prove the whole flow for $0 (full validation pipeline, no funds move)
npx hunch-agent bet <marketId> yes 5
# Go real: mint a wallet, fund it with USDC on Base, then --live
npx hunch-agent wallet new # prints a key — save it
export HUNCH_PRIVATE_KEY=0x...
npx hunch-agent readiness # confirms the wallet can bet
npx hunch-agent bet <marketId> yes 5 --live
# Track it
npx hunch-agent positions
npx hunch-agent watch # live SSE event stream
npx hunch-agent proof <tradeId> # on-chain settlement proof
# Or run the tested continuous strategy 24×7 (simulates until --live)
npx hunch-agent run --tokens BNKR,AERO
npx hunch-agent run --live --interval 60Built for shell scripts
Every command takes --json and prints the raw wire value — pipe it to jq:
# The strongest crowd-conviction bet across your watchlist, as one JSON object
npx hunch-agent sentiment BNKR --json | jq .suggestedBet
# Bet $1 on every open coin-flip round's favourite, forever
while true; do
id=$(npx hunch-agent markets 50 --json | jq -r '.[] | select(.category=="coin_flip") | .id' | head -1)
[ -n "$id" ] && npx hunch-agent bet "$id" heads 1 --live
sleep 300
doneSides: yes/no on binary markets, up/down on direction rounds,
heads/tails/tie on The Flip, or an outcome key (e.g. a ladder bucket like
63m-67m) on N-way markets — markets --json lists each market's real keys.
Env
| Variable | Meaning |
| --- | --- |
| HUNCH_PRIVATE_KEY | 0x… Base wallet key. Enables --live; defaults the wallet for positions/readiness/watch. |
| HUNCH_BASE_URL | API origin (default https://www.playhunch.xyz). |
| HUNCH_TOKENS | Watchlist for run (default BNKR,AERO,VVV,VIRTUAL). |
| HUNCH_BET_SIZE_USD / HUNCH_MAX_STAKE_USD / HUNCH_MAX_BETS | run risk budget (defaults $1 / $10 / 10). |
| HUNCH_INTERVAL_SEC | run cycle interval (default 60). |
The run loop is the same tested strategy that powers
npx create-hunch-agent my-bot --loop: it acts only on the live crowd-conviction
signal, simulates every pick first, and halts itself when the risk budget is
spent.
Programmatic use
The package also exports the loop brain for embedding:
import { decideLoopBet, defaultLoopPolicy } from "hunch-agent";For a full typed client (quotes, positions, webhooks, SSE), use
@hunchxyz/agent-sdk — this
CLI is built on it.
- Docs: https://www.playhunch.xyz/agents/docs
- Machine guide: https://www.playhunch.xyz/llms-full.txt
- MCP server:
claude mcp add --transport http hunch https://www.playhunch.xyz/api/mcp
Prediction markets carry risk. Only stake what you can afford to lose; not available where prohibited.
