uniswap-swap-simulation
SKILL.md
Uniswap Swap Simulation
Overview
This skill covers simulating Uniswap swaps, calculating price impact, and analyzing routing decisions.
Key Concepts
- Price Impact: The change in pool price caused by a swap. Larger swaps have higher impact.
- Slippage: Difference between expected and executed price, including price movement between submission and execution.
- Routing: Finding the optimal path across pools and protocols for best execution.
Simulating a Swap
Use the Quoter contract to simulate swaps without executing:
import { createPublicClient, http, encodeFunctionData } from "viem";