Docs

How the pieces fit together.

Quick start

  1. Open the app and connect your wallet.
  2. Deposit into a Morpho vault on the deposit page (Ethereum mainnet).
  3. Press Start tracking yield on the dashboard, first read is your baseline.
  4. Create an agent, copy its API key (shown once), set a budget.
  5. Point your agent at the spend endpoint, example in examples/agent.ts.

Architecture

AUCTRA, architecture
Morpho (Ethereum mainnet)        Robinhood Chain mainnet (4663)
┌───────────────────┐            ┌────────────────────────┐
│ User positions    │            │ AUCTRA Credit          │
│ (custody)         │            │ mintFromYield/spendFrom│
└────────┬──────────┘            └──────────▲─────────────┘
         │ GraphQL api.morpho.org           │ viem
┌────────▼──────────────────────────────────┴──────────┐
│ backend, yield reader + agent registry + indexer    │
└──────────────────────────▲───────────────────────────┘
                 dApp (Next.js + wagmi)

Credit flow

  1. Deposit into a Morpho vault or market (in-app on the deposit page).
  2. The yield reader snapshots your positions, the first read is a baseline, never minted.
  3. When supply assets grow, the delta mints USD credits (6 decimals) to your address on Robinhood Chain.
  4. Each mint is keyed by a deterministic yieldId, retries can never double-credit.
  5. A 5% protocol fee is deducted from each mint on-chain (mintFeeBps, capped at 10%) — the credited event shows the net amount.

Agent API

Authenticate with the agent's API key (returned once at creation):

agent spend
curl -X POST $API/agents/1/spend \
  -H "X-Agent-Key: vtr_..." \
  -H "Content-Type: application/json" \
  -d '{"amountUsd": 2.5, "action": "inference"}'

Spends are checked against the agent's budget and maxSpendUsdguardrail, then burned on-chain via spendFrom.

Endpoints

POST /auth/nonce · /auth/verifywallet login → bearer token
GET /credits/:addressbalance + reports + indexed events
POST /users/:address/trackstart yield tracking (authed)
GET /users/:address/positionslive Morpho positions
POST/GET/PATCH /agents…agent CRUD + budget guardrails
POST /agents/:id/spendon-chain debit (owner or API key)
POST /agents/:id/taskone AI answer, then on-chain debit
POST /agents/:id/revoke-key · /rotate-keyAPI key lifecycle
GET /agents/:id/usage · /agents/usage-summaryspend history + 7d total
GET /arena · /services/aipublic leaderboard · task capability

Networks

CreditsRobinhood Chain mainnet · chain ID 4663 · ETH gas
Deposits (Morpho)Ethereum mainnet · chain ID 1
Morpho APIapi.morpho.org/graphql