
Streamsmith
One prompt becomes a verified, live Substreams pipeline that agents can trust.
Demo
About
AI can write a Substreams pipeline in minutes, but nobody should trust one it wrote: the code can be subtly wrong and nothing tells you. Streamsmith makes that trust checkable. A human writes the contract: a protobuf schema (what the data must look like), a config (chain, addresses, sampling interval) and a gate file (checks against real blocks whose correct answers are already known). Then one prompt. The official StreamingFast Substreams skills teach the agent how to write the Rust; the Streamsmith plugin teaches it how to prove the result is right and get it live. The promotion pipeline is gate → publish to the Substreams registry → deploy (Graph Market hosted sink, or a self-managed sink into ClickHouse) → Deployment Receipt → generated MCP server. Nothing is published until every gate assertion passes, and the gate verifies the agent did not modify the contract files. The Deployment Receipt binds the package hash, output module hash, parameter hash, proto descriptor hash and sink schema hash to the gate evidence and the deployment. The MCP server generated from it re-checks those hashes and the chain head every minute and refuses to answer (receipt_mismatch, schema_mismatch, chain_mismatch, stale_data) instead of guessing. Worked example: erc4626-flows, a reusable ERC-4626 vault-activity package for Base (deposits, withdrawals, and fixed-interval convertToAssets observations for Gauntlet USDC Prime and Steakhouse Prime USDC), composed on the Pinax erc4626 package, published to substreams.dev, and running as a Graph Market hosted deployment into ClickHouse Cloud with a live receipt. Payoff: Vaultpilot, a B2B treasury agent for a Privy business wallet. The owner sets a policy (two approved vaults, a per-action cap, deposit and withdraw only); the agent holds an additional signer key that can do nothing else. It reads the MCP, decides whether to rotate USDC between the vaults based on observed-window share-value growth, refuses on stale or mismatched data, and is denied by Privy at the policy layer when it tries anything outside the policy. Recorded proof: from a 112-file clean-start commit holding only the contract and tooling, one human message produced the package, a green gate (18/18), a registry publish (v0.1.1), a ClickHouse deployment, a receipt and an MCP server in about 40 minutes with no further human input. The run folder, the receipt and every generated line of code are in the repo under runs/recorded/.
How it's made
Substreams package (Rust → WASM): map and store modules over the Pinax erc4626 and erc20 packages, plus eth_call sampling of convertToAssets at the processed block so observations are deterministic. The proto contract is frozen in specs/vaultflows.proto with the table annotations the sink needs. Published with substreams publish; v0.1.0 is the live pipeline, v0.1.1 is the one the recorded one-prompt run produced. Streamsmith (TypeScript CLI + Claude Code plugin): gate runs executable assertions from specs/gate.yaml against pinned Base block ranges and exits non-zero on any failure; publish, deploy (hosted via the Graph Market portal API, self-managed via substreams-sink-sql, plus views, status, and an --attach mode that records a running deployment without redeploying), schema-render (renders the sink's DDL offline, byte-identical to the live ClickHouse schema, so the schema hash can be bound without a database), receipt (JSON-schema-validated Deployment Receipt), mcp and manifest. The plugin's SKILL.md carries the build traps we hit so the agent doesn't: the block-limit flag, the enum-in-sink panic, the per-database sink-info folder. mcpgen: generates a typed stdio MCP server from the proto descriptors and the receipt. Every tool response carries provenance; a refusal chain (receipt_mismatch → schema_mismatch → chain_mismatch → stale_data → check_unavailable) runs before any query. It detects ClickHouse's read-only profile rejecting settings and retries without them. Sinks: the Graph Market hosted deployment is primary; a self-managed sink is the documented fallback. Both write to ClickHouse Cloud, read by consumers through a read-only user. Hacky but notable: the first hosted deployment crash-looped because its start command was generated once at first deploy with a raw parameter string; config updates only restart the pod, so the fix was a fresh deployment with no parameter override. The registry counts every manifest fetch as a download, so that crash loop alone accounts for over a thousand "downloads" on our package page. Vaultpilot (TypeScript + Next.js): Privy server wallet owned by the treasurer's authorization key; the agent's key is a 1-of-1 key quorum attached as an additional signer with an override policy (earn_deposit and earn_withdraw on two vault ids under a cap). Privy policies don't aggregate Earn actions, so the daily cap is enforced app-side. The decision service applies a minimum observed window, a growth differential threshold, a cooldown, an outflow guardrail and a staleness refusal, and every fact behind a decision is on the dashboard alongside the pipeline stamp carrying the receipt hashes. The dashboard holds no keys. Partner tech: The Graph's Substreams skills wrote the pipeline, the registry and Graph Market run it; Privy's policies and additional signers are what make an agent with money safe to leave alone. 313 tests across the workspace; GitHub Actions builds the package.