Uniswap V4 Swaps

Simulate Uniswap V4 swaps with hooks, dynamic fees, and multi-hop routing.

Updated Nov 5, 2025
One-click install
npx skills add https://github.com/cyotee/crane --skill uniswap-v4-swaps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Uniswap V4 Swaps
Source: https://github.com/cyotee/crane/tree/main/.claude/skills/uniswap-v4-swaps
Command: npx skills add https://github.com/cyotee/crane --skill uniswap-v4-swaps

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Easily understand and simulate Uniswap V4 swap flows, including before/after swap hooks, dynamic LP fees, and multi-hop routing, for analysis and development.

Core Features & Use Cases

  • Explains the swap flow from pool initialization to settlement, including beforeSwap and afterSwap hooks and their delta effects.
  • Documents how dynamic fees can be overridden or left static, and how liquidity and tick crossings affect outcomes.
  • Provides guidance for developers modeling DeFi swap scenarios, validating swap parameters, and integrating with router logic.

Quick Start

Run a swap scenario in a sandbox pool to observe how before/after hooks alter deltas and the final balances.

Frequently Asked Questions about Uniswap V4 Swaps

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do Uniswap V4 hooks affect swap deltas and final balances?

Uniswap V4 hooks affect swap deltas by executing custom logic in beforeSwap and afterSwap callbacks, which directly alters the token deltas and final settlement balances for a pool. This Skill simulates those state transitions to show the exact delta effects.

How do I model multi-hop routing and tick crossings for Uniswap V4 swaps?

To model multi-hop routing and tick crossings for Uniswap V4 swaps, you trace the swap flow across multiple pools while accounting for liquidity changes at each tick. This Skill automates the validation of routing logic and liquidity impacts across single- and multi-hop paths.

Can I override dynamic LP fees during a Uniswap V4 smart contract swap?

Yes, you can override dynamic LP fees during a Uniswap V4 swap by configuring the hook logic to return a custom fee value. This Skill documents how dynamic fees can be set to static or overridden based on pool parameters and hook integration.

What is the execution flow from pool initialization to settlement in Uniswap V4?

The execution flow in Uniswap V4 spans pool initialization, beforeSwap hooks, the core swap state transition, afterSwap hooks, and final delta settlement. This Skill explains the entire lifecycle to help developers analyze swap flows and validate router logic.

Does this Skill support validating delta accounting for complex Uniswap V4 swap scenarios?

Yes, this Skill supports validating delta accounting for complex Uniswap V4 swap scenarios. It allows developers and researchers to model DeFi swap parameters, verify fee accounting, and ensure accurate state transitions across multi-hop routing paths.