[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-98":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":17,"hasPages":17,"topics":19,"createdAt":9,"pushedAt":9,"updatedAt":20,"readmeContent":21,"aiSummary":22,"trendingCount":14,"starSnapshotCount":14,"syncStatus":23,"lastSyncTime":24,"discoverSource":25},98,"univ3-pool-lens","moxailoo\u002Funiv3-pool-lens","moxailoo","A focused TypeScript toolkit for inspecting Uniswap V3 pools — liquidity distribution, fee yield, and impermanent-loss math from your terminal.",null,"TypeScript",495,316,8,0,7.5,"MIT License",false,"main",[],"2026-06-12 02:00:08","# Uniswap V3 Pool Lens 🔍\n\n![TypeScript](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ftypescript-5.5-3178C6?style=flat-square&logo=typescript&logoColor=white)\n![Node 20+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fnode-20+-43853d?style=flat-square&logo=node.js&logoColor=white)\n![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green?style=flat-square)\n\nA small, opinionated CLI for poking at Uniswap V3 pools without firing up a subgraph or a notebook.\n\nI use this to answer questions like *\"what does the liquidity look like around the current tick?\"*, *\"what's the IL if I LP a [3500, 4500] range and ETH dips 30%?\"*, and *\"what's the rough fee APR over the last 24h?\"*. It's not a replacement for proper analytics — it's a sanity check that runs in your terminal in under a second.\n\n## Install\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmoxailoo\u002Funiv3-pool-lens\ncd univ3-pool-lens\nnpm install\nnpm run build\nnpm link    # optional, makes `lens` available globally\n```\n\nCopy `.env.example` to `.env` and set at least one RPC URL.\n\n## Quick start\n\n```bash\n# Pool summary — current tick, price, liquidity\nlens pool 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640\n# WETH \u002F USDC    fee 0.05%\n# address       0x88e6…5640\n# tick          198543\n# price         3742.18 USDC per WETH\n# liquidity     12384720394823049823\n\n# IL projection for a [3500, 4500] range\nlens range 0x88e6...5640 --lower 196900 --upper 199810\n\n# 24h fee APR estimate\nlens fees 0x88e6...5640\n\n# Diff pool state across a window\nlens snapshot 0x88e6...5640 --from 21000000 --to 21007200\n\n# Other chains\nlens pool 0x... --chain arbitrum\nlens pool 0x... --chain base\n\n# JSON output for piping into jq, scripts, dashboards\nlens pool 0x... --json | jq '.price'\n```\n\n## Architecture\n\n```\n                ┌──────────────────────────────────┐\n                │             CLI (cli.ts)         │\n                └────────────────┬─────────────────┘\n                                 │\n         ┌───────────────────────┼───────────────────────┐\n         ▼                       ▼                       ▼\n   commands\u002Fpool.ts        commands\u002Frange.ts       commands\u002Ffees.ts\n         │                       │                       │\n         └───────────┬───────────┴───────────┬───────────┘\n                     ▼                       ▼\n                lens\u002F* (pool, ticks, liquidity, il, fees)\n                     │\n                     ▼\n              chain\u002Fprovider + util\u002Fmulticall + util\u002Fcache\n                     │\n                     ▼\n                  ethers.js\n```\n\nThe `lens\u002F*` modules know nothing about the CLI or the chain plumbing — they take a provider and an address and return data. Commands handle formatting. This makes the library easy to import into other projects (notebooks, bots, dashboards) without dragging the CLI along.\n\n## Subcommands\n\n| Command | What it does |\n|---------|--------------|\n| `lens pool \u003Caddr>`     | Pool immutables, current tick & price, in-range liquidity |\n| `lens range \u003Caddr>`    | IL projection + ASCII curve for a `[tickLower, tickUpper]` position |\n| `lens fees \u003Caddr>`     | Fee APR estimate from `feeGrowthGlobal` deltas over a window |\n| `lens snapshot \u003Caddr>` | Diff between pool state at two block heights |\n\nRun any command with `--json` for machine-readable output.\n\n## Configuration\n\n| Env var | Purpose |\n|---------|---------|\n| `ETH_RPC_URL`        | Mainnet JSON-RPC endpoint |\n| `ARBITRUM_RPC_URL`   | Arbitrum endpoint |\n| `BASE_RPC_URL`       | Base endpoint |\n| `OPTIMISM_RPC_URL`   | Optimism endpoint |\n| `POLYGON_RPC_URL`    | Polygon PoS endpoint |\n| `LENS_CACHE_DIR`     | Override the on-disk cache location (default: `.\u002F.lens-cache`) |\n| `LENS_MULTICALL_BATCH` | Bump multicall chunk size if your RPC can take it |\n\nThe cache stores ERC20 metadata for 30 days — symbols and decimals never change, so there's no reason to re-fetch.\n\n## Library use\n\nIf you'd rather skip the CLI:\n\n```ts\nimport { JsonRpcProvider } from \"ethers\";\nimport { readImmutables, readState } from \"univ3-pool-lens\";\n\nconst provider = new JsonRpcProvider(process.env.ETH_RPC_URL);\nconst immut = await readImmutables(provider, \"0x88e6...\");\nconst state = await readState(provider, \"0x88e6...\");\nconsole.log(immut.fee, state.tick);\n```\n\nMost of the `lens\u002F*` exports are stable. The `commands\u002F*` ones are designed to be CLI-shaped and may change.\n\n## Caveats\n\n- **The fee APR estimate is rough.** It uses `feeGrowthGlobal` deltas across two blocks, which catches only fees that crossed the global counter — concentrated liquidity in volatile periods can skew this. For real numbers, use the [Uniswap V3 subgraph](https:\u002F\u002Fgithub.com\u002FUniswap\u002Fv3-subgraph).\n- **No gas-cost modeling** in IL projections. Fees offset IL in practice; this tool models them separately.\n- **Custom-fee pools** (those deployed via `enableFeeAmount` with a non-canonical fee) are detected with a warning but otherwise treated normally.\n- **Forked V3 deployments** (PancakeSwap V3, etc.) — the math is the same, but the factory addresses in `chain\u002Fconfig.ts` are Uniswap-only. Pass any pool address directly and it'll work; the factory address is only used for discovery features which aren't implemented yet.\n\n## Roadmap\n\n- [ ] `lens position \u003CtokenId>` to inspect a specific NFT-LP position\n- [ ] `lens compare` for side-by-side multi-pool diffs\n- [ ] Pull historical fee data from a subgraph when configured\n- [ ] Optional Vega\u002FPlotly export for IL curves\n\n## Acknowledgments\n\nMath obviously based on the Uniswap V3 whitepaper and the canonical `TickMath`\u002F`SqrtPriceMath` libraries. Multicall3 by [@mds1](https:\u002F\u002Fgithub.com\u002Fmds1).\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","Uniswap V3 Pool Lens 是一个专注于检查 Uniswap V3 流动性池的 TypeScript 工具包，支持从终端查看流动性分布、费用收益和瞬时损失等信息。其核心功能包括快速获取池子当前状态、预测特定价格区间内的瞬时损失以及估算过去24小时的费用年化收益率。该工具基于 Node.js 运行，并利用了 ethers.js 库来与区块链交互，设计上采用模块化架构，使得各组件可以独立于命令行界面被其他项目复用。适用于需要对 Uniswap V3 池进行即时分析或构建相关监控系统的开发者及研究者使用。",2,"2026-05-06 17:18:45","CREATED_QUERY"]