When CLAW402_WALLET_KEY env var is set, all nofxos.ai data API calls
(AI500, OI rankings, NetFlow, price rankings, etc.) are automatically
routed through claw402.ai with x402 USDC payment instead of direct
free access.
- New Claw402DataClient for GET requests with x402 payment flow
- Endpoint mapping: /api/xxx -> /api/v1/nofx/xxx
- MakeClaw402SignFunc helper for reusable payment signing
- Auto-detection: if CLAW402_WALLET_KEY is set, claw402 mode activates
- Fallback: without wallet key, direct nofxos.ai access (backward compatible)
Env vars:
CLAW402_WALLET_KEY=0x... # wallet private key for payment
CLAW402_URL=https://claw402.ai # optional, defaults to claw402.ai
- trader/alpaca/: Full Trader interface implementation for Alpaca
- Paper/Live trading support (market orders, stop/limit)
- GetBalance, GetPositions, GetMarketPrice via Alpaca API
- Fractional share support (4 decimal places)
- Commission-free trading
- Agent trade routing: stock symbols (AAPL, TSLA) → Alpaca
- isStockSymbol() heuristic to distinguish crypto vs stock
- execute_trade tool updated for stock buy/sell semantics
- get_market_price works for both crypto and stocks
- TraderManager + API: Alpaca registered as exchange type
- Factory case in auto_trader.go
- Config mapping in trader_manager.go
- Temp trader creation in handler_trader.go for balance query
- Frontend: PositionsPanel distinguishes stock vs crypto
- US flag emoji for stock positions
- Dollar prefix for stock PnL/prices
- 'Shares' label instead of 'Qty' for stocks
- System prompts updated for stock trading capabilities