mcpField
A
analyzing-mempool

analyzing-mempool

github.com/jeremylongshore数据与数据库2.9k37 次安装2 天前更新
代码仓库

关于 analyzing-mempool

这项 Python 技能用于查看多个支持链上的待处理交易和内存池活动,面向交易者、MEV 研究者和协议开发者,可分析 Gas 价格、DEX 兑换及潜在 MEV 机会。

主要功能

  1. 01查看待处理交易
  2. 02分析 Gas 价格
  3. 03检测 DEX 兑换
  4. 04扫描潜在 MEV 机会
  5. 05监控指定合约
  6. 06以 JSON 导出结果

适用场景

  1. 01发送交易前检查 Gas 情况
  2. 02监控待处理的兑换交易
  3. 03研究潜在 MEV 活动

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace --skill analyzing-mempool

安装后在 Claude Code 中输入/analyzing-mempool确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

ARD.md
PRD.md
config/
settings.yaml
references/
errors.md
examples.md
implementation.md
scripts/
formatters.py
gas_analyzer.py
mempool_analyzer.py
mev_detector.py
rpc_client.py
tx_decoder.py

详细介绍

分析 Mempool

目录

概述 | 先决条件 | 操作说明 | 输出 | 错误处理 | 示例 | 资源

概述

监控 Ethereum Mempool 中的待处理交易,分析 Gas 价格,检测 DEX 兑换,并识别潜在的 MEV 机会。适用于交易者、MEV 研究人员和协议开发者。

先决条件

  1. 安装 Python 3.8+ 和 requests 库
  2. 配置 Ethereum RPC URL(默认使用公共端点,也可设置 ETH_RPC_URL)
  3. 确认可访问互联网,以便进行 RPC 调用

操作说明

第 1 步:进入脚本目录
cd ${CLAUDE_SKILL_DIR}/scripts
第 2 步:选择命令
  1. 查看待处理交易:python mempool_analyzer.py pending
  2. 分析 Gas 价格:python mempool_analyzer.py gas
  3. 检测待处理的 DEX 兑换:python mempool_analyzer.py swaps
  4. 扫描 MEV 机会:python mempool_analyzer.py mev
  5. 获取 Mempool 摘要:python mempool_analyzer.py summary
  6. 监控指定合约:python mempool_analyzer.py watch 0x7a250d...

也可以使用标志自定义:

python mempool_analyzer.py pending --limit 100    # Limit results
python mempool_analyzer.py --chain polygon gas     # Use different chain
python mempool_analyzer.py --chain arbitrum pending # Or use Arbitrum
第 3 步:解读结果

Gas 建议:

  • 慢速(第 10 百分位):可能需要 10 个以上区块
  • 标准(第 50 百分位):2–5 个区块
  • 快速(第 75 百分位):1–2 个区块
  • 即时(第 90 百分位):很可能在下一个区块确认

MEV 警告:

  • MEV 检测仅用于教育目的
  • 实际提取 MEV 需要专用基础设施
  • 请将此工具用于研究并了解 Mempool 动态

输出

  • 包含 Gas 价格和类型的待处理交易列表
  • Gas 价格分布和建议
  • 检测到的 DEX 兑换,包括金额和 DEX 识别结果
  • MEV 机会分析及预估利润
  • 供程序使用的 JSON 输出(--format json)

错误处理

请参阅 ${CLAUDE_SKILL_DIR}/references/errors.md,了解以下内容:

  • RPC 连接问题和超时恢复
  • 各链的 Mempool 访问限制
  • 交易解码错误和回退方案
  • Gas 分析的边缘情况

示例

示例 1:发送交易前检查 Gas:

python mempool_analyzer.py gas
# Use "Fast" for quick confirmation

示例 2:监控大额待处理兑换:

python mempool_analyzer.py swaps --limit 200  # 200: max results to scan

示例 3:研究 MEV 机会:

python mempool_analyzer.py mev -v

请参阅 ${CLAUDE_SKILL_DIR}/references/examples.md,了解更多用法示例。

资源

  • ${CLAUDE_SKILL_DIR}/references/implementation.md - Gas 分析、MEV 检测和多链详情
  • Ethereum JSON-RPC - RPC 规范
  • Flashbots - MEV 研究和基础设施
  • DEX Subgraphs - 流动性池和兑换数据
  • 支持:Ethereum、Polygon、Arbitrum、Optimism、Base

评论

支持 Markdown