"""Drop-in CDP AgentKit action provider for NEXUS Intelligence. Install: pip install coinbase-agentkit requests Usage: from docs.AGENTKIT_TOOL import NEXUSActionProvider nexus_provider = NEXUSActionProvider() agentkit = AgentKit(config).add_action_provider(nexus_provider) Paid arb calls require an AgentKit agent with a Base wallet + x402 support. Network: eip155:8453 (Base mainnet USDC). """ from coinbase_agentkit import ActionProvider, action import requests NEXUS_BASE = "https://nexus-agent-xa12.onrender.com" class NEXUSActionProvider(ActionProvider): """NEXUS Intelligence — live prediction market data""" @action( name="get_kalshi_odds", description=( "Get live Kalshi prediction market odds for Fed rate decisions, BTC price, CPI, GDP. " "Free, no payment required." ), ) def get_kalshi_odds(self, market: str = "Fed") -> str: r = requests.get(f"{NEXUS_BASE}/kalshi", params={"market": market}, timeout=30) r.raise_for_status() return r.text @action( name="get_arb_spread", description=( "Get live Kalshi vs Polymarket arbitrage spread. Costs $0.02 USDC via x402 on Base " "(eip155:8453). AgentKit x402 wallet pays automatically when configured." ), ) def get_arb_spread(self, markets: str = "Fed,BTC") -> str: r = requests.get( f"{NEXUS_BASE}/arb/check", params={"markets": markets}, timeout=30, ) return r.text # 402 invoice if unpaid, spread JSON if paid # Usage: # nexus_provider = NEXUSActionProvider() # agentkit = AgentKit(config).add_action_provider(nexus_provider)