Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions skills/zetta/agent-books/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# agent-books

**Luca Skills by Zetta** — Callable financial intelligence for the agent economy.

## What it does

Returns the full financial statement for a registered agent: operating revenue, expenses, net income, wallet count, transaction breakdown, and confidence signals. Only manifest-declared `eoa` and `treasury_contract` wallets are counted — no discovered wallets, no token contracts.

This is the canonical P&L for an autonomous agent on Base.

## Endpoint

```
POST https://www.zettaai.co/api/luca/skills/agent-books
```

## Auth

```
Authorization: Bearer zt_live_...
```
or
```
X-API-Key: zt_live_...
```

Get a key at [zettaai.co/developer](https://www.zettaai.co/developer).

## Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `slug` | string | Yes | Agent slug (e.g. `"aeon"`, `"luca"`) |
| `period` | string | No | Lookback window. One of: `7d`, `14d`, `30d`, `90d`. Default: `30d` |

## Output — attributed

```json
{
"skill": "agent-books",
"attributed": true,
"agent": { "name": "AEON", "slug": "aeon", "ecosystem": "AEON" },
"period": "30d",
"wallets": {
"eligible": 2,
"analyzed": 2,
"total": 5
},
"financials": {
"revenue_usd": 12450.00,
"expenses_usd": 3200.00,
"net_income_usd": 9250.00,
"gross_inflow_usd": 18000.00,
"margin_pct": 74.3,
"tx_count": 87
},
"confidence": "high",
"luca_summary": "AEON recorded $12,450.00 in operating revenue and $3,200.00 in expenses over 30d (87 transactions). Net income is positive at $9,250.00.",
"generated_at": "2026-06-23T00:00:00.000Z"
}
```

## Output — unattributed (no manifest)

```json
{
"skill": "agent-books",
"attributed": false,
"agent": { "name": "SomeAgent", "slug": "someagent" },
"reason": "No manifest-declared wallets found. Only wallets declared via .agent/wallets.json produce attributed books."
}
```

## Integrity rules

- **Only manifest-declared wallets count.** Wallets in the registry but not in `.agent/wallets.json` produce zero books.
- **Only `eoa` and `treasury_contract` address types are books-eligible.** Token contracts declared in the manifest are silently excluded.
- **`gross_inflow_usd` is not revenue.** Gross inflows include capital injections, DEX receipts, and internal transfers that are quarantined. Use `revenue-analysis` for the full breakdown.
- Internal transfers between an agent's own wallets are excluded from both revenue and expenses.
- Agent GDP counts only operating revenue — not gross inflows.

## Example

```bash
curl -X POST https://www.zettaai.co/api/luca/skills/agent-books \
-H "Authorization: Bearer zt_live_..." \
-H "Content-Type: application/json" \
-d '{"slug": "aeon", "period": "30d"}'
```

## Usage notes

- Use `registry-check` first to find the correct slug if you only have a name or wallet address
- `attributed: false` means no manifest — not a data error. The agent needs to submit `.agent/wallets.json`
- `confidence` reflects how many wallets were analyzed vs declared: `high` = all eligible wallets covered

## Limitations

- Base chain only (USDC, USDT, ETH, WETH, and the agent's own project token)
- Books do not include off-chain revenue, CEX balances, or L2 chains other than Base
- Historical data starts from when the agent was first indexed in the Zetta registry
86 changes: 86 additions & 0 deletions skills/zetta/agent-books/references/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Agent Books — API Reference

## Request

```
POST https://www.zettaai.co/api/luca/skills/agent-books
Content-Type: application/json
Authorization: Bearer zt_live_...
```

### Body

```json
{
"slug": "aeon",
"period": "30d"
}
```

| Field | Type | Required | Validation |
|-------|------|----------|-----------|
| `slug` | string | Yes | Lowercase agent slug |
| `period` | string | No | One of: `7d`, `14d`, `30d`, `90d`. Default: `30d` |

## Response — 200 OK (attributed)

```json
{
"skill": "agent-books",
"attributed": true,
"agent": {
"name": "AEON",
"slug": "aeon",
"ecosystem": "AEON"
},
"period": "30d",
"wallets": {
"eligible": 2,
"analyzed": 2,
"total": 5
},
"financials": {
"revenue_usd": 12450.00,
"expenses_usd": 3200.00,
"net_income_usd": 9250.00,
"gross_inflow_usd": 18000.00,
"margin_pct": 74.3,
"tx_count": 87,
"internal_tx_count": 4
},
"confidence": "high",
"breakdown": {
"revenue_by_source": [
{ "source": "0x...", "label": "External", "amount_usd": 12450.00 }
],
"expenses_by_category": [
{ "category": "inference", "amount_usd": 2100.00 },
{ "category": "gas", "amount_usd": 1100.00 }
]
},
"luca_summary": "AEON recorded $12,450.00 in operating revenue and $3,200.00 in expenses over 30d (87 transactions). Net income is positive at $9,250.00.",
"generated_at": "2026-06-23T00:00:00.000Z"
}
```

## Response — 200 OK (unattributed)

```json
{
"skill": "agent-books",
"attributed": false,
"agent": { "name": "SomeAgent", "slug": "someagent" },
"reason": "No manifest-declared wallets found. Only wallets declared via .agent/wallets.json produce attributed books."
}
```

## Error responses

| Status | Body | Cause |
|--------|------|-------|
| 400 | `{"error": "slug is required"}` | Missing slug |
| 400 | `{"error": "period must be 7d, 14d, 30d, or 90d"}` | Invalid period |
| 401 | `{"error": "Invalid API key."}` | Bad auth |
| 404 | `{"error": "Agent 'x' not found. Use registry-check skill to find the correct slug."}` | Agent not in registry |
| 429 | `{"error": "Rate limit reached..."}` | Rate limit |
| 500 | `{"error": "..."}` | Books computation failed |
137 changes: 137 additions & 0 deletions skills/zetta/b20-token-analysis/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# b20-token-analysis

**Luca Skills by Zetta** — Callable financial intelligence for the agent economy.

## What it does

Analyses a B20 token on Base: identity, issuer wallet, linked agent, manifest attribution status, mint/burn activity, and a Luca narrative read. Enforces strict data integrity — token transfers are not revenue, token contracts are not operator wallets, and B20 activity is excluded from Agent GDP.

Use this to understand a token's on-chain provenance and its relationship to an agent's financial identity, without conflating token activity with operating revenue.

## Endpoint

```
POST https://www.zettaai.co/api/luca/skills/b20-token-analysis
```

## Auth

```
Authorization: Bearer zt_live_...
```
or
```
X-API-Key: zt_live_...
```

Get a key at [zettaai.co/developer](https://www.zettaai.co/developer).

## Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `address` | string | Yes | Token contract address (0x...) |
| `agent_slug` | string | No | Optional agent slug to correlate with |
| `period` | string | No | Activity period label (informational only, does not filter data) |

## Output

```json
{
"skill": "b20-token-analysis",
"token": {
"address": "0x...",
"name": "AEON Token",
"symbol": "AEON",
"decimals": 18,
"total_supply": "1000000000000000000000000",
"chain": "base",
"deployed_block": 12345678,
"issuer_wallet": "0x...",
"owner_wallet": "0x...",
"books_eligible": false,
"books_eligible_note": "Token contracts are never books-eligible"
},
"linked_agent": {
"name": "AEON",
"slug": "aeon",
"link_method": "known_token",
"link_confidence": "confirmed",
"note": null
},
"manifest_status": "attributed",
"manifest_note": "Issuer wallet is manifest-attributed",
"activity": {
"mint_count": 12,
"burn_count": 3,
"mint_volume_raw": "50000000000000000000000",
"burn_volume_raw": "1000000000000000000000",
"recent_mints": [...],
"recent_burns": [...],
"last_activity_at": "2026-06-20T14:22:00.000Z"
},
"luca_read": "AEON Token (AEON) is a confirmed B20 asset linked to AEON via registry. 12 mint events and 3 burn events detected. Issuer wallet is manifest-attributed. Financial books require separate wallet attribution.",
"limitations": [
"Token transfers are not operating revenue",
"Token contract is not an operator wallet",
"Issuer wallet (0x...) is not books-eligible unless declared in agent manifest",
"B20 activity is not included in Agent GDP",
"Holder concentration analysis requires a full transfer scan — not available in this endpoint"
],
"data_integrity_warnings": [
"gross_inflow_usd from token transfers ≠ operating revenue",
"Do not count B20 mint events as agent revenue",
"Token issuance is a financial event but not a revenue event"
],
"generated_at": "2026-06-23T00:00:00.000Z"
}
```

### `manifest_status` values

| Value | Meaning |
|-------|---------|
| `attributed` | Issuer wallet is manifest-declared and confirmed |
| `candidate` | Issuer wallet matches a registry agent but manifest is not submitted |
| `none` | No agent link found |

### `link_method` values

| Value | Meaning |
|-------|---------|
| `known_token` | Token is declared in the agent's registry entry |
| `manifest` | Linked via `.agent/wallets.json` declaration |
| `erc8004` | Linked via ERC-8004 identity record |
| `admin` | Manually linked by Zetta admin |
| `none` | No confirmed link |

## Integrity rules

- `books_eligible: false` is hardcoded — token contracts are **never** books-eligible, regardless of manifest
- Token transfers (mint, burn, transfer events) are **not** operating revenue
- The issuer wallet is **not** automatically attributed — it must be declared in `.agent/wallets.json` to produce books
- B20 activity does not enter Agent GDP calculations
- `manifest_status: "attributed"` only applies to the token's agent link — not to the token contract itself

## Example

```bash
curl -X POST https://www.zettaai.co/api/luca/skills/b20-token-analysis \
-H "Authorization: Bearer zt_live_..." \
-H "Content-Type: application/json" \
-d '{"address": "0xb2b335f832fd3f43461ebd1cd9831d93d9ca4ba3"}'
```

## Usage notes

- If the token is already indexed in the Zetta B20 database, cached identity is used and only activity is fetched live — faster response
- If not indexed, a live Alchemy lookup is performed — slightly higher latency
- `luca_read` is a data-derived narrative — not a generative AI response
- `data_integrity_warnings` and `limitations` are always present — they are not error states

## Limitations

- Base chain only
- Activity scan covers recent mint/burn events; full historical activity requires a separate scan
- Holder distribution and concentration data are not available in this endpoint
- Token price data is not included
Loading
Loading