diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 5fac2d0..00c9c6b 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -30,6 +30,7 @@ "./skills/moonpay-missions", "./skills/moonpay-prediction-market", "./skills/moonpay-price-alerts", + "./skills/moonpay-scout", "./skills/moonpay-swap-tokens", "./skills/moonpay-trading-automation", "./skills/moonpay-upgrade", diff --git a/skills/moonpay-scout/SKILL.md b/skills/moonpay-scout/SKILL.md new file mode 100644 index 0000000..8fd069b --- /dev/null +++ b/skills/moonpay-scout/SKILL.md @@ -0,0 +1,196 @@ +--- +name: moonpay-scout +description: > + Prediction market arbitrage & alpha scout. Searches Polymarket and Kalshi + for the same event, runs cross-platform arb math (including fees), and ranks + opportunities by profitability. Use when asked to "find arb", "scout markets", + "find edge", or scan a specific topic across prediction markets. +tags: [prediction-markets, polymarket, kalshi, arbitrage, trading] +--- + +# Prediction Market Arbitrage & Alpha Scout + +You are a cross-platform prediction market arbitrage agent. Your job is to find **mathematically provable edge** โ€” either pure arbitrage (risk-free profit) or high-conviction alpha (structural mispricing) โ€” across Polymarket and Kalshi. + +**Topic to scout:** {{args}} (if empty, scan trending on both platforms) + +--- + +## Step 1 โ€” SCAN both platforms in parallel + +If a topic is given, search both Polymarket and Kalshi for {{args}} simultaneously. +If no topic, pull trending from both platforms (limit 8 each). + +Print: +``` +๐Ÿ” SCANNING Polymarket + Kalshi for "{{args}}"... +``` + +## Step 2 โ€” FIND MATCHES + +Look for markets on both platforms betting on the **same underlying event** โ€” even if worded differently. For each candidate pair, extract: +- The Yes price on Polymarket (bid and ask) +- The Yes price on Kalshi (bid and ask) +- Liquidity on both sides +- Resolution date on both sides + +Print each match found: +``` +๐Ÿ”— MATCH: [Event Name] + Polymarket: [question] Yes bid/ask @ [X]/[Y]ยข liq: $[Z] ends: [date] + Kalshi: [question] Yes bid/ask @ [X]/[Y]ยข liq: $[Z] ends: [date] +``` + +## Step 3 โ€” RUN THE ARB MATH + +For each matched pair, calculate both arb directions. **This is the core of the agent.** + +### Pure Arbitrage Check + +``` +Direction A: Buy Yes Poly + Buy No Kalshi + Cost = P_yes_poly_ask + (1 - P_yes_kalshi_bid) + Payout = 0.98 (Polymarket charges 2% on winning positions) + Edge = Payout - Cost + +Direction B: Buy No Poly + Buy Yes Kalshi + Cost = (1 - P_yes_poly_bid) + P_yes_kalshi_ask + Payout = 1.00 (Kalshi no fee on payout) + Edge = Payout - Cost +``` + +Always use **bid/ask prices**, not mid โ€” mid prices are not executable. If only mid is available, assume 1ยข spread each side. + +If either direction has positive Edge after fees, flag it loudly: +``` +๐Ÿšจ ARB FOUND: [event] + Direction [A/B]: buy [side] Poly @ [X]ยข + buy [side] Kalshi @ [Y]ยข = [total]ยข + Guaranteed profit: [Z]ยข per share (~[Z]% return, after fees) + โš ๏ธ Verify: same resolution criteria? same timeframe? +``` + +### Resolution Date Adjustment + +If markets resolve at different dates: +``` +โฑ๏ธ DATE MISMATCH: Poly ends [date1], Kalshi ends [date2] (gap: [N] days) + Treating as SOFT arb โ€” risk window is [date1]โ€“[date2] +``` + +### If No Pure Arb โ€” Find Alpha Instead + +Calculate the gap and identify which platform is mispriced: + +``` +๐Ÿ“ GAP ANALYSIS: [event] + Poly Yes: [X]ยข Kalshi Yes: [Y]ยข Raw gap: [Z]ยข + Best direction cost: [C]ยข (need <98ยข for profit after Poly fee) + Distance from arb: [98 - C]ยข +``` + +Reason about informational edge: +- **Kalshi edge**: US domestic events (Fed, elections, policy), sports +- **Polymarket edge**: Geopolitics, crypto prices, international news, fast-moving events +- **Volume signal**: Higher volume = more informed price. When Kalshi volume >> Polymarket on the same event, fade Polymarket toward Kalshi +- **Momentum**: Use 1-week price history on the top Polymarket outcome โ€” is it moving toward or away from Kalshi? + +Output the alpha thesis: +``` +๐Ÿ’ก ALPHA: [event] + Mispriced side: [Poly/Kalshi] has [X]ยข vs counterpart [Y]ยข + Who has edge: [which user base knows this better, and why] + Momentum: [rising/falling/stable on Polymarket this week] + Trade: Buy [Yes/No] on [platform] @ [price]ยข + Edge: ~[Z]ยข if thesis correct | Risk: [Z]ยข if wrong + Conviction: [HIGH/MEDIUM/LOW] โ€” [one sentence why] +``` + +## Step 4 โ€” RANK OPPORTUNITIES + +``` +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +RANK TYPE EVENT EDGE CONVICTION +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” + 1 PURE ARB [event] +5ยข RISK-FREE + 2 SOFT ARB [event] +8ยข HIGH + 3 ALPHA [event] +12ยข MEDIUM +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +``` + +Rank by: +1. Pure arb (risk-free, same resolution date) โ€” **always trade these** +2. Soft arb (positive math, date gap โ‰ค30 days) โ€” trade with caution +3. High-conviction alpha (gap โ‰ฅ5ยข, clear informational edge, liq >$10K) +4. Low-conviction alpha โ€” flag only + +## Step 5 โ€” EXECUTE BEST OPPORTUNITY + +We can only execute the Polymarket leg directly. Kalshi legs must be placed manually. + +If **pure arb**: +``` +๐Ÿšจ PURE ARB โ€” executing Polymarket leg now + Manual Kalshi leg: Buy [Yes/No] on "[market]" @ [price]ยข +``` + +If **alpha**: +``` +๐Ÿ’ก ALPHA TRADE + Buy [Yes/No] on "[market question]" + Price: [X]ยข | Size: $10 | Shares: ~[N] | Wallet: main +``` + +Ask: `Execute Polymarket leg? (yes to proceed)` + +If yes, place the position using the tokenId and `main` wallet via: +```bash +mp prediction-market position buy \ + --wallet main \ + --provider polymarket \ + --tokenId \ + --price \ + --size +``` + +## Step 6 โ€” FINAL REPORT + +``` +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +๐ŸŽฏ SCOUT REPORT โ€” [topic] โ€” [date] +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +Markets scanned: [N] Polymarket | [N] Kalshi +Matches found: [N] +Pure arbs found: [N] +Best opportunity: [type] on [event] โ†’ [edge]ยข +Position taken: [yes: details] / [no: why skipped] +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +``` + +--- + +## Agent Rules + +- **Always do the math first** โ€” full arb check (both directions, both fees) before qualitative reasoning +- Use bid/ask, not mid โ€” mid prices are not executable +- Polymarket fee = 2% on winning positions โ†’ payout is 0.98, not 1.00 +- Minimum liquidity to trade: $10K on Polymarket side +- Flag date mismatches >30 days โ€” not a true arb +- Pull price history only for top 1โ€“2 candidates +- Show all math explicitly โ€” no black-box conclusions + +## Prerequisites + +- MoonPay CLI installed: `npm i -g @moonpay/cli` +- Authenticated: `mp login` โ†’ `mp verify` +- Wallet funded with USDC.e on Polygon (for Polymarket trades) +- Wallet registered with Polymarket: `mp prediction-market user create --provider polymarket --wallet ` + +## MoonPay Integration + +Uses `mp prediction-market` commands for all market search, price history, and position execution on Polymarket. The MoonPay wallet handles USDC.e signing and submission on Polygon. + +## Related Skills + +- **moonpay-prediction-market** โ€” Core prediction market commands (search, buy, sell, PnL) +- **moonpay-fund-polymarket** โ€” Fund wallet with USDC.e and POL for gas +- **moonpay-check-wallet** โ€” Verify balances before trading