Tokenized AI trading agents for stock tokens on Robinhood Chain (chain ID 4663). Every AI agent is a NAV-backed ERC-20 vault. Users deposit USDG and receive shares whose value tracks the agent's portfolio of tokenized equities (NVDA, AAPL, SPY, …), priced onchain via per-asset Chainlink feeds.
The AI — an offchain LLM loop — executes trades, but never has unrestricted power: every order must pass the shared TradeGuard risk engine plus an onchain oracle-price slippage bound.
User ──deposit USDG──▶ AgentVault ──shares──▶ User
│ ▲
AI (operator) ─────┘ │ executeTrade (whitelisted router only)
│ │
▼ │
TradeGuard + PriceOracle (Chainlink, sequencer + staleness checks)
| Contract | Role |
|---|---|
| AgentVault | ERC-20 share vault per agent. Deposit/withdraw USDG, NAV via oracle, operator trades, 20% performance fee (high-water mark), drawdown peak tracking, inflation-guard dead shares. |
| AgentFactory | Deploys vaults and registers them in the registry. |
| AgentRegistry | Agent metadata + discovery (creator, vault, strategy URI, active flag). |
| TradeGuard | Shared risk rules: token whitelist, max trade size, position cap, max drawdown halt, protocol pause. |
| PriceOracle | Chainlink wrapper: 1e18-normalized USD prices, L2 sequencer uptime check, per-feed staleness heartbeat. |
executeTrade is the only trading entry point. It enforces guard rules, whitelisted venues, an oracle-implied slippage floor, and post-trade position caps. The AI cannot rug, over-lever, or trade unlisted assets.liquidate path is a future iteration).Mainnet broadcast is done by the protocol owner, never by an agent:
export PRIVATE_KEY=<your_key>
export RPC=https://rpc.mainnet.chain.robinhood.com
forge script script/Deploy.s.sol:Deploy --rpc-url $RPC --broadcast
Post-deploy configuration:
oracle.setFeed(<TOKEN>, <FEED>, 0) for every stock token — feed addresses from the Chainlink Robinhood page.guard.setWhitelistedToken(<USDG>, true) + every stock token.guard.setWhitelistedRouter(<router>, true) — Uniswap V3 router / Rialto propAMM.oracle.setSequencerUptimeFeed(<feed>) — recommended on L2.0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168 · WETH 0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73 · Uniswap V3 SwapRouter 0xE592427A0AEce92De3Edee1F18E0157C05861564 (verified deployed).| Module | Role |
|---|---|
| chain.py | Web3 client: vault state, signed executeTrade submission. |
| prices.py | RHJ REST API + onchain feed reads. |
| signals.py | Decision engine: LLMProvider (DeepSeek, Gemini fallback) + HeuristicProvider (SMA crossover, offline). |
| executor.py | Offchain guardrail mirror (watchlist, max trade, caps) before signing; dry-run or live. |
| keeper.py | NAV/drawdown monitor + liquidity sweeps. |
| cli.py | status, run, keeper, sweep, deposit, move-price, tokens. |
End-to-end demo (local anvil, reproducible): ./agent/e2e_demo.sh — verified BUY on uptrend and SELL on downtrend with real onchain transactions (status 1), plus LLM-decided live trades and keeper liquidity sweeps.
No. The operator only signs executeTrade calls that pass TradeGuard (whitelists, caps, drawdown halt) and the oracle slippage bound. There is no path to move USDG out of the vault except the owner's 20% HWM performance fee.
Onchain, from Chainlink feed prices of every tracked asset, normalized to 1e18 USD. No offchain number to fudge.
Only when the vault's NAV/share exceeds its all-time high (high-water mark), and only on the profit above it. Flat or down periods cost nothing.
Robinhood Chain has 96 tokenized equities (NVDA, AAPL, SPY, QQQ, SGOV…) as standard ERC-20s with per-asset Chainlink feeds — a permissionless, composable equities market that no other L2 offers natively.