What is Pragma?We build Pragma, a plugin that turns AI agents into autonomous on-chain trading agents. We give AI agents their own non-custodial wallets, delegation-secured permissions, and the ability to trade, monitor, and execute on-chain autonomously, all within constraints users define in natural language and enforce on-chain.Rather than building "another trading app" that competes for users, Pragma takes a distribution-first approach: equip existing AI runtimes (Claude Code, OpenClaw) with blockchain superpowers through MCP (Model Context Protocol). Users already live in Claude Code. Pragma makes it a trading terminal.Key Stats65 MCP tools across 12 categories3 specialized autonomous agents (perpetuals, memecoins, general-purpose)4 ecosystem components (CLI plugin, headless plugin, web app, API backend)Live on Monad mainnet with real trades executedNon-custodial: we never custody user funds or keysTool Ecosystem (65 Tools)Trading Core: Swap quotes (batch up to 5 parallel), atomic batch execution, transfersLeverUp Perpetuals (12 tools): 20 markets (crypto, stocks, forex, indices, commodities), up to 1001x leverage, limit orders, margin updates, TP/SL, funding rate analysisnad.fun Memecoins (8 tools): Buy, sell, discover, create tokens with atomic creation (create + initial buy in one tx), bonding curve analysisMarket Intelligence (8 tools): OHLCV charts via Pyth, FX reference rates, 28-pair currency strength matrix, economic calendar, central bank speeches (FED, ECB, BOE, BOJ + more), real-time critical newsSocial Intelligence (5 tools): X/Twitter search, user lookup, reply threading for narrative-driven tradingOn-Chain Analysis (5 tools): Transaction decoding, contract analysis, activity history with delegation chain visualizationAutonomous Infrastructure (10+ tools): Sub-agent creation, wallet pool, delegation chains, budget tracking, agent journalingPortfolio & Account: Balances, token info, session key management, gas monitoringWallet ArchitecturePragma uses a two-layer non-custodial wallet design:User side: Passkey (P-256) stored in Secure Enclave, registered as authorized key on a HybridDeleGator Smart Account. Touch ID required for signing. User funds stay here.Agent side: Session key (secp256k1 EOA) stored in macOS Keychain. No Touch ID required for programmatic access. Executes on user's Smart Account via redeemDelegations().Delegation System (The Core Innovation)Seven on-chain caveat enforcers compose the permission model:TimestampEnforcer: Delegation expires at set timeLimitedCallsEnforcer: Max number of on-chain callsValueLteEnforcer: Max native value per transactionAllowedTargetsEnforcer: Whitelist of contract addressesAllowedMethodsEnforcer: Whitelist of function selectorsAllowedCalldataEnforcer: Whitelist of calldata patterns (transfer recipients)LogicalOrWrapperEnforcer: Groups caveats with OR logic (4 groups: Approve, Trading, ERC20 Transfer, Native Transfer)Natural language permissions: User says "trade up to $200/day for the next week, stablecoins and MON only." Claude translates this to on-chain caveats. User approves with Touch ID once. The agent operates freely within those bounds, and physically cannot exceed them.Execution ModesAssistant Mode: User is present. Ephemeral delegation (5-minute expiry, single-use). Touch ID per action. Delegation expires after use.Autonomous Mode: User is away. Persistent delegation (days to weeks). Touch ID once to authorize the full scope. Agents operate freely within on-chain constraints. Self-funding: agents top up their own gas via delegation groups 2 and 3.Autonomous Trading SystemMulti-agent architecture: The main Claude agent holds the root delegation and can sign sub-delegations to spawn specialized trading agents, each with their own wallet from a reusable wallet pool. Sub-delegations can only narrow parent scope, never expand it.Three specialized agents:Kairos (institutional perpetuals trader): 7-phase workflow from situational awareness to exit review. 39 tools. Multi-timeframe analysis. Mandatory kill switch with 11-point pre-trade checklist. Market hours awareness for forex/commodities.Thymos (momentum memecoin scalper): 5-phase scout-evaluate-enter-monitor-rotate workflow. 28 tools. 30-second token evaluation filter. Narrative scanner cross-referencing news with on-chain memecoin trends. Hard exits at 2x/5x/-15%.Pragma (general-purpose executor): 4-phase parse-baseline-monitor-execute workflow. 51 tools (full protocol access). Conditional orders in natural language: "When BTC drops 5%, rebalance into stables."Budget enforcement: Two layers. On-chain (hard): timestamp, call count, value caps. Off-chain (soft): token flow ledger with net outflow tracking. Static max drawdown model: profits don't increase budget beyond original allocation.Persistent journal: JSONL per agent with tagged entries (baseline, watchlist, trade_plan, position_health). Survives context compaction in multi-day runs.Wake-from-idle scheduling: Agents don't sleep in loops. They complete a cycle, report to leader, and go idle. Leader orchestrates wake-up timing via background timers. Zero context waste between cycles.Two-Tier Business ModelDIY Mode (Free): User provides their own API keys (RPC, DEX aggregator, etc.). Pragma is pure orchestration. The plugin is completely free.Convenient Mode (x402 Paid): Pragma's backend bundles all infrastructure. Agents pay per API call with USDC micropayments via x402 protocol. No API keys or subscriptions needed. Pricing: $0.001 per RPC call, $0.005 per chart, $0.007 per tweet, $0.05 per contract analysis. Full pricing: api.pr4gma.xyz/pricingBootstrap system: New wallets get 50 free API calls.ArchitectureThe ecosystem spans four components:pragma (Claude Code plugin): CLI-based trading agents with skills, commands, hooks, and autonomous mode. Distribution: GitHub marketplace plugin + .mcpb DXT for Claude Desktop/Cowork.pragma for OpenClaw: Same 65 tools adapted for headless cloud agents. File-based key storage, web delegation flow via pr4gma.xyz. Tested with Kimi K2.5 on Linux production server.pr4gma.xyz (Next.js): Web app for wallet setup, delegation management, passkey enrollment. Enables delegation approval from browser when Touch ID is unavailable (headless Linux agents).pragma-api (Cloudflare Workers): Backend API powered by x402. Hono framework. Routes: RPC proxy, Pimlico bundler, 0x quotes, Monorail data, HyperSync, market intelligence. Workers KV for bootstrap tracking, D1 for news storage.Security ModelDesign philosophy: Trust-minimized. We have zero access to user keys or funds.Passkey never leaves hardware (Secure Enclave)Session key isolated in macOS KeychainOn-chain delegation caveats are cryptographically binding, cannot be bypassed or forgedSub-delegations can only narrow scope, never expandWallet pool uses atomic file locking to prevent race conditionsERC20 approvals only sent to known protocol contracts (AllowedCalldataEnforcer)Instant revocation: on-chain nonce increment invalidates ALL delegations in one UserOpTech StackTypeScript (strict), Viem, MCP SDKMetaMask HybridDeleGator + Delegation ToolkitSwift binary for Secure Enclave passkeys (macOS)Hono + Cloudflare Workers + D1 + KV (API backend)Next.js (wallet web app)esbuild (1.8MB self-contained ESM bundle, users only need node)Monad mainnet (Chain ID 143, EVM L1)EIP-7966 eth_sendRawTransactionSync for ~50% confirmation latency reductionPyth Network price oraclesProduction EvidenceLive trades on Monad mainnet: BTC, ETH perpetuals on LeverUp, memecoin trades on nad.funOpenClaw production: Kimi K2.5 agent created sub-agent, funded 0.5 MON on-chain, completed trades on Linux serverDXT tested and working on Claude Desktop + Cowork (Anthropic's multi-agent platform)All 7 on-chain enforcer encodings verified against MetaMask DTK reference implementationProduction On-Chain EvidenceMy live addresses on Monad mainnet, verifiable on monadvision.com:Smart Account (HybridDeleGator): 0x601aD0E29E9D9fCC9c9dBd81e46EEA5D9f399fa0Session Key (Claude's wallet): 0xCb9EA18579EB357E78EBB3EFaE6E9a594225c4f8DelegationManager: 0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3Wallet Pool (Sub-Agent Wallets):0x46c1a50b971561FcC18ef59960093B1C6c1Aa3800xBCeb1460cf24054d0da88cad6bB506d8BA7DB0De0x12E4889aeEb77502b8ED7Ff5F2469b1d359D7140x402 Facilitator: 0xBE496818354C42d0Ee8d94252F00eE7F7bfE7f57 (20,000+ transactions), powers all Convenient Mode API calls with USDC micropayments.Every address is live on Monad mainnet with real transaction history.Built for the AI Agent EraAI agents don't need new wallets or interfaces. They need hands to act on-chain safely, and users need on-chain guarantees those hands won't go rogue. Pragma is those hands.