Skip to main content
Glama

DeFi Quant Execution MCP

Smithery Compatible Model Context Protocol Base L2 Settlement Tools License: MIT

Exact Uniswap v3 Q64.96 tick math, MEV sandwich risk simulation, flashloan arbitrage profit modeling, and Base blob gas estimation.

Built specifically for Algorithmic traders, MEV searchers, Base L2 DeFi bot builders, and autonomous portfolio managers.


⚡ Quickstart

Smithery Install

smithery skill add whambammy/defi-quant-execution-mcp

Claude Desktop / Cursor (claude_desktop_config.json)

{
  "mcpServers": {
    "defi-quant-execution-mcp": {
      "command": "npx",
      "args": ["-y", "@whambammy/defi-quant-execution-mcp"],
      "env": {
        "PAYMENT_WALLET": "0x9793E7269b3301893318dEa8338576Ba612F39B3",
        "BASE_RPC_URL": "https://mainnet.base.org"
      }
    }
  }
}

Related MCP server: Tollbooth MCP Server

🛠️ Included Tools

Tool Name

Price (USDC)

Capability

uniswap_v3_tick_math_precise

$0.035

Arbitrary-precision Q64.96 fixed-point math calculator for Uniswap v3 square root price $(\sqrt{P})$, tick-to-price conversion, and exact liquidity fee compounding.

mev_sandwich_risk_simulator

$0.045

Simulates pending swaps against Uniswap v3/v4 tick liquidity to compute exact MEV sandwich vulnerability, maximum extractable value, and safe slippage limits.

compute_uniswap_v3_quote

$0.02

Calculates exact sqrtPriceX96 tick mathematics, price impact, and swap output amounts for concentrated liquidity pools on Base.

flashloan_arbitrage_profit_calculator

$0.045

Calculates net arbitrage profit for multi-hop flashloans across Base L2 DEXes, factoring pool fee tiers, price impact, loan premium (0.09%), and gas burnt.

base_l2_blob_gas_price_projector

$0.035

Evaluates EIP-4844 blob gas fee dynamics and Base L2 sequencing costs, projecting optimal block inclusion timing for transaction batch settlement.


🔄 End-to-End Workflow

A trading agent identifies a potential arbitrage opportunity -> computes exact Q64.96 tick math across Uniswap v3 pools -> simulates MEV sandwich vulnerability -> projects Base L2 blob gas fees -> confirms net profitability before executing.


💰 The x402 Base L2 Micropayment Protocol

When an agent invokes a tool without payment, the server responds with a deterministic HTTP 402 Payment Required challenge containing:

  • Target tool price in USDC

  • Base Native USDC Contract: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

  • Recipient payout wallet address

  • Single-use cryptographic nonce

Once broadcasted on Base L2, resubmitting with paymentSignature unlocks deterministic execution.


📄 License

MIT License. Created by Whambammy.

Available Tools

5 tools
base_l2_blob_gas_price_projectorB

Evaluates EIP-4844 blob gas fee dynamics and Base L2 sequencing costs, projecting optimal block inclusion timing for transaction batch settlement. (0.035 USDC on Base L2)

Inputs: payload (required), paymentSignature.

compute_uniswap_v3_quoteC

Calculates exact sqrtPriceX96 tick mathematics, price impact, and swap output amounts for concentrated liquidity pools on Base. (0.02 USDC on Base L2)

Inputs: payload (required), paymentSignature.

flashloan_arbitrage_profit_calculatorA

Calculates net arbitrage profit for multi-hop flashloans across Base L2 DEXes, factoring pool fee tiers, price impact, loan premium (0.09%), and gas burnt. (0.045 USDC on Base L2)

Inputs: payload (required), paymentSignature.

mev_sandwich_risk_simulatorB

Simulates pending swaps against Uniswap v3/v4 tick liquidity to compute exact MEV sandwich vulnerability, maximum extractable value, and safe slippage limits. (0.045 USDC on Base L2)

Inputs: payload (required), paymentSignature.

uniswap_v3_tick_math_preciseB

Arbitrary-precision Q64.96 fixed-point math calculator for Uniswap v3 square root price $(\sqrt{P})$, tick-to-price conversion, and exact liquidity fee compounding. (0.035 USDC on Base L2)

Inputs: payload (required), paymentSignature.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 5 tools

    Disambiguation3/5

    Two tools (uniswap_v3_tick_math_precise and compute_uniswap_v3_quote) both center on Uniswap v3 tick math and sqrtPriceX96, making it unclear which to use for a given calculation. The other three tools are distinct, but the overlap is notable.

    Naming Consistency3/5

    All names use snake_case, but the structure is mixed: most are noun phrases (e.g., mev_sandwich_risk_simulator), while one starts with a verb (compute_uniswap_v3_quote). The inconsistency in pattern reduces predictability.

    Tool Count4/5

    Five tools is a reasonable count for a focused DeFi quant calculator suite, covering math, MEV, quotes, arbitrage, and gas. It is slightly thin for an 'execution' server, but each tool has a clear niche.

    Completeness2/5

    Despite the 'Execution' in the server name, no tool actually executes trades, manages positions, or interacts with wallets. The surface is limited to calculators and simulators, leaving a major gap in lifecycle coverage.

    Related MCP Connectors

    Related MCP Servers