Uniswap
Installation
SKILL.md
Swap Execution
- Slippage tolerance sets max acceptable price change — 0.5% for stablecoins, 1-3% for volatile pairs, higher for low liquidity tokens
- "Price impact" and "slippage" are different — impact is immediate effect of your trade size, slippage is protection against price movement
- High price impact (>2%) means you're moving the market — split large trades or use limit orders on Uniswap X
- Transaction deadline prevents stale swaps — 20-30 minutes default is usually fine, but pending tx beyond deadline will fail
MEV and Frontrunning
- Public swaps on Uniswap are visible in mempool before execution — bots can sandwich your trade
- Use MEV protection: swap through Uniswap wallet (built-in protection), or connect via Flashbots Protect RPC
- Signs of sandwich: execution price worse than quoted, with suspicious buy before and sell after your tx
- Uniswap X routes through private order flow — significantly reduces MEV extraction
Token Approval Traps
- First swap of any token requires approval transaction — this is normal, costs gas, and happens once per token per spender
- "Infinite approval" is the default — convenient but risky if Uniswap router is ever compromised
- Check and revoke old approvals at revoke.cash — approvals persist forever until explicitly revoked
- Approval transaction can succeed while swap fails — user pays gas for approval but swap reverts on slippage