Your AI for broker-free onchain stock trading and legendary fundamental analysis.
Ever felt like a "one-legged person in an ass-kicking contest" when trading onchain? That is Charlie Munger’s classic warning about entering a market unprepared, and in the fast-paced world of Web3 tokenized stocks, it has never been more accurate. Enter Leg Agent: your ultimate, AI-powered extra leg designed to help you stand tall and dominate the market.
We’ve combined the legendary brains of investors such as Warren Buffett, Charlie Munger, and Peter Lynch with the decentralized brawn of Web3. Instead of chasing crypto hype, Leg Agent acts as your tireless, hyper-rational financial analyst. It chews through complex fundamental data to serve up sound, disciplined investment choices rooted deeply in time-tested value investing principles.
But what good is brains without the muscle to execute? Once the AI identifies a prime tokenized stock, it seamlessly routes your orders directly through the Uniswap API to lock in the best possible pricing and liquidity. You get to skip the clunky traditional broker accounts and maintain total self-custody over your assets. It is institutional-grade strategy meeting true decentralized freedom—giving you the perfect stance to invest with confidence.
• 0G Blockchain (Decentralized AI Inference): We use the 0G Compute Router (0g.ai) for decentralized LLM inference. Custom headers (x-max-completion-price & x-max-prompt-price) set strict micro-USDC price caps per million tokens, and response token allowances are validated post-request to prevent overbilling. • Uniswap API (Tokenized Stock Trading): Integrates the Uniswap Trading API and Universal Router to discover optimal routes, estimate gas, and execute swaps. Swaps utilize Permit2 for gasless, EIP-712 signed approvals, monitored by an automated execution reconciler. • Smart Contracts (packages/foundry/src): • CustomerCreditVault.sol (Solidity 0.8.24 on Base): A non-upgradeable contract managing Base USDC micro-credits via a 2-phase Reserve & Settle flow. Users sign EIP-712 typed data (Reservation) off-chain; BILLING_ROLE reserves the maximum fee, and settle() charges only actual usage while returning leftover credits. • AgentWallet.sol: An onchain proxy contract with an only Authorized guard allowing the agent or user to execute pre-approved trading actions safely without exposing primary keys. • Data Enrichment & Valuation Engine: Server-side normalization parses raw Financial Modeling Prep (FMP) metrics into structured fact bundles with exact timestamps. Pure, deterministic formulas calculate metrics like the Graham Number, Margin of Safety, Buffett Owner Earnings and Greenblatt Magic Formula before passing grounded context to the LLM. Real-time portfolio context is enriched via viem balance reads.
• Zero-Cost Preflight: Credit reservations occur prior to API/inference calls; if 0G or FMP fails, reservations are released at zero cost to the user. • Streamable HTTP MCP Transport: Uses @modelcontextprotocol/sdk with OAuth 2.1 / PKCE to expose the same research orchestrator directly to ChatGPT and Claude.

