grimoire-uniswap

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Grimoire Uniswap Skill

Grimoire Uniswap 技能工具

Use the Grimoire CLI to read public Uniswap adapter data.
Preferred:
  • grimoire venue uniswap ...
If you installed
@grimoirelabs/venues
directly, you can also use
grimoire-uniswap
.
使用Grimoire CLI读取公开的Uniswap适配器数据。
推荐使用:
  • grimoire venue uniswap ...
如果你直接安装了
@grimoirelabs/venues
,也可以使用
grimoire-uniswap
命令。

When to use

适用场景

  • Fetch Uniswap router metadata, tokens, or pools for quick VM prototyping.
  • Produce snapshot
    params
    blocks with
    --format spell
    for VM runs.
  • 快速获取Uniswap路由元数据、代币或资金池信息,用于虚拟机原型开发。
  • 使用
    --format spell
    参数生成快照
    params
    块,供虚拟机运行使用。

Prerequisites

前置条件

  • Global CLI:
    npm i -g @grimoirelabs/cli
  • No install:
    npx -y @grimoirelabs/cli venue uniswap ...
  • 全局安装CLI:
    npm i -g @grimoirelabs/cli
  • 无需安装直接使用:
    npx -y @grimoirelabs/cli venue uniswap ...

VM snapshot usage

虚拟机快照使用方式

Use
--format spell
to emit a VM-ready
params:
block you can paste into a spell.
使用
--format spell
参数可生成适用于虚拟机的
params:
代码块,你可以直接复制粘贴到spell文件中。

Commands

可用命令

  • grimoire venue uniswap info [--format <json|table>]
  • grimoire venue uniswap routers [--chain <id>] [--format <json|table>]
  • grimoire venue uniswap tokens [--chain <id>] [--symbol <sym>] [--address <addr>] [--source <url>] [--format <json|table|spell>]
  • grimoire venue uniswap pools --chain <id> --token0 <address|symbol> --token1 <address|symbol> [--fee <bps>] [--limit <n>] [--source <url>] [--format <json|table|spell>] [--endpoint <url>] [--graph-key <key>] [--subgraph-id <id>] [--rpc-url <url>] [--factory <address>]
If you provide
--rpc-url
(or
RPC_URL
) and omit
--endpoint
/
--graph-key
, pools uses onchain factory lookups instead of The Graph.
  • grimoire venue uniswap info [--format <json|table>]
  • grimoire venue uniswap routers [--chain <id>] [--format <json|table>]
  • grimoire venue uniswap tokens [--chain <id>] [--symbol <sym>] [--address <addr>] [--source <url>] [--format <json|table|spell>]
  • grimoire venue uniswap pools --chain <id> --token0 <address|symbol> --token1 <address|symbol> [--fee <bps>] [--limit <n>] [--source <url>] [--format <json|table|spell>] [--endpoint <url>] [--graph-key <key>] [--subgraph-id <id>] [--rpc-url <url>] [--factory <address>]
如果你提供了
--rpc-url
(或环境变量
RPC_URL
)且未指定
--endpoint
/
--graph-key
,资金池查询将使用链上工厂查找而非The Graph服务。

Examples

使用示例

bash
grimoire venue uniswap info --format table
grimoire venue uniswap routers
grimoire venue uniswap routers --chain 1
grimoire venue uniswap tokens --chain 1 --symbol USDC --format spell
grimoire venue uniswap pools --chain 1 --token0 USDC --token1 WETH --fee 3000 --format spell
grimoire venue uniswap pools --chain 8453 --token0 USDC --token1 WETH --fee 500 --rpc-url $RPC_URL --format table
grimoire venue uniswap pools --chain 8453 --token0 USDC --token1 WETH --fee 500 --graph-key $GRAPH_API_KEY --subgraph-id <id> --format table
bash
grimoire venue uniswap info --format table
grimoire venue uniswap routers
grimoire venue uniswap routers --chain 1
grimoire venue uniswap tokens --chain 1 --symbol USDC --format spell
grimoire venue uniswap pools --chain 1 --token0 USDC --token1 WETH --fee 3000 --format spell
grimoire venue uniswap pools --chain 8453 --token0 USDC --token1 WETH --fee 500 --rpc-url $RPC_URL --format table
grimoire venue uniswap pools --chain 8453 --token0 USDC --token1 WETH --fee 500 --graph-key $GRAPH_API_KEY --subgraph-id <id> --format table

Supported Adapters

支持的适配器

AdapterRouterApproval Flow
@uniswap_v3
SwapRouter02Standard ERC20 approve
@uniswap_v4
Universal RouterPermit2
适配器路由授权流程
@uniswap_v3
SwapRouter02标准ERC20授权
@uniswap_v4
Universal RouterPermit2

Notes

注意事项

  • CLI currently exposes V3 metadata. V4 adapter is available programmatically via
    createUniswapV4Adapter()
    .
  • Outputs JSON plus a human-readable table.
  • Only metadata is exposed (no on-chain quote endpoints).
  • 当前CLI仅开放V3元数据。V4适配器可通过
    createUniswapV4Adapter()
    以编程方式调用。
  • 输出格式包括JSON及易读的表格形式。
  • 仅提供元数据(不包含链上报价端点)。