
Agent Cookbook: Prompts for Coding Agents
Twelve copy-ready prompts for Claude Code, Codex, and Cursor. Build trading feeds and dashboards for Robinhood Chain, Base, Hyperliquid, and Polygon on Dwellir.
Pick a recipe, fill in the fields, and paste the prompt into Claude Code, Codex, Cursor, or any agent that can run shell commands. Each prompt names the Dwellir product to use, the output to build, the decoding rules that agents often get wrong, and the checks to run on real data before the tool goes live.
We ran every prompt in a separate agent session against live Dwellir endpoints, twice, and folded what broke back into the prompts: field names, units, contract addresses, endpoint hosts, and edge cases the first versions missed.
Before you start
curl -fsSL https://raw.githubusercontent.com/dwellir-public/cli/main/scripts/install.sh | shdwellir auth loginclaude mcp add --transport http --scope user dwellir https://mcp.dwellir.com/mcp
The prompts call dwellir project setup --chain <chain> --network Mainnet with --key-name to reuse one of your keys or --create-key to make one. It writes DWELLIR_API_KEY, DWELLIR_RPC_URL, and DWELLIR_WSS_URL into .env. The key stays out of the chat and out of git. Use Node.js 22 or later. It has a built-in WebSocket client, so most recipes need no npm packages.
Four recipes need an add-on
The liquidation tape, the funding board, and the TWAP tracker need the Hyperliquid gRPC add-on. The top-of-book tape needs the Order Book add-on. See Hyperliquid pricing.
Recipes
- 01Robinhood Stock Token market tapeRobinhood Chain · Live feed
- 02Hyperliquid liquidation tapeHyperliquid · Live feed
- 03Hyperliquid top-of-book and trades tapeHyperliquid · Live feed
- 04Hyperliquid wallet risk reportHyperliquid · Report
- 05Dwellir usage and error dashboardMulti-chain · Dashboard
- 06Multi-chain EVM balance snapshotMulti-chain · Report
- 07Robinhood Stock Token premium boardRobinhood Chain · Dashboard
- 08Base flashblock swap tapeBase · Live feed
- 09Hyperliquid funding and open interest boardHyperliquid · Dashboard
- 10Polymarket large-fill tapePolygon · Live feed
- 11Hyperliquid TWAP trackerHyperliquid · Live feed
- 12Base new pool launch feedBase · Live feed
Robinhood Stock Token market tape
A local tape of Stock Token swaps across Uniswap v3 pools and the v4 PoolManager. One row per decoded swap, with the token UI multiplier applied and USD notional from Chainlink.
- Robinhood Chain
- RPC + WebSocket
- eth_getLogs
Developer plan or higher for the eth_getLogs backfill. 1 API credit per response or WebSocket message. Robinhood Chain plans →
Using the Dwellir CLI and Dwellir's Robinhood Chain archive endpoint, build and run a zero-dependency Node.js live market tape for the canonical <TICKERS> Stock Tokens on Robinhood Chain mainnet (chain ID 4663) across Uniswap v3 pools and the Uniswap v4 PoolManager. Run `dwellir project setup --chain robinhood --network Mainnet --node-type Archive` with --key-name set to one of my existing keys (or --create-key with a new name) so the RPC and WSS URLs go into .env, and never print the API key. The .env values are single-quoted, so strip the quotes, and never let a URL reach an error message. Resolve each token address from the Robinhood assets API (api.robinhood.com/rhj/assets) and confirm it with a live eth_call. Take the Uniswap v3 factory, PoolManager, and StateView addresses for chain 4663 from Uniswap's deployments list, and pair each token with native ETH, WETH, and USDG (0x5fC5360D0400a0Fd4f2aF552ADd042D716F1D168, 6 decimals). Find v3 pools through the Uniswap v3 factory and reject forks that emit the same Swap topic by checking factory() on the emitting contract. For v4, compute each PoolId as keccak256 of the PoolKey (sorted currencies, fee, tickSpacing, hooks set to the zero address; native ETH is the zero address) and keep the ones where StateView.getSlot0 is non-zero. Emit one entry per decoded swap, never one per ERC-20 Transfer leg. Read each token's uiMultiplier() and show buy or sell direction, share-equivalent quantity (raw amount x uiMultiplier), execution price in the pool's quote asset, USD notional from the token's Chainlink feed when one exists, pool version, transaction hash, block, timestamp, and a Blockscout link. Take Chainlink feed proxies from reference-data-directory.vercel.app/feeds-robinhood-mainnet.json. The feed price already includes the multiplier, so do not apply it twice, and omit USD notional while the token's oraclePaused() is true. v4 Swap amounts use the swapper's sign convention, the opposite of v3, so flip them before reusing v3 logic, and decode the int128 amounts as sign-extended 256-bit words. Subscribe to logs over WSS, persist the last processed block, and after every reconnect backfill the gap with eth_getLogs in windows of at most 10,000 blocks. The archive node can lag the socket by a moment, so retry eth_call and eth_getBlockByNumber for a block that just arrived. Show price as the quote amount divided by the share-equivalent quantity, and include a small pure-JS keccak256, because Node's crypto has none. Before going live, decode one historical block with a matching swap, one without, and one transaction that swaps through two pools, and show me the rows for each. Then serve the tape on a local web page from the chain tip.Checks before it runs live
- A block with a swap produces the right rows and a block without one produces none.
- A two-pool swap produces one row per pool.
- A reconnect backfills every missed block.
Hyperliquid liquidation tape
Every Hyperliquid liquidation as it happens, with the liquidated account, notional, and a rolling one-hour total by coin and side. Sequence gaps are detected and refilled.
- Hyperliquid
- gRPC V3
- StreamLiquidationFills
Hyperliquid gRPC add-on, $299/month on an API plan. 1 API credit per streamed message. gRPC access →
Using Dwellir's Hyperliquid V3 gRPC API, build and run a Node.js live liquidation tape for Hyperliquid perpetuals. Download https://www.dwellir.com/docs/hyperliquid/grpc/v3.proto and load it at runtime with @grpc/proto-loader (keepCase: true). Connect over TLS to api-hyperliquid-mainnet-grpc.n.dwellir.com:443 (listed by `dwellir endpoints search hyperliquid` as Hyperliquid HyperCore gRPC), read DWELLIR_API_KEY from .env, send it only in the x-api-key metadata header (not in the path the CLI shows), and never print it. Call ListFeeds on the HyperliquidL1Gateway service first to confirm access. Subscribe to MarketStreaming.StreamLiquidationFills for <COINS>; for all coins, send an empty coins list. For each fill show coin, side, price, size, USD notional, the liquidated account from fill.liquidation.liquidated_user (not fill.user), block number, block time, and a link to app.hyperliquid.xyz/explorer/address/ for the liquidated account. Each liquidation appears on the fills of both sides, so count notional only from the fill whose user equals the liquidated user, and keep a rolling one-hour total by coin and side. The stream sends a frame for nearly every block, usually with no fills; skip empty frames but track block number and sequence on every frame. Detect loss through the per-subscription sequence value, which restarts at 1 on every connection: on a sequence gap, an ABORTED status, or a reconnect, recover the blocks between the last processed block and the new stream's first block with GetFills (raw JSON, field liquidation.liquidatedUser) before printing new rows. Before leaving it running, find one recent block with a liquidation (if none happens live, replay StreamFills with a coins filter from up to three hours back) and one without, run both through the decoder and filter, then force one reconnect and show the recovered block range.Checks before it runs live
- The filter matches a block with a liquidation and skips one without.
- The liquidated account comes from the liquidation field, not the fill user.
- A forced reconnect recovers every missing block.
Hyperliquid top-of-book and trades tape
Best bid, best ask, spread, and every trade for the coins you pick, with feed lag measured as p50 and p95 per coin.
- Hyperliquid
- Order Book WebSocket
- bbo + trades
Hyperliquid Order Book add-on, $199/month on an API plan. 1 API credit per streamed message. Order Book access →
Using Dwellir's Hyperliquid Order Book WebSocket (wss://api-hyperliquid-mainnet-orderbook.n.dwellir.com/$DWELLIR_API_KEY/ws), build and run a zero-dependency Node.js terminal tape for <COINS>. Read DWELLIR_API_KEY from .env and never print it or the full URL. Subscribe with {"method":"subscribe","subscription":{"type":"bbo","coin":"BTC"}} for each coin, and the same with type trades. bbo data is {coin, time, bbo: [bid, ask]} with each side {px, sz, n} or null, and trades data is an array of {coin, side, px, sz, time, tid}. Show best bid, best ask, mid, spread in basis points, and every trade with side (B is buy, A is sell), price, size, USD notional, and trade time. Measure lag as receive time minus data.time for bbo and minus the newest trade time in each trades batch, print p50 and p95 per coin every 30 seconds, and note that lag includes local clock skew. Reconnect with exponential backoff, resubscribe after each reconnect, and mark the reconnect on the tape. Write every message to an append-only JSONL file. An unknown coin comes back as {"channel":"error","data":"Invalid subscription: {...}"}; expect one error per subscription type, read the coin from the JSON after 'Invalid subscription: ', report it, and drop that coin from resubscription. Add a --drop-at=SECONDS flag that closes the socket once and a --duration=SECONDS flag that prints a summary and exits. Before leaving it running, test one valid coin and one coin name that does not exist in the same session, then run for two minutes with --drop-at=60 and report message counts, lag percentiles, and reconnects.Checks before it runs live
- A valid coin streams and an unknown coin fails with a clear message.
- Subscriptions come back after a reconnect.
- Lag percentiles come from measured timestamps.
Hyperliquid wallet risk report
Account value, margin, positions, distance to liquidation, spot balances, open orders, and fee tier for one wallet. PnL and margin totals are recomputed and any mismatch is listed.
- Hyperliquid
- Info endpoint
- Read-only
Standard API plan. About four Info requests per run, 1 API credit each. Info endpoint →
Using Dwellir's Hyperliquid Info endpoint (https://api-hyperliquid-mainnet-info.n.dwellir.com/$DWELLIR_API_KEY/info), build and run a read-only, zero-dependency Node.js risk report for a Hyperliquid wallet passed as a command-line argument, starting with <WALLET>. Read DWELLIR_API_KEY from .env and never print it. Query clearinghouseState, spotClearinghouseState, openOrders, and userFees. Show account value, total margin used, withdrawable balance, and for each perpetual position (szi is the signed size): coin, side, size, entry price, mark price derived from positionValue divided by size, unrealized PnL, leverage, liquidation price, and distance to liquidation in percent ((mark - liq) / mark for longs, (liq - mark) / mark for shorts). liquidationPx can be null, and cross-margin liquidation prices are account-wide, so far-away values are normal. Add spot balances, open orders (side B is buy, A is sell) with price and size, and fees: taker userCrossRate, maker userAddRate, activeStakingDiscount, and the VIP tier found by comparing the sum of userCross plus userAdd across dailyUserVlm with feeSchedule.tiers.vip ntlCutoff. Show fee rates as percentages; maker rates can be negative. Flag every position within 10 percent of its liquidation price. Reconcile the report: compare the sum of position margins with marginSummary.totalMarginUsed, recompute unrealized PnL from size and the mark and entry prices, and list any difference above 0.1 percent, treating differences under $1 as rounding. entryPx is rounded to five significant figures, so for low-priced coins also show the implied entry (mark - unrealizedPnl / szi). Save the raw responses as JSON and the report as Markdown. Never construct, sign, or send an exchange action.Checks before it runs live
- Recomputed PnL and margin match the endpoint, or each mismatch is named.
- Positions near liquidation are flagged.
- No exchange action is built or sent.
Dwellir usage and error dashboard
Your busiest endpoints and methods, week-over-week changes, requests per second, estimated cost, and error codes in one local page. Totals that disagree are shown side by side.
- Dwellir CLI
- usage + logs
- Read-only
No API credits. Cost estimates need the Developer plan or higher. Usage and logs →
Using the Dwellir CLI with --json output, build and run a read-only, zero-dependency Node.js dashboard of my Dwellir account usage. Run `dwellir version` first; if it is older than 0.2.2, stop and ask me to run `dwellir update`. Then run `dwellir usage limits` and stay inside its maximum lookback and supported intervals. Use `dwellir usage summary` (current billing cycle only), `dwellir usage history --interval day`, `dwellir usage methods`, `dwellir usage rps`, and `dwellir usage costs` to show requests by endpoint and by RPC method for the last 7 and 30 days (rolling windows ending now, one call per window), the last 7 days against the 7 days before, peak and average requests per second from `usage rps --interval hour`, and estimated cost when my plan supports it. Use `dwellir logs stats` and `dwellir logs errors --limit 1000` to show error counts by status code (status 200 rows are JSON-RPC errors) and the top failing methods and endpoints; while meta.has_more is true, pass meta.next_cursor to --cursor to read the next page. logs stats can count more errors than logs errors returns, so show both totals. Highlight the busiest endpoints and the largest week-over-week increases. Take rate-limited requests only from usage summary. The rate_limited field from usage methods equals requests minus responses, so streaming methods and timeouts look rate limited; label it as derived and do not add it up. Compare the summary total with the per-endpoint and per-method sums over the summary's billing_start-to-now window and show any difference; live traffic between calls causes small gaps. If my plan does not support a command, show that panel as unavailable. The CLI masks api_key values and adds api_key_name to log rows; label keys by name, and save sanitized JSON and a local HTML page with no API key values. Never create, change, disable, or delete a key or any account setting.
Checks before it runs live
- Every panel comes from a real CLI call, and every error log page is read.
- Summary and breakdown totals are compared on screen.
- No key or account setting changes.
Multi-chain EVM balance snapshot
Native balance of one wallet across the EVM networks you name, each pinned to a block and read twice. Typos and non-EVM networks come back as labelled rows.
- Dwellir CLI
- EVM JSON-RPC
- eth_getBalance
Standard API plan. About five responses per network, 1 API credit each. Endpoint discovery →
Using the Dwellir CLI for discovery and Dwellir's JSON-RPC endpoints for the reads, build and run a zero-npm-dependency Node.js native-balance snapshot for <EVM_WALLET> across <NETWORKS>. Run `dwellir endpoints list --json` and match each requested name to a chain name exactly (case-insensitive), using the network named exactly Mainnet and that node's https URL. Classify each name as evm (ecosystem evm), non_evm (another ecosystem), or invalid_network (no match, with a did-you-mean suggestion) before making any eth_* call, and keep that classification in the output. Run `dwellir version` first; if it is older than 0.3.0, stop and ask me to run `dwellir update`. Run `dwellir keys env` with one of my key names (`dwellir keys list` shows names and masked keys) so DWELLIR_API_KEY goes into .env, then read it from .env at runtime and replace `<key>` in each https URL with it. Never print, log, or save the key or a URL that contains it. For each valid EVM network, read eth_chainId, the latest block number, that block's timestamp, and eth_getBalance at that exact block. Keep the exact integer balance in wei, then format it with the native token's symbol and decimals from a small table keyed by chain ID. Verify each result by reading the balance again at the same block and by checking that a second eth_blockNumber read did not move backward. Report stale networks (latest block more than five minutes old), invalid names, non-EVM networks, and failed calls by name. Print a readable table, save the full JSON snapshot, and include address and block explorer links when known.
Checks before it runs live
- Each balance repeats at the same block.
- Typos and non-EVM names appear as classified rows.
- No key reaches the output.
Robinhood Stock Token premium board
Chainlink price against the Uniswap v3 pool price for each Stock Token, with the premium or discount in basis points, oracle freshness, and any pause or multiplier change that is pending.
- Robinhood Chain
- eth_call + Multicall3
- Chainlink feeds
Runs on the Free plan. One Multicall3 eth_call per refresh, 1 API credit each. Robinhood Chain plans →
Using the Dwellir CLI and Dwellir's Robinhood Chain archive endpoint, build and run a read-only, zero-dependency Node.js premium board for the <TICKERS> Stock Tokens on Robinhood Chain mainnet (chain ID 4663). Run `dwellir project setup --chain robinhood --network Mainnet --node-type Archive` with --key-name set to one of my existing keys (or --create-key with a new name) so the RPC URL goes into .env, and never print the API key. The .env values are single-quoted, so strip the quotes, and never let a URL reach an error message. Resolve each token address from the Robinhood assets API (api.robinhood.com/rhj/assets), never from on-chain symbol(), because tokens with the same ticker exist. Take each token's Chainlink feed proxy from reference-data-directory.vercel.app/feeds-robinhood-mainnet.json (match docs.baseAsset), and find its USDG (0x5fC5360D0400a0Fd4f2aF552ADd042D716F1D168) Uniswap v3 pool through the factory at 0x1f7d7550b1b028f7571e69a784071f0205fd2efa by trying fee tiers 100, 500, 3000, and 10000 and keeping the pool with the highest liquidity(). Every <REFRESH_SECONDS> seconds, read everything for all tickers in one Multicall3 (0xca11bde05977b3631167028862be2a173976ca11) call pinned to one block: the feed's latestRoundData; the token's uiMultiplier, newUIMultiplier, effectiveAt, and oraclePaused; and the pool's slot0, token0, and token decimals. The feed prices one raw token (underlying x uiMultiplier) and the pool also trades raw tokens, so compare them directly without applying the multiplier to either side. Adjust the pool price by 10^(decimals0 - decimals1); USDG has 6 decimals and stock tokens have 18. Read token0 instead of assuming it. The equity market is open from Sunday 20:00 to Friday 20:00 New York time, and feeds hold their last value while it is closed, so label a price stale when the market is closed or updatedAt is older than the 86,400-second heartbeat, and show no premium for a stale or paused feed. Flag a scheduled multiplier change when effectiveAt is after the block time and newUIMultiplier differs from uiMultiplier. Before going live, show me one live ticker (pin a weekday trading-hours block if the market is closed now), one ticker that is in the assets API but has no feed, and one weekend block, and explain each result. Serve the board on a local web page.
Checks before it runs live
- Each refresh is one multicall at one block.
- Feed and pool are compared per raw token, with no multiplier applied twice.
- A stale or paused feed shows a label, not a premium.
Base flashblock swap tape
Swaps on your pair across Uniswap v3, Aerodrome Slipstream, and Aerodrome v2 from Flashblocks, about a second before their block seals, each marked confirmed or dropped once it does.
- Base
- Flashblocks pendingLogs
- eth_getLogs
Developer plan or higher for the eth_getLogs reconciliation. 1 API credit per pendingLogs message or response. Base Flashblocks →
Using Dwellir's Base mainnet archive endpoint with Flashblocks, build and run a zero-dependency Node.js swap tape for <PAIR> on Base (WETH is 0x4200000000000000000000000000000000000006, USDC is 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913). Run `dwellir project setup --chain base --network Mainnet` with --key-name set to one of my existing keys (or --create-key with a new name) so the RPC and WSS URLs go into .env, and never print the API key. The .env values are single-quoted, so strip the quotes, and never let a URL reach an error message. Find the pools through the Uniswap v3 factory (0x33128a8fC17869897dcE68Ed026d694621f6FDfD, all fee tiers), the Aerodrome Slipstream factory (0x5e7BB104d84c7CB9B682AaC2F3d509f5F406809A, every tick spacing from its tickSpacings()), and the Aerodrome v2 PoolFactory (0x420DD381b31aEf6683db6B902084cB0FFECe40Da, stable and volatile). Subscribe over WSS to pendingLogs filtered to those pools and their Swap topics, and to newHeads to detect sealed blocks. Slipstream emits the same Swap topic as Uniswap v3, so label the venue from factory() on the emitting pool, not from the topic. Aerodrome v2 uses a different Swap event with unsigned in and out amounts. A pending log carries a zero blockHash but a real blockNumber and logIndex, so key rows on transaction hash, pool address, and log index. Show side, size, price, USD notional, venue, and pool, and hide rows below <MIN_USD> USD notional. When each block seals, fetch its logs with eth_getLogs by blockHash, retrying if the node answers 'block not found', and backfill any skipped block numbers. Mark a preconfirmed row confirmed when it appears in its sealed block, and dropped only after its own block's logs were fetched without it. Add any sealed swaps the stream missed, and report how long before its sealed block each row arrived as p50 and p95. Before going live, show me one block with a matching swap above the threshold, one without, and one transaction that routes through two of these pools (scan back up to 5,000 blocks), then run for two minutes, wait up to 15 seconds for open rows to seal, and report the counts.
Checks before it runs live
- Slipstream and Uniswap v3 rows get the right venue.
- Every preconfirmed row ends confirmed or dropped.
- Lead times come from measured timestamps.
Hyperliquid funding and open interest board
Live hourly and annualized funding, premium, open interest in USD, and its one-hour change for the perps you pick. Extreme carry and fast open-interest builds are flagged.
- Hyperliquid
- gRPC V3
- StreamActiveAssetCtx
Hyperliquid gRPC add-on, $299/month on an API plan. 1 API credit per streamed message. gRPC access →
Using Dwellir's Hyperliquid V3 gRPC API, build and run a Node.js funding and open-interest dashboard for the <COINS> perpetuals. Download https://www.dwellir.com/docs/hyperliquid/grpc/v3.proto and load it at runtime with @grpc/proto-loader (keepCase: true). Connect over TLS to api-hyperliquid-mainnet-grpc.n.dwellir.com:443 (listed by `dwellir endpoints search hyperliquid` as Hyperliquid HyperCore gRPC), read DWELLIR_API_KEY from .env, send it only in the x-api-key metadata header (not in the path the CLI shows), and never print it. Load the perp universe and maxLeverage from the meta method on the Info endpoint (https://api-hyperliquid-mainnet-info.n.dwellir.com/$DWELLIR_API_KEY/info) and reject unknown names before subscribing. Open one MarketStreaming.StreamActiveAssetCtx subscription per coin; each message replaces that coin's whole context. Funding is already an hourly rate, so annualize it as funding x 8760 and never divide by 8. open_interest is in coin units, so multiply it by oracle_px for USD. Use day_ntl_vlm for 24-hour volume in USD. premium is a decimal fraction (x 10,000 for basis points), and premium, mid_px, and impact_pxs can be empty for a market with no book. time is when the endpoint published the update, not block time. Show coin, hourly and annualized funding, which side pays (positive means longs pay), premium in basis points, mark against oracle, open interest in USD, its one-hour change from your own snapshots (labelled partial until an hour of data exists), 24-hour volume, and max leverage. Flag any coin above <APR_ALERT> percent annualized or with open interest up more than 10 percent in an hour. Resubscribe on UNAVAILABLE, ABORTED, or DEADLINE_EXCEEDED, or after 60 seconds without a message. Treat delisted names as unknown, flag on the absolute annualized rate, and show mark against oracle in basis points. Before going live, test one valid perp, one spot identifier such as @1 sent straight to the server without your local check (expect INVALID_ARGUMENT), and one forced reconnect (open a stream with a 3-second deadline and resubscribe after DEADLINE_EXCEEDED), and show the result of each. Serve the dashboard on a local page.
Checks before it runs live
- A spot identifier is rejected and a valid perp streams.
- Annualized funding equals hourly funding x 8760.
- Open interest is converted to USD with the oracle price.
Polymarket large-fill tape
One row per taker trade on Polymarket across the CTF Exchange, the Neg Risk Exchange, and ExchangeV3, with market question, outcome, price, size, and both sides of the trade.
- Polygon
- eth_getLogs per block
- OrderFilled
Developer plan or higher for eth_getLogs. One call per block is about 43,000 credits a day; a logs subscription would bill every fill. Polygon plans →
Using Dwellir's Polygon mainnet endpoint, build and run a zero-dependency Node.js tape of Polymarket fills of at least <MIN_USD> pUSD for <MARKET_FILTER> (match a slug or keyword case-insensitively against the market question; any market means no filter). Run `dwellir project setup --chain polygon --network Mainnet --node-type Archive` with --key-name set to one of my existing keys (or --create-key with a new name), and never print the API key. The .env values are single-quoted, so strip the quotes, and never let a URL reach an error message. Watch newHeads over WSS. For each new block, make one eth_getLogs call by blockHash with all three exchanges as the address list (CTF Exchange 0xE111180000d2663C0091e4f400237545B87B996B, Neg Risk CTF Exchange 0xe2222d279d744050d28e00520010520000310F59, ExchangeV3 0xe3333700cA9d93003F00f0F71f8515005F6c00Aa) and topic0 OrderFilled(bytes32,address,address,uint8,uint256,uint256,uint256,uint256,bytes32,bytes32). Do not subscribe to logs, because every log notification is billed. Each match emits one OrderFilled per maker plus one where taker equals the exchange address; print that taker row as the trade and list the maker rows as counterparties, never both. Maker rows can be for the other outcome token, with a different side and price. side 0 is BUY and 1 is SELL. pUSD and shares both use 6 decimals. For BUY, price is makerAmountFilled / takerAmountFilled and size is makerAmountFilled pUSD; for SELL, price is takerAmountFilled / makerAmountFilled and size is takerAmountFilled pUSD. orderHash, maker, and taker are indexed topics, and a match's maker rows come just before its taker row in the same transaction. Look up the question and outcome for each tokenId at gamma-api.polymarket.com/markets?clob_token_ids=<decimal id> (clobTokenIds and outcomes are JSON strings with matching indexes) and cache the result. ExchangeV3 tokenIds are V2 position IDs: moduleId is id >> 248, and module 3 is a Combo with no public Gamma lookup, so label it Combo YES or NO from id & 0xff (0 is YES); label any other unresolved ID as unknown. Persist the last block and, after a reconnect, backfill in windows of about 200 blocks. Before going live, show me one transaction with several maker fills, one block with no fills (or say so if the last 3,000 blocks all have fills), and one ExchangeV3 fill.
Checks before it runs live
- A match with several makers gives one trade row.
- Prices land between 0 and 1 for both BUY and SELL.
- A reconnect backfills every missed block.
Hyperliquid TWAP tracker
Every large TWAP order on the coins you pick, from activation to finish or termination, with its expected end time and the executed size, notional, and average price when it closes.
- Hyperliquid
- gRPC V3
- StreamTwapStatuses
Hyperliquid gRPC add-on, $299/month on an API plan. 1 API credit per streamed message; replays send one per block. StreamTwapStatuses →
Using Dwellir's Hyperliquid V3 gRPC API, build and run a Node.js TWAP tracker for <COINS> on Hyperliquid. Download https://www.dwellir.com/docs/hyperliquid/grpc/v3.proto and load it at runtime with @grpc/proto-loader (keepCase: true). Connect over TLS to api-hyperliquid-mainnet-grpc.n.dwellir.com:443 (listed by `dwellir endpoints search hyperliquid` as Hyperliquid HyperCore gRPC), read DWELLIR_API_KEY from .env, send it only in the x-api-key metadata header (not in the path the CLI shows), and never print it. Subscribe to StreamTwapStatuses with a coins filter; for all coins, send no filter, because an empty filter is invalid. Parse Record.data as the node_twap_statuses_by_block JSON envelope. Most envelopes have an empty events array; use them to advance the block cursor and check that block numbers arrive without gaps. Key each TWAP on twap_id. On activated, open a row with coin, user, side (B is buy, A is sell), total size, minutes, reduceOnly, and randomize; estimate notional from total size and the mid from StreamAllMids (spot and HIP-3 coins have no mid there, so show n/a and keep the row) and hide TWAPs below <MIN_USD> USD. The feed sends status changes, not progress, so show the expected end time as state.timestamp plus minutes, and take executedSz, executedNtl, and the average fill price (executedNtl / executedSz) from the closing event. Close the row on finished, terminated, stopped, or an error status object; also expect waitingForTrigger, and show any unknown state instead of dropping it. Persist the last block_number and, after a reconnect, resume with position.block_number set to that block plus one (the position is inclusive); never resume by timestamp. A closing event can arrive for a TWAP activated before you started, so build its row from the event's state. The endpoint keeps about three hours of replay history, so a cursor older than that is not reliable. Before going live, replay at most the last 30 minutes from a block_number cursor to find one activated-to-finished TWAP, one terminated TWAP, and one error status, show me the rows, then switch to the live tail.
Checks before it runs live
- An activated TWAP is closed by its finished or terminated event.
- Average fill price equals executedNtl divided by executedSz.
- A reconnect resumes from the saved block without gaps.
Base new pool launch feed
New Uniswap v3, Aerodrome Slipstream, and Aerodrome v2 pools on Base as they are created, with both tokens, fee or tick spacing, first liquidity, and a flag for tokens that fail basic checks.
- Base
- Flashblocks pendingLogs
- PoolCreated
Developer plan or higher for the eth_getLogs backfill. 1 API credit per pendingLogs message or response. Base Flashblocks →
Using Dwellir's Base mainnet archive endpoint with Flashblocks, build and run a zero-dependency Node.js feed of new liquidity pools on Base that pair a new token with one of <QUOTE_TOKENS>. Run `dwellir project setup --chain base --network Mainnet` with --key-name set to one of my existing keys (or --create-key with a new name) so the RPC and WSS URLs go into .env, and never print the API key. The .env values are single-quoted, so strip the quotes, and never let a URL reach an error message. A pool qualifies when exactly one side is one of the quote tokens. Watch three factories: Uniswap v3 (0x33128a8fC17869897dcE68Ed026d694621f6FDfD, PoolCreated(address,address,uint24,int24,address)), Aerodrome Slipstream (0x5e7BB104d84c7CB9B682AaC2F3d509f5F406809A, PoolCreated(address,address,int24,address)), and the Aerodrome v2 PoolFactory (0x420DD381b31aEf6683db6B902084cB0FFECe40Da, PoolCreated(address,address,bool,address,uint256)). Confirm each topic against one historical log before subscribing, splitting eth_getLogs into ranges of at most 10,000 blocks; verified ABIs are on Sourcify (sourcify.dev/server/v2/contract/8453/{address}?fields=abi). Subscribe over WSS to pendingLogs for those factories and to newHeads. For each new pool, show the factory, pool address, both tokens with name, symbol, and decimals read by eth_call, the fee tier (for Slipstream read pool.fee(); for Aerodrome v2 call factory.getFee(pool, stable)), tick spacing or stable flag, and the creation transaction. Then watch the pool for its first liquidity, Mint(address,address,int24,int24,uint128,uint256,uint256) on Uniswap v3 and Slipstream or Mint(address,uint256,uint256) on Aerodrome v2, and show the amounts added. Flag a token when name, symbol, or decimals revert, when it has no code, or when one address other than the pool holds 95 percent or more of the supply (check the creation transaction's sender, the pool, and mint recipients with balanceOf), and show the pool's own share of supply. Pending logs carry a zero block hash but a real logIndex, so key rows on transaction hash and log index, and confirm each row against the sealed block with eth_getLogs. These factories create only a few qualifying pools an hour, so before going live, show me one block with a new pool, one block without, and one pool created and seeded in the same transaction, and if no pool appears during a short live run, prove the confirmation path on a busier contract.Checks before it runs live
- Each factory topic is confirmed against a real historical log.
- Every pending row is confirmed or dropped against the sealed block.
- Tokens with reverting metadata are flagged, not hidden.
Write your own recipe
The prompts above share one structure. Use it for your own:
- Name the product. Say which Dwellir surface the agent should use: the CLI, a chain endpoint, the gRPC API, or the Info endpoint.
- Describe one output. A tape, a report, or a dashboard, with every field it must show.
- State the traps. Sign conventions, multipliers, and which address field to read are the places agents guess wrong.
- Ask for checks on real data. One matching case, one non-matching case, and one edge case, before anything runs live.
- Set limits. Read-only where possible, no secrets in output, and no paid resource created without asking.
To move an existing project from another provider, use the RPC migration prompt. For agent-readable references, point your agent at /docs/llms.txt.
Frequently Asked Questions
Which coding agents can run these prompts?
Any agent that can run shell commands and write files, such as Claude Code, Codex, Cursor, or OpenCode. The Dwellir MCP server is optional. It lets the agent discover endpoints and methods without the CLI.
Where does my API key go?
The prompts call dwellir project setup, which writes DWELLIR_API_KEY, DWELLIR_RPC_URL, and DWELLIR_WSS_URL into .env and adds an ignore rule. Each prompt tells the agent never to print the key.
Do the Hyperliquid recipes need an add-on?
The liquidation tape, the funding board, and the TWAP tracker need the Hyperliquid gRPC add-on. The top-of-book tape needs the Order Book add-on. The wallet risk report uses the Info endpoint on a standard API plan.