# Agentindex

> Use when trading tokenized stocks on Robinhood Chain or reading the AgentIndex market. Live quotes, in-app Uniswap swaps, payout basket.

- Skill: `finchagentic/agentindex` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add finchagentic/agentindex`
- Raw SKILL.md: https://api.skillmd.com/api/skills/finchagentic/agentindex/raw
- Safety review: pending (external: skill-scanner WARNING, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: finchagentic (https://skillmd.com/u/finchagentic)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/finchagentic/agentindex

---


# 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])` with `value = amountIn`
- sell: `multicall([exactInput(recipient=ROUTER), unwrapWETH9])` after `approve(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.0` UA — keep it.
- `chartPreviousClose` in Yahoo's `range=1mo` response is the close ~1 month
  ago, NOT yesterday's close. Use `regularMarketChangePercent` for day change.
- wagmi's `useWaitForTransactionReceipt` misses receipts on chain 4663 —
  poll `eth_getTransactionReceipt` manually 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: false` in `/api/index` is the truth.

