# AI Cookbook: 10 Web3 AI Agent Prompts

Ten tested AI prompts for web3 development. Copy one into your AI agent and get a runnable dashboard, live feed, report or inbox. Free to try.

Source: https://www.quicknode.com/ai-cookbook

Every prompt on this page was written and run end to end by Ferhat Kochan, Technical Content Manager at Quicknode. Paste one into your AI agent unchanged. Placeholders wrapped in angle brackets, such as `<WALLET>`, are yours to fill in.

## Ingredients

Four things on your station.

### Node.js 20 or newer

Several recipes use only built-in Node.js APIs, so use Node.js 20 or newer.

```
node --version                        # v20+
```

### The qn CLI, installed and authenticated

Install and authenticate the qn CLI before you paste a recipe. Your Quicknode plan and API key must include the products and networks named on the recipe; check its Creates / uses line first. If a command returns 403, check the scope on your key before debugging anything else. On Linux, install the .deb, AUR or Fedora package from the CLI repo.

```
brew install quicknode/tap/qn                                          # macOS
scoop bucket add quicknode https://github.com/quicknode/scoop-bucket   # Windows
scoop install quicknode/qn
qn auth login
qn auth whoami
```

### Quicknode's agent plugin, with Quicknode MCP

Adds web3 build guidance and the Quicknode MCP server on top of the qn CLI. Recipes 07 to 10 reach Quicknode through that MCP, so connect it before running them; the other six need only the CLI. Cursor, Windsurf, VS Code, Zed, and Codex each have their own install guide in the same repo.

```
/plugin marketplace add quicknode/agent-plugins   # Claude Code
```

### A frontier reasoning model

These prompts ask an agent to resolve live contract addresses, decode event ABIs, and reconcile reorgs correctly on the first try. That's a job for your provider's current flagship model, not a fast/cheap tier. On Claude, that's Sonnet 5 or Opus 5; use the equivalent frontier model on any other provider.

Each recipe already tells the agent to test before it creates, using qn stream test-filter, which runs against a real block for free. Each one also tells the agent to verify any network or deployment it assumes with qn agent context rather than guess.

### Heads up

AI agents make mistakes. Treat a resolved contract address, a decoded event shape or a "verified" test block as a claim to check, not a fact. Read what the agent found before you activate a Stream, and never let it touch funds or production data unsupervised.

Some recipes create real resources in your account, which can use credits.

## The recipes

<a id="01-hyperliquid-stress"></a>

### Recipe 01: Hyperliquid market risk dashboard

- Makes: Dashboard
- Uses: SQL Explorer · hyperliquid-core-mainnet · local dashboard
- Creates / uses: Creates no persistent Quicknode resource. SQL Explorer queries use API credits. [Details](https://www.quicknode.com/docs/sql-explorer)

**Goal.** Rank every Hyperliquid perp market by transparent crowding and liquidation-risk signals, with direction and normalized intensity visible beside the score. Verified against live data, not just described to you.

**Prompt.**

```text
Using Quicknode SQL Explorer and the qn CLI, build and run a local Hyperliquid market-risk dashboard for the last 24 hours covering all perpetual markets. Show signed funding, open interest and its 24-hour change, trading volume, liquidation notional and count by side, and liquidation intensity relative to open interest; rank markets with a deterministic score built from percentile-ranked absolute funding, positive open-interest change, and liquidation intensity, label each leader long-crowded, short-crowded, or liquidation-heavy, show every score component, save the bounded SQL and raw results, cache the data locally, and verify the finished dashboard with live SQL Explorer data.
```

**Sample output.**

```
COIN   RISK   BIAS    FUNDING   OI CHG   LIQ/OI
BTC    0.82   LONG    +0.031%    +8.4%     2.1%
ETH    0.77   LONG    +0.024%    +5.7%     1.6%
SOL    0.61   SHORT   -0.008%    +3.2%     0.9%
```

<a id="02-aave-rate-monitor"></a>

### Recipe 02: Aave v3 USDC rate monitor

- Makes: Alert
- Uses: Streams · Key-Value Store · available on 13 networks
- Creates / uses: Creates 1 active Stream and Key-Value Store entries. Both can use API credits. [Details](https://www.quicknode.com/docs/streams/billing)
- Fill in: `<DESTINATION>`
- Networks: ethereum-mainnet, arbitrum-mainnet, avalanche-mainnet, base-mainnet, bnbchain-mainnet, celo-mainnet, gnosis-mainnet, linea-mainnet, optimism-mainnet, polygon-mainnet, scroll-mainnet, sonic-mainnet, zksync-mainnet

**Goal.** One alert when Aave v3 USDC variable-borrow APR crosses above 8%, plus a recovery alert when it falls back below, on Aave's Ethereum Core market by default. Proven by testing both crossings and running the same block twice with no duplicate alert.

**Prompt.**

```text
Using Quicknode Streams and the qn CLI, build a USDC variable-borrow APR monitor for the Aave v3 deployment on ethereum-mainnet that sends <DESTINATION> one normalized alert when the rate crosses from below 8% to 8% or above, and one recovery alert when it crosses back below. Resolve the Pool and USDC reserve from the current official Aave address book, verify their bytecode and a recent ReserveDataUpdated event, use lossless RAY conversion and Quicknode KV to seed and persist threshold state and deduplicate alerts, test below-to-above, repeated-block, and above-to-below cases, and activate the Stream from chain tip only after the checks pass.
```

**Sample output.**

```
[aave-usdc] ethereum · variable borrow
  7.96% -> 8.12% · CROSSED ABOVE 8%
  block 21,904,118 · alert sent
  threshold state written to KV
```

<a id="03-pump-fun-feed"></a>

### Recipe 03: Pump.fun new-token live feed

- Makes: Live feed
- Uses: Streams · solana-mainnet · zero-dependency Node
- Creates / uses: Creates 1 active Stream. Streams use API credits per block processed. [Details](https://www.quicknode.com/docs/streams/billing)
- Fill in: `<PUBLIC_HTTPS_URL>`

**Goal.** A web page updating as tokens are minted, with each creation's initial purchase shown when present so the feed carries useful launch context. The decode layout is verified against a real historical slot before the Stream is switched on.

**Prompt.**

```text
Using Quicknode Streams and the qn CLI, build and run a zero-dependency Node.js live feed of new Pump.fun token creations on Solana Mainnet, delivered through <PUBLIC_HTTPS_URL>/webhook. Build the authenticated webhook receiver and local web page, resolve and verify the current Pump.fun program and decoding layout, display each token's mint, creator, name, symbol, initial purchase in SOL when present, transaction signature, slot, timestamp, and explorer link, test the filter and initial-purchase decode against a real matching slot plus a nonmatching slot, test delivery to the receiver, and only then create and activate the Stream from chain tip with a batch size of 5 and elastic batching enabled.
```

**Sample output.**

```
* PUMP  9xQe..4Kd2  "Nomad"     NMD
        initial buy 2.40 SOL  creator 7bR..9pQ
* PUMP  4mLp..7Vs1  "Tidepool"  TIDE
        initial buy none  creator 2Kd..1aX
```

<a id="04-wallet-activity-inbox"></a>

### Recipe 04: Wallet activity inbox

- Makes: Inbox
- Uses: Webhooks · append-only JSONL · available on 12 networks
- Creates / uses: Creates 1 active Webhook. Webhooks use API credits per delivered payload. [Details](https://www.quicknode.com/docs/webhooks)
- Networks: ethereum-mainnet, arbitrum-mainnet, avalanche-mainnet, base-mainnet, bnbchain-mainnet, optimism-mainnet, polygon-mainnet, solana-mainnet, bitcoin-mainnet, xrp-mainnet, stellar-mainnet, hypercore-mainnet

**Goal.** A local, signature-verified inbox of everything a wallet does, on whichever of 6 chain families you pick. Replay- and duplicate-proof, tested end to end before the Webhook goes live.

**Prompt.**

```text
Using Quicknode Webhooks and the qn CLI, build and run a zero-dependency Node.js wallet activity inbox for 0x8f0d024e780b7e2fd633a4d6d43631a96e8cb059 on ethereum-mainnet. Resolve the network to its matching Webhook template — evmWalletFilter, solanaWalletFilter, bitcoinWalletFilter, xrplWalletFilter, stellarWalletTransactionsSourceAccountFilter, or hyperliquidWalletEventsFilter — rather than assuming every address is EVM. Use only built-in Node.js modules, verify webhook signatures against the raw request body, reject stale replays, deduplicate deliveries, persist events to an append-only JSONL file, and serve a local page showing incoming and outgoing transactions with counterparties, values, status, timestamps, and explorer links; test the complete delivery path before activating the Webhook.
```

**Sample output.**

```
IN    0.42 ETH    from 0x3a7e..41c8   14:02
OUT   120 USDC    to   0x1f9a..c31e   13:58
IN    0.05 ETH    from 0xd4c1..88a0   13:41
                          3 events, 0 dupes
```

<a id="05-hyperliquid-wallet-report"></a>

### Recipe 05: Hyperliquid wallet performance report

- Makes: Report
- Uses: SQL Explorer · hyperliquid-core-mainnet · 7-day report
- Creates / uses: Creates no persistent Quicknode resource. SQL Explorer queries use API credits. [Details](https://www.quicknode.com/docs/sql-explorer)

**Goal.** A readable 7-day performance and risk report for one Hyperliquid wallet, centered on net PnL after fees and funding, win rate, drawdown, market concentration, and liquidations. The totals are reconciled, not just printed.

**Prompt.**

```text
Using Quicknode SQL Explorer and the qn CLI, build a 7-day performance and risk report for Hyperliquid wallet 0xedcdcaa1f18350c50c10bef860e64daa9785d05a showing gross realized PnL, fees, funding, net PnL, trading volume, win rate, market concentration, maximum realized-PnL drawdown, top and bottom markets, and liquidation history. Save and execute the SQL, produce a readable report, and independently reconcile net PnL and volume from the underlying fills, funding payments, and account events.
```

**Sample output.**

```
7-DAY PERFORMANCE
  gross realized  +$18,402   fees       -$1,209
  funding             +$334   net PnL    +$17,527
  win rate             58.2%  max DD      -$3,104
```

<a id="06-robinhood-swap-feed"></a>

### Recipe 06: Robinhood Stock Token market tape

- Makes: Live feed
- Uses: Streams · robinhood-mainnet · block-with-receipts
- Creates / uses: Creates 1 active Stream. Streams use API credits per block processed. [Details](https://www.quicknode.com/docs/streams/billing)
- Fill in: `<PUBLIC_HTTPS_URL>`

**Goal.** A live market tape for AAPL, TSLA, NVDA, and SPY Stock Tokens across Uniswap V3 pools and the V4 PoolManager, with one UI-adjusted entry per decoded swap instead of one entry per Transfer leg.

**Prompt.**

```text
Using Quicknode Streams and the qn CLI, build and run a live market tape for canonical AAPL, TSLA, NVDA, and SPY Stock Tokens on Robinhood Chain Mainnet across Uniswap V3 pools and the V4 PoolManager. Emit one entry per decoded swap rather than per ERC-20 Transfer leg; apply each token's current UI multiplier and display buy or sell direction, share-equivalent quantity, execution price in the pool's quote asset, USD notional when a canonical price feed is available, pool version, transaction, block, timestamp, and explorer link. Deliver events to <PUBLIC_HTTPS_URL>/webhook, test matching and nonmatching historical blocks plus a multi-leg swap, and only after delivery works activate the Stream from chain tip with a batch size of 5 and elastic batching enabled.
```

**Sample output.**

```
AAPL   BUY    112.4 sh   $25.7K @ $228.61   V3
TSLA   SELL    38.0 sh   $15.7K @ $412.07   V4
NVDA   BUY     64.2 sh   $11.8K @ $184.22   V3
                         running notional $1.84M
```

<a id="07-solana-rent-recovery"></a>

### Recipe 07: Solana rent-recovery planner

- Makes: Report
- Uses: Quicknode MCP · Core RPC · solana-mainnet
- Creates / uses: Creates nothing and never submits a transaction. Read-only RPC calls can use API credits. [Details](https://www.quicknode.com/api-credits)
- Fill in: `<WALLET>`

**Goal.** Find every zero-balance SPL Token account you could safely close for rent, without signing anything. Classic accounts get closed-or-not classified outright; Token-2022 accounts go to a separate review list instead of guessing about extensions. On a real wallet this found 58 classic accounts clean to close (~0.118 SOL recoverable) and 9 Token-2022 accounts correctly held back. Several carried transfer-fee or transfer-hook extensions a naive check would have gotten wrong.

**Prompt.**

```text
Using Quicknode Core RPC through the connected Quicknode MCP and qn CLI, build and run a read-only, zero-dependency Node.js rent-recovery planner for ewcjNU4XWcwE3sJDafm43cxGsiihRmzTtX7bwMHqaEP on Solana Mainnet. Scan accounts owned by both the classic SPL Token and Token-2022 programs, find zero-balance token accounts, and classify a classic account as ready to close only when it is initialized, not wrapped SOL, has no delegate, and its effective close authority is <WALLET>; place Token-2022 accounts in a separate review list instead of guessing about extensions. Independently re-read every candidate, total its current lamports, save a JSON report and readable table with explorer links, and never construct, sign, close, or submit a transaction.
```

**Sample output.**

```
CLASSIC SPL TOKEN     58 ready to close
  recoverable         ~0.118 SOL
TOKEN-2022             9 held for review
  transfer-fee / hook  extensions found
  nothing signed, nothing submitted
```

<a id="08-solana-das-portfolio"></a>

### Recipe 08: Solana DAS portfolio page

- Makes: Dashboard
- Uses: Quicknode MCP · Core RPC · DAS API · solana-mainnet
- Creates / uses: Creates nothing. Requires an existing DAS-enabled Solana endpoint; RPC calls can use API credits. [Details](https://www.quicknode.com/docs/solana/getAssetsByOwner)

**Goal.** One page showing everything a wallet holds: SOL, fungible tokens, standard and compressed NFTs, MPL Core, and Token-2022 assets. It checks getAssetsByOwner actually works before it does anything else, and refuses to spin up a paid endpoint if DAS isn't already enabled. Cursor pagination and the compressed-NFT flag are both confirmed live against a real wallet's holdings.

**Prompt.**

```text
Using the connected Quicknode MCP, qn CLI, Core RPC, and Metaplex DAS API, build and run a zero-dependency Node.js portfolio page for ewcjNU4XWcwE3sJDafm43cxGsiihRmzTtX7bwMHqaEP on Solana Mainnet. First find an existing Solana Mainnet endpoint and prove that DAS is enabled with getAssetsByOwner; if none is available, stop and tell me exactly what must be enabled rather than creating a paid resource. Keep its RPC URL server-side, show the wallet's SOL balance, fungible tokens, standard NFTs, compressed NFTs, MPL Core, and Token-2022 assets with balances, names, images, collections, and explorer links, use cursor pagination with a configurable asset cap, cache the results, and verify the SOL balance and at least three displayed assets with independent RPC calls.
```

**Sample output.**

```
SOL BALANCE          12.4081 SOL
  fungible tokens    31
  standard NFTs      14
  compressed NFTs    226
  MPL Core / T-2022  3
  getAssetsByOwner   verified
```

<a id="09-account-usage"></a>

### Recipe 09: Account usage dashboard

- Makes: Dashboard
- Uses: Quicknode MCP
- Creates / uses: Creates nothing. Read-only Quicknode MCP access with the Viewer role is sufficient. [Details](https://www.quicknode.com/docs/build-with-ai/quicknode-mcp)

**Goal.** A read-only dashboard of your own account's usage: busiest endpoints, biggest week-over-week jumps and priciest methods. Summary and breakdown totals can differ for the same window, so the dashboard measures and reports any gap instead of forcing the numbers to match.

**Prompt.**

```text
Using the connected Quicknode MCP with Viewer access and the qn CLI, build and run a read-only, zero-dependency Node.js usage dashboard for my Quicknode account. Fully paginate the endpoint inventory; show requests and credits for the last 7 and 30 days by endpoint, chain, and RPC method; compare each endpoint's current seven days with the preceding seven; and highlight the busiest endpoints, largest increases, and highest-credit methods. Save sanitized JSON and local HTML without endpoint URLs or credentials, compare the account summary with the endpoint, method, and chain breakdown totals, report any discrepancy rather than forcing them to match, handle unavailable plan-specific data gracefully, and never modify an endpoint or account setting.
```

**Sample output.**

```
LAST 7 DAYS        requests    credits
  busiest endpoint    1.42M       418K
  week over week     +18.6%
  summary vs breakdown  5.3% apart
  reported, not reconciled
```

<a id="10-evm-balance-snapshot"></a>

### Recipe 10: Multi-network EVM balance snapshot

- Makes: Report
- Uses: Quicknode MCP · Core RPC Tooling Access
- Creates / uses: Creates no endpoint. Tooling Access must be enabled and enabling it requires an Admin role; RPC calls use API credits. [Details](https://www.quicknode.com/docs/cli/examples)
- Fill in: `<EVM_WALLET>`, `<NETWORKS>`

**Goal.** A block-pinned native-balance snapshot of one wallet across whichever EVM networks you name, discovering and validating the network keys first instead of guessing them, and reporting invalid, non-EVM, and stale networks by name instead of dropping them. Run against three real chains plus one typo'd network and Solana: the typo came back invalid_network, Solana came back non_evm, and the three real chains each returned a distinct, independently re-verified integer balance at their own block height.

**Prompt.**

```text
Using Quicknode Core RPC through the connected Quicknode MCP for discovery and the qn CLI's read-only Core RPC Tooling Access for the runnable artifact, build and run a zero-npm-dependency Node.js balance snapshot for <EVM_WALLET> across <NETWORKS>. Discover and validate the accepted network slugs and their chain families instead of guessing them, persist that family metadata in the artifact, and classify non-EVM networks before making any eth_* RPC call; for each valid EVM network retrieve its chain ID, latest block, block timestamp, and native-token balance at that exact block; preserve the exact integer balance before formatting it; and include address and block explorer links when known. Clearly report stale, invalid, non-EVM, and failed networks instead of omitting them, verify every successful result by repeating the balance read at the same block and confirming that a second block-height read did not move backward, print a readable local table, save the complete JSON snapshot, exercise both successful and failure paths, and never expose an API key or endpoint URL.
```

**Sample output.**

```
NETWORK            BLOCK         NATIVE
ethereum-mainnet   21,904,118    1.284019
base-mainnet       28,441,902    0.532117
arbitrum-mainnet   291,004,553   4.010882
example-mainnet    -             invalid_network
solana-mainnet     -             non_evm
```

## The rest of the pantry

These ten prompts use the qn CLI alongside Quicknode MCP, SQL Explorer, Streams, and Webhooks. Here's where to keep exploring.

### Quicknode MCP

Manage endpoints, usage and billing by natural language, from any MCP-compatible assistant.

```
claude mcp add --transport http quicknode \
  https://mcp.quicknode.com/mcp
```

### Blockchain Skills & agent-plugins

Structured API knowledge for coding agents, so they stop guessing at RPC methods and parameters.

```
npx skills add quiknode-labs/blockchain-skills
```

### x402

Pay per request for Core API with a wallet. No account, no API key. Coinbase's open standard.

```
npm install @quicknode/x402
```

### MPP

Machine Payments Protocol, the IETF draft from Tempo Labs and Stripe. Same idea, charge- or session-based.

```
npm install mppx viem
```

### Agent Subscriptions

Pay once via x402 or MPP and get back a full platform API key. No dashboard signup required.

Read the docs: https://www.quicknode.com/docs/build-with-ai/agent-subscriptions

### llms.txt

A machine-readable index of the whole docs site, for RAG pipelines and agent discovery.

```
curl https://www.quicknode.com/llms.txt
```

## Questions

### What do I need to run these?

Four things, all listed under Ingredients: Node.js 20 or newer, the qn CLI installed and authenticated, Quicknode's agent plugin, and a frontier reasoning model. Set them up once, then each recipe is one paste.

### Does running a recipe cost anything?

It depends on the recipe. Each card says what it creates or uses before you copy it. Streams use credits per block processed, Webhooks use credits per delivered payload, SQL Explorer and RPC calls can use credits, and read-only recipes do not create persistent Quicknode resources.

### Which AI models work?

Use your provider's current flagship model rather than a fast or cheap tier. These prompts ask an agent to resolve live contract addresses, decode event ABIs and reconcile reorgs correctly on the first try. On Claude that means Sonnet 5 or Opus 5; use the equivalent frontier model on any other provider.

### Can I edit a prompt before I run it?

Yes. Where a recipe offers a network picker, changing it rewrites the matching values inside the prompt, and the copy button always copies the version you can see. Placeholders wrapped in angle brackets are yours to fill in.

### Can I request a recipe?

Yes. Use the Request a recipe link under The rest of the pantry.
