AgentIndex
AgentIndex is an open index of AI agents plus a tokenized-stock basket on Robinhood Chain (chainId 4663). This skill teaches an agent to read the index, fetch live market data, and execute swaps against it.
Backend default: http://localhost:8000 (override with AGENTINDEX_API_URL).
All endpoints are public read-only except memory writes, which need a
wallet signature.
When to use
- The user asks about tokenized stocks on Robinhood Chain / AgentIndex
- You need live quotes, movers, or sector performance for the ~193-instrument universe
- You need to explain or verify the $AIX payout loop
- You need to build or explain an in-app Uniswap v3 swap on chain 4663
Quick reference
| Need | Call |
|---|---|
| Index composition (193 stocks) | GET /api/index |
| Payout basket (19 weighted) | GET /api/index/payout-basket |
| Live quotes + sparklines | GET /api/market/quotes?symbols=NVDA,AAPL |
| Top gainers/losers (full universe) | GET /api/market/movers?limit=10 |
| Sector heat | GET /api/market/sectors |
| One symbol's chart | GET /api/market/chart/NVDA?tf=1mo |
| Swap quote | GET /api/trade/quote?token=0x..&side=buy&amount=<wei> |
| Chain/gas status | GET /api/trade/status |
| Distribution feed | GET /api/distributions |
| Agent list | GET /api/agents |
Full endpoint docs with examples: see references/api.md.
Swap execution patterns (router, multicall, CORS, receipts): see
references/swap.md.
The two lists (do not conflate)
- Payout basket — 19 instruments (
/api/index/payout-basket). Curated, weighted (NVDA 14.2% … USAR 1.3%, sums to 100). This is what $AIX holders are paid in. - Tradeable universe — 193 instruments (
/api/index). Everything the app covers for trading and analysis. Does NOT pay distributions.
The payout loop
Fees from agent work → index vault → keeper buys the 19-instrument basket
→ each cycle pushes every holder their pro-rata slice. No claim screen,
no lockup. The keeper publishes a public JSON snapshot; the backend reads
it via AGENTINDEX_FEED_URL and serves it at /api/distributions.
live: false means no feed is configured yet — that is honest, not an error.
Trading
Swaps execute on Uniswap v3 (SwapRouter02 0xcaf681a66d020601342297493863e78c959e5cb2).
The browser cannot always eth_call the public Robinhood RPC (CORS), so
quotes come from /api/trade/quote server-side. The transaction is built
client-side and signed by the user's wallet — never a server key.
- buy:
multicall([exactInput, refundETH])withvalue = amountIn - sell:
multicall([exactInput(recipient=ROUTER), unwrapWETH9])afterapprove(ROUTER, max)
Never call wrapETH before exactInput — it reverts with STF.
Pitfalls
- Yahoo upstream rejects long desktop UA strings from datacenter IPs (429).
The backend uses the short
Mozilla/5.0UA — keep it. chartPreviousClosein Yahoo'srange=1moresponse is the close ~1 month ago, NOT yesterday's close. UseregularMarketChangePercentfor day change.- wagmi's
useWaitForTransactionReceiptmisses receipts on chain 4663 — polleth_getTransactionReceiptmanually every ~4s. - All quotes are "Robinhood Token" tokenized instruments, not equity shares.
- $AIX itself is not deployed yet ("Cooming soon"); do not invent a price,
balance, or APY for it.
aix_deployed: falsein/api/indexis the truth.