---
name: block0-onchain-intelligence
version: 2026-07-07.2
description: Agent-native Smart Wallet and Smart Money aggregate intelligence over x402. No raw trade feeds, no API keys or accounts — pay per successful request with Base USDC via x402.
---

# block0 Skill

Paid Smart Wallet / Smart Money aggregate intelligence over x402. The agent owns
its wallet, signs locally, and pays per successful response with USDC on Base
mainnet.

## Rules

- Do not ask for or store a block0 API key.
- `~/.block0/.env` stores **only** `BLOCK0_WALLET_PRIVATE_KEY`.
- Default funding path: **USDC on Base mainnet**. ETH can be `0` for x402 exact EIP-3009 payments.
- After bootstrap, do not run paid queries until the human confirms the wallet is funded.
- block0 returns aggregate intelligence only; do not ask it for raw trade/transfer rows.
- After every paid query, append the one-line billing footer at the very end of your response.

## Discover

`<BLOCK0_URL>` is the host you installed against. Discovery is authoritative for current prices, `network`, `asset`, `payTo`, and resources.

```bash
curl -s <BLOCK0_URL>/.well-known/x402
curl -s <BLOCK0_URL>/v1/catalog
```

## Install / update client

Recommended safe path: download the installer, review it, then run it.

```bash
curl -fsSL <BLOCK0_URL>/client/install.sh -o /tmp/block0-install.sh
less /tmp/block0-install.sh
BLOCK0_URL=<BLOCK0_URL> bash /tmp/block0-install.sh
```

The installer creates `~/.block0`, installs npm dependencies for the local x402
client, downloads `wallet.mjs` and `query.mjs`, and creates or migrates a local
agent wallet. It does **not** upload your private key and does **not** run paid
queries by itself.

## Funding handoff

Run after install, then stop and wait for the human to confirm funding before any paid call:

```bash
cd ~/.block0/client
node wallet.mjs
node query.mjs --version
```

Show the wallet status, then ask the user to send USDC to the address **on Base mainnet only**. Do not run any paid query until the human confirms.

## First query: ask, don't auto-run

Once funding is confirmed, do **not** immediately fire a query. Present the user
a choice first and let them pick what to test. The endpoints map to one
copy-trading journey — discover who is smart, understand a wallet, watch what
they are buying now, and check whether the signal has paid off. Use your host's
interactive prompt (e.g. an AskUser-style question) with these options:

1. **Find smart wallets** — `/v1/smart-wallets` ($0.03) — rank behavior-derived smart wallets on a chain.
2. **Understand a wallet + its trajectory** — `/v1/wallet/dna?trajectory=true` ($0.03, needs a wallet) — six-dimension profile plus daily score/activity history.
3. **Copy-trade board (one call)** — `/v1/smart-money/signals` ($0.05) — what the cohort is buying now PLUS how that signal has paid off. Start here to follow smart money.
4. **See what smart money is buying now** — `/v1/smart-money/netflow` ($0.05) — cohort net buy/sell by token (raw ranked list).
5. **Catch fresh moves (15m)** — `/v1/smart-money/activity` ($0.05) — where smart wallets just became active.
6. **Check if the signal pays off** — `/v1/smart-money/backtest` ($0.05) — the cohort's realized P&L and forward-return track record.
7. **Due-diligence one token** — `/v1/token/smart-exposure` ($0.05, needs a token) — smart holders, flow, buyer/seller quality.

State the per-call cost in the prompt so the user opts into the spend. Only run
the endpoint the user selects, with whatever address/parameters their choice
requires. If they decline, stop without spending.

## Run paid query

Only after the human confirms funding **and** picks a query:

```bash
node ~/.block0/client/query.mjs "/v1/smart-money/activity?window=15m&limit=10"
```

Each paid call emits `BLOCK0_BILLING_SUMMARY` on stderr. Parse it and append one line at the very end of your response:

```text
Billing: <costUsdc> USDC charged · balance <balanceBeforeUsdc> → <balanceAfterUsdc> · <paymentStatus> · tx <settlementTx>
```

Use `unknown` for missing fields; shorten tx hashes. Full billing details are available on request only.

## Present results

Do not paste raw JSON as the main answer unless asked. Use:

```md
## block0 result

**Answer:** <one sentence>

### Key findings
- 2–5 useful bullets

### Top results
| # | Entity | Signal | Value | Notes |
|---|--------|--------|-------|-------|

### Notes
- Filters: `...`
- Next useful query: `...`

---
<billing footer>
```

Formatting rules:

- ≤10 rows; addresses truncated `0x1234…abcd`; missing fields as `—`.
- USDC/USD clear; percentages 2 decimals. Do not infer facts not in the response.
- For errors, show status, message/code, `Charged? No` unless settlement succeeded, and a recovery hint.

## Tools / Endpoints

All endpoints require a `chain` parameter and are billed per successful response.
Pass `estimate_cost=true` for a free price quote with no query and no charge.

**Supported chains:** `base`, `ethereum`, `bnb`, `polygon`, `solana`

Address format is chain-native: EVM chains (`base`, `ethereum`, `bnb`,
`polygon`) use `0x` hex addresses; `solana` uses base58 addresses/mints.

The six endpoints form one copy-trading journey. Follow the steps in order, or
jump to any step:

| Step | Goal | Endpoint | Price |
|---|---|---|---|
| 1. Discover | Find smart wallets on a chain | `GET /v1/smart-wallets?chain=base&min_score=70` | $0.03 |
| 2. Understand | Profile one wallet + its history | `GET /v1/wallet/dna?chain=base&wallet=0x...&trajectory=true` | $0.03 |
| 3. Copy-trade | What they buy now + has it paid off (one call) | `GET /v1/smart-money/signals?chain=base&window=1h` | $0.05 |
| 3a. Signal | Raw netflow ranking by token | `GET /v1/smart-money/netflow?chain=base&window=1h` | $0.05 |
| 3b. Signal | Where smart wallets just became active | `GET /v1/smart-money/activity?chain=base&window=15m` | $0.05 |
| 4. Verify | Does the signal actually pay off? | `GET /v1/smart-money/backtest?chain=base` | $0.05 |
| — Token DD | One token's smart exposure | `GET /v1/token/smart-exposure?chain=base&token_address=0x...` | $0.05 |

**Start with the copy-trade board (step 3):** `/v1/smart-money/signals` fuses
"what is the cohort net-buying now" with "how has copying this cohort paid off"
in one call — the fastest path to a follow decision. Drop to `netflow`/`activity`
for the raw ranked lists, or `backtest` for the full track record.

**When to use netflow vs activity (step 3):** `netflow` ranks tokens by the
cohort's net buy/sell over a window (the copy-trade shortlist — start here).
`activity` surfaces where smart wallets *just* became active in the last few
minutes (momentum/fresh moves). netflow answers "what are they accumulating",
activity answers "what are they touching right now".

**Trajectory (step 2):** add `trajectory=true` to `/v1/wallet/dna` to also get
`score_trajectory` (the wallet's real retained daily smart_score, growing one
point per day) and `activity_trajectory` (per-day traded_usd / net_flow /
token_count rebuilt from full flow history — shows if a wallet is heating up or
cooling down).

**Backtest (step 4):** returns two honestly-separated metrics — `realized_pnl`
(the cohort wallets' own median ROI and profitable share) and `forward_signal`
(if you copied the daily net-buy signal, median price move 1–3 days later).
Window is short; treat as directional, not a verdict.

Default windows:

```text
activity: 15m
netflow: 1h
token exposure: 15m + 1h + 4h + 24h
wallet DNA: 30d behavior profile
backtest: signal-day → 1/2/3 days forward
```

DNA fields: `intelligence`, `reputation`, `mass`, `epoch`, `flow`, and `maker_presence`.
