Skip to content

jeremylongshore/tons-of-skills-marketplace / plugins/crypto/mempool-analyzer/skills/analyzing-mempool

analyzing-mempool

Verified

Monitor blockchain mempools for pending transactions, gas analysis, and MEV opportunities. Use when analyzing pending transactions, optimizing gas prices, or researching MEV. Trigger with phrases like "check mempool", "scan pending txs", "find MEV", "gas price analysis", or "pending swaps".

FileKindSize
ARD.mdmarkdown4.3 KB
PRD.mdmarkdown2.9 KB
SKILL.mdskill md3.7 KB
config/settings.yamlconfig1004 B
references/errors.mdmarkdown2.6 KB
references/examples.mdmarkdown3.7 KB
references/implementation.mdmarkdown2.2 KB
scripts/formatters.pyscript6.5 KB
scripts/gas_analyzer.pyscript8.7 KB
scripts/mempool_analyzer.pyscript9.9 KB
scripts/mev_detector.pyscript12.2 KB
scripts/rpc_client.pyscript10.2 KB
scripts/tx_decoder.pyscript9.2 KB

references/implementation.md

View on GitHub
# Implementation Details

## Gas Price Distribution Analysis

The gas analysis command calculates percentile-based recommendations from pending transactions:

**Gas Recommendations:**

- Slow (10th percentile): May take 10+ blocks
- Standard (50th percentile): 2-5 blocks
- Fast (75th percentile): 1-2 blocks
- Instant (90th percentile): Next block likely

## MEV Detection Details

MEV detection scans for common patterns:

- **Sandwich attacks**: Detects front-run + back-run pairs targeting the same swap
- **Arbitrage**: Identifies circular token paths (A→B→A) across DEXs
- **Liquidation**: Finds health-factor monitoring and repay+seize patterns

**Important:** MEV detection is for educational purposes only. Real MEV extraction requires:

- Specialized block-builder infrastructure (Flashbots, MEV-Boost)
- Sub-millisecond execution timing
- Significant capital for gas auctions

## DEX Swap Detection

The `swaps` command identifies pending DEX transactions by matching method selectors:

- Uniswap V2/V3: `swapExactTokensForTokens`, `exactInputSingle`
- SushiSwap: Same interface as Uniswap V2
- 1inch: `swap`, `unoswap` aggregation methods

## Multi-Chain Support

Supported chains and their mempool characteristics:

| Chain | Mempool Access | Block Time | Notes |
|-------|---------------|------------|-------|
| Ethereum | Full | ~12s | Richest MEV environment |
| Polygon | Full | ~2s | Lower gas, faster blocks |
| Arbitrum | Limited | ~0.25s | Sequencer-based, less MEV |
| Optimism | Limited | ~2s | Sequencer-based |
| Base | Limited | ~2s | Coinbase sequencer |

## Contract Watching

The `watch` command monitors pending transactions to a specific contract address:

1. Filters mempool by `to` address
2. Decodes known method selectors
3. Estimates gas cost in USD
4. Identifies transaction type (swap, approve, transfer, etc.)

## Configuration

Edit `${CLAUDE_SKILL_DIR}/config/settings.yaml`:

```yaml
rpc_endpoints:
  ethereum: "eth"
  polygon: "polygon"
  arbitrum: "arbitrum"

defaults:
  chain: ethereum
  limit: 50
  output_format: table
```

---
*[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*
add-product-e2e-evalpaperclipai/paperclipAdd or extend a Paperclip full-stack runner E2E workflow, fixture, matcher, or report evidence path for local or Daytona execution.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
add-runner-evalpaperclipai/paperclipAdd or extend a Paperclip Runner protocol evaluation definition, roster, assertion, or report fixture with provenance and narrow validation.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
diagnose-why-work-stoppedpaperclipai/paperclipCompatibility entry point for failed, stalled, looping, or over-recovered Paperclip work. Use fix-failed-paperclip-run for the full diagnosis, regression, repair, real verification, and green-PR workflow; honor an explicitly requested diagnosis-only scope.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
fix-failed-paperclip-runpaperclipai/paperclipDiagnose and fix failed, stuck, slow, or incorrectly blocked Paperclip tasks and runs. Use with a task/run URL or failure report to trace the root cause, prove a regression red then green, check second-order effects, verify the real workflow, and deliver a PR with passing checks.Stars: 115kUpdated Claude CodeCodexVerifiedInstall