Uniswap V4 Flash Accounting

Track token deltas in transient storage and settle at unlock.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Flash accounting defers token transfers by tracking deltas in transient storage and settles at unlock, enabling more gas-efficient multi-step swaps.

Core Features & Use Cases

  • Transient storage to hold per-currency deltas during complex sequences.
  • Delta accounting to accumulate net positions across pools and settle at the end.
  • Unlock-based settlement to pay or take tokens when the callback completes, supporting multi-hop swaps and liquidity changes.
  • Real-world use: execute multi-pool strategies in a single transaction with net settlements.

Quick Start

Explain how flash accounting defers token transfers and performs settlement at unlock.

Frequently Asked Questions about Uniswap V4 Flash Accounting

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

FAQPage Schema
How does flash accounting defer token transfers in Uniswap V4?

Flash accounting defers token transfers by tracking per-currency deltas in transient storage and executing net settlements at unlock, enabling gas-efficient multi-step swaps within a single transaction.

How do I settle net token deltas across multiple pools in a single transaction?

You settle net token deltas across multiple pools by accumulating positions during complex sequences and paying or taking tokens when the unlock callback completes, ensuring end-to-end settlement in one transaction.

What is transient storage used for in delta accounting?

Transient storage is used in delta accounting to hold per-currency deltas temporarily during complex multi-pool operations, allowing the system to track net positions before final settlement at unlock.

Can I execute multi-hop swaps and liquidity changes using unlock-based settlement?

Yes, unlock-based settlement supports multi-hop swaps and liquidity changes by paying or taking tokens when the callback completes, allowing you to execute multi-pool strategies in a single transaction with net settlements.

What is the best way to execute multi-pool strategies without transferring tokens at every step?

The best way to execute multi-pool strategies without transferring tokens at every step is using flash accounting, which defers transfers by tracking deltas in transient storage and performing a single net settlement at unlock.

Why use nonzero delta counting for complex swap sequences?

You use nonzero delta counting to accurately track accumulated net positions across pools and ensure all balances are fully settled when the unlock callback completes, preventing incomplete multi-step operations.