Grimoire Uniswap Skill
Use this skill to inspect Uniswap metadata and produce token/pool snapshots for spells.
Preferred invocations:
grimoire venue uniswap ...npx -y @grimoirelabs/cli venue uniswap ...(no-install)bun run packages/cli/src/index.ts venue uniswap ...(repo-local)grimoire-uniswap ...(direct binary from@grimoirelabs/venues)
Recommended preflight:
grimoire venue doctor --adapter uniswap --chain 1 --rpc-url <rpc> --json
Commands
grimoire venue uniswap info— adapter metadatagrimoire venue uniswap routers [--chain <id>]— router addresses per chaingrimoire venue uniswap tokens [--chain <id>] [--symbol <sym>] [--address <addr>] [--source <url>]— token list lookupgrimoire venue uniswap tokens-snapshot [--chain <id>] [--symbol <sym>] [--address <addr>] [--source <url>]— generate spellparams:block for tokens (agent-only)grimoire venue uniswap pools --token0 <address|symbol> --token1 <address|symbol> [--chain <id>] [--fee <bps>] [--limit <n>] [--source <url>] [--endpoint <url>] [--graph-key <key>] [--subgraph-id <id>] [--rpc-url <url>] [--factory <address>]— find pools for a token pairgrimoire venue uniswap pools-snapshot --token0 <address|symbol> --token1 <address|symbol> [--chain <id>] [--fee <bps>] [--limit <n>] [--source <url>] [--endpoint <url>] [--graph-key <key>] [--subgraph-id <id>] [--rpc-url <url>] [--factory <address>]— generate spellparams:block for pools (agent-only)
Pool Data Sources
Pools can be fetched from The Graph (subgraph) or directly from on-chain factory contracts:
- Subgraph (default when
GRAPH_API_KEYis set): queries The Graph decentralized network. Built-in subgraph IDs for Ethereum, Optimism, Polygon, Base, Arbitrum. - RPC (fallback): if no usable graph config is present, pools uses on-chain factory lookups (with
--rpc-url/RPC_URLwhen provided, otherwise chain default RPC where available). - To force RPC mode: provide
--rpc-urland omit--graph-key.
Environment Variables
Examples
Use tokens-snapshot or pools-snapshot to emit a params: block for spell inputs. These are agent-only commands (output suppressed in interactive mode).
Metric Surface (Spell Comparisons)
Uniswap V3 and V4 expose quote_out for protocol comparison:
Selector fields:
- required:
asset_out - optional:
amount(defaults to 1 unit of input asset),fee_tier - V4 optional:
tick_spacing
Spell Constraints
When writing swap actions in .spell files targeting Uniswap, use with clauses to set constraints:
fee_tier is required. The adapter throws if fee_tier is not specified. It is an action parameter (not a constraint) and is extracted from the with() clause.
Common fee tiers: 500 (0.05%), 3000 (0.3%), 10000 (1%).
Always set both max_slippage and min_output for swaps to prevent unexpected losses.
Supported Adapters
Notes
- CLI currently exposes V3 metadata. V4 adapter is available programmatically via
createUniswapV4Adapter(). - For metadata lookups (
tokens,pools), usegrimoire venue uniswap ...even when your spell venue isuniswap_v4. - Outputs JSON/table;
tokensandpoolsalso support--format spell. - Prefer
--format jsonfor automation and reproducible snapshots. - Only metadata is exposed (no on-chain quote endpoints).

