Skip to content

Add CoW Protocol quote-verification debug skill#4369

Open
fleupold wants to merge 3 commits intomainfrom
skills/quote_debug
Open

Add CoW Protocol quote-verification debug skill#4369
fleupold wants to merge 3 commits intomainfrom
skills/quote_debug

Conversation

@fleupold
Copy link
Copy Markdown
Contributor

Description

Documents the end-to-end procedure for debugging quote competition

Changes

  • Adds an auto-generated but manually reviewed claude skill that explains how to debug quote competition given logs and simulation capabilities.

How to test

  1. Configure CoW MCP for claude
  2. Tell claude your tenderly api key and rpc url to use (and if not already, install foundry)
  3. Run a few different debug cases and chains (for a given request id, quote id or token pair for which their was no liquidity)

I also have the services as well as the infrastructure checked out so that claude can look at the implementation directly (which may help to do furhter root cause).

fleupold and others added 2 commits April 30, 2026 13:36
Documents the end-to-end procedure for debugging why a CoW Protocol price
quote returned `verified: false` or "Insufficient Liquidity":

- Inputs and lookup paths: `quote_id` → `trace_id` (step 1), and the
  no-quote-id case where the user only has a token pair (and optionally a
  wallet address) → `trace_id` via `parsed.spans.calculate_quote.{sell_token,
  buy_token}` cross-referenced against `request_summary` HTTP 404 (step 1b).
- Pulling per-estimator bids and identifying which solvers failed
  verification (steps 2–3).
- Three replay options, with explicit requirements and tool-selection
  guidance (step 4): reth `debug_traceCall` + an embedded `run_sim.py`
  (programmatic; preferred for root-causing), Tenderly `/simulate` (saved,
  shareable UI), and `cast call --trace` (foundry one-liner).
- Diagnosis (step 5): a 10-point reasoning playbook to anchor on the deepest
  reverting frame, decode unknown selectors and revert payloads, account for
  verifier overrides, and form testable hypotheses; a *non-exhaustive*
  catalogue of common failure modes; and dedicated subsections for decoding
  the solver's `interactions[3]`, OOG / gas binary search, and
  balance/allowance forensics for silent reverts.
- Reporting (step 6): default output is a single sorted table over every
  estimator, with Tenderly links + root cause for non-verified rows and
  the `Err(...)` reason for no-quote rows.
- Cheat sheets for selectors and addresses commonly seen in verifier traces,
  source-of-truth pointers, and gotchas (Tenderly upstream timeouts, the
  `transaction_index=-1` rejection, MCP auto-saved query results, greedy
  `extract`, the `0x…020000` precompile, 0x Settler revert bubbling, V4
  Universal Router depth).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@fleupold fleupold marked this pull request as ready for review May 5, 2026 10:12
@fleupold fleupold requested a review from a team as a code owner May 5, 2026 10:12
@fleupold fleupold requested review from MartinquaXD and squadgazzz May 5, 2026 10:12
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive debugging guide for CoW Protocol quote verification failures. The documentation provides a structured workflow for resolving trace IDs, replaying simulations using Python scripts, Tenderly, or cast, and performing root-cause analysis on transaction reverts through call trace reasoning and interaction decoding. No critical issues were found.

Copy link
Copy Markdown
Contributor

@MartinquaXD MartinquaXD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skill worked well when I tried it so I'm fine with merging it already. But some of the sections could use a bit more polish. I suspect the sections where I feel they lack context made sense together with the context window of the agent at the time. But when booting this into a clean context window I wonder if those parts can cause confusion.

Comment thread docs/QUOTE_VERIFICATION_DEBUG_SKILL.md Outdated
Comment thread docs/QUOTE_VERIFICATION_DEBUG_SKILL.md Outdated
Comment thread docs/QUOTE_VERIFICATION_DEBUG_SKILL.md Outdated
Comment thread docs/QUOTE_VERIFICATION_DEBUG_SKILL.md Outdated
Comment thread docs/QUOTE_VERIFICATION_DEBUG_SKILL.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants