# Indexio Agent Trading Guide (Base Mainnet)

**Indexio offers public discovery and unsigned trade preparation, not a hosted bot or trading recommendation.** Your agent's own wallet must validate, sign and broadcast transactions. Base chain ID is `8453`; settlement is native Base USDC (6 decimals). No custody, API keys or private-key uploads.

## Endpoints

- `GET /api/agent/capabilities` — current contract addresses, routing and limitations.
- `GET /api/agent/markets?limit=6` — most recent current-vault indexes, with `nextCursor` pagination. `buyStatus: quote_required` **does not** establish an executable trade. Failed chain reads return `503`, never an empty market.
- `GET /api/indexio/protocol-status` — live readiness verification.
- `GET /api/registry` — asset registry.
- `GET /api/lending/opportunities` — discovery only; no lending actions.
- `GET /api/agent/openapi` — machine-readable API description.
- `POST /api/agent/quote` — prepare an exact-amount ERC-20 approval or a freshly simulated execution transaction.
- `GET /api/agent/portfolio?wallet=0x...&vault=0x...` — read an index position at a Base block; omit `vault` and paginate with `limit` and `cursor` to discover wallet-held current-factory index positions. No invented cost basis or market value.
- `POST /api/agent/performance` — verify up to 16 supplied Base transaction receipts and derive a **clearly incomplete-history** fill ledger and costs.
- `POST /api/agent/exit-estimate` — obtain fresh protected USDC sell proceeds for an entire or partial share position, and simulated unsigned calldata only when already approved.

## Prepare a buy

1. Discover a `vault` from `/api/agent/markets`. Set your **agent wallet address**, not Indexio's treasury, as `wallet`.
2. POST the following JSON (100 USDC):

```json
{"mode":"buy","vault":"0xYOUR_CURRENT_VAULT","wallet":"0xYOUR_SIGNING_WALLET","settlementAmount":"100000000","maxRefundBps":500}
```

3. Inspect `status`:
   - `approval_required`: only one ERC-20 approval is returned for the **exact input amount**. Sign it, wait for a **successful** Base receipt, and then call the quote endpoint again. Do not send any buy transaction from a previous quote.
   - `ready`: use the signed-wallet policy to validate `chainId`, `router`, `transactions[0].to`, `data`, `value`, spending limits, `quoteExpiresAt`, and the quoted minimum. Execute promptly, otherwise re-quote.
4. Wait for a successful execution receipt and compare onchain events, token balances and final net shares. A transaction hash without a success receipt is not confirmation.

**Regular buys** use the V3.3.8 adaptive router and simulate `buyExistingIndex` before a transaction is returned. `maxRefundBps` is a refund tolerance, *not* a max slippage or maximum-loss limit. Fees, swap price impact, taxed tokens and execution gas affect realized results.

## Seed and sell

- First seed: `{"mode":"seed","vault":"0x...","wallet":"0x...","settlementAmount":"25000000"}`. 25 USDC protocol minimum; some asset mixes require more for routes.
- Sell: `{"mode":"sell","vault":"0x...","wallet":"0x...","shares":"1000000000000000000"}`. Shares use 18 decimals. Indexio can prepare a protected USDC redemption only where routes exist. Some assets have transfer taxes; a displayed estimate is not a guaranteed payout.
- Seed and sell execute against the existing original V3 router, not the adaptive buy router.

## Strategy economics

Indexio is better suited to portfolio-allocation or periodic rebalancing agents than frequent scalping. The fixed index protocol fee is 1% on entry and 1% on exit, and vault creator entry/exit fees can each reach another 1%. A round trip can therefore face 2–4% of index fees before Base gas, swaps, price impact, taxes and execution variation. Review the vault-specific creator fee returned by discovery or the quote. Indexio does not have a hidden agent fee discount.

## Controls your agent should enforce

- Use a dedicated, funded wallet with a limited budget and explicit allowlists for routers and tokens. Keep signing credentials out of model prompts and external API calls.
- Set maximum spend per transaction/day and a maximum position per index. Verify exact token addresses, recipient and transaction target. Do not blindly execute model-generated calldata.
- Stop on `429`, `502` and `503` instead of looping or interpreting errors as "zero liquidity." Public quote requests are limited to 60 per hour and 8 KiB per request.
- Re-quote on approval, expiry, reorg, changes in balances or allowance, or a changed market. Never retry a broadcast before checking wallet nonce and receipt.
- Avoid unbounded unattended execution. Simulations, quotes and API responses are **not** security audits or guarantees of completion.

## Base ecosystem

Indexio's HTTPS API can be called by custom bots, EVM wallet libraries and agents using Coinbase AgentKit/CDP wallets where supported. **It is not a hosted AgentKit strategy, Base MCP server or x402 trading endpoint.** ERC-8004 registration is not claimed. You are responsible for agent permissions, regulatory requirements and trading behavior.

More: https://www.indexio.world/agents


## Position, cost-basis and exit workflow

1. Discover current-factory holdings with `GET /api/agent/portfolio?wallet=0xYOUR_WALLET&limit=6` (follow `nextCursor` until null), then read a vault-specific position (no wallet connection/signature is required for public onchain balances):

```http
GET /api/agent/portfolio?wallet=0xYOUR_WALLET&vault=0xCURRENT_VAULT
```

Balances are integer base units (shares 18 decimals, USDC 6 decimals). A zero cost basis or USD valuation is **not inferred** from the initial index share price or browser-local activity history. The response includes the observed Base block, current share supply and current index fees.

2. To reconstruct execution costs from your **known** trades, supply up to 16 successful router transaction hashes:

```json
{"wallet":"0xYOUR_WALLET","vault":"0xCURRENT_VAULT","transactionHashes":["0x64-character-transaction-hash"]}
```

`POST /api/agent/performance` verifies every hash, receipt status, router, share-token and USDC `Transfer` logs, and returns net actual USDC/share movements and the transaction's native gas in wei when this wallet paid gas. Weighted-average remaining cost basis and realized trading P&L can be calculated **for the supplied history only**. They remain `null` if the provided fills cannot be reconciled to the present share balance. Even if they reconcile, lifetime completeness is **never** claimed: omitted historical buys, sells, swaps or incoming/outgoing share transfers can change the result. This is not a tax ledger. Fees embedded in actual fills are not misrepresented as separately itemized protocol charges; ETH gas is not converted to USD without a verified gas-price source.

3. Request fresh USDC exit economics:

```json
{"wallet":"0xYOUR_WALLET","vault":"0xCURRENT_VAULT"}
```

`POST /api/agent/exit-estimate` uses the original protected sell router and returns `projectedUsdcBaseUnits`, `minUsdcBaseUnits`, fee BPS, `quoteExpiresAt`, and `approvalRequired`. Omit `shares` for a full exit, or supply an 18-decimal base-unit amount. The quoted minimum is only a **pre-trade protected threshold**, not a promise of profitability. If approval is missing, the response has **no** execution calldata: sign a separate, exact-amount share approval under your wallet policy and request an entirely new estimate after confirmation. If approved, a passed simulation is required before unsigned execution calldata is returned. Never broadcast after quote expiry or retry a transaction before reconciling its nonce/receipt.

The V3 factory and each vault define the eligible index universe. Current API responses contain no private keys, no signed transactions, no personal user notes and no discretionary trade decisions. Endpoint usage is rate-limited.


## Live connection check (not a trading guarantee)

`GET /api/agent/status` reports a recent Base block, the expected chain ID,
and whether factory bytecode is present. It is cached for 30 seconds on each
server instance and is not a liquidity or execution certificate. Use
`GET /api/agent/markets?limit=3` to discover indexes, then request a fresh
wallet-specific quote before executing. Rate limits are enforced.

A compact discovery manifest is served at
`/.well-known/indexio-agent.json`. This is descriptive API metadata, not an
A2A endpoint, MCP tool server or an ERC-8004 registered identity.
