1---
2name: uniswap
3description: Assist with Uniswap swaps, liquidity provision, and avoiding common DeFi losses.
4metadata:
5 source: https://skillmd.com/skills/modbender/uniswap
6 clawdbot:
7 emoji: 🦄
8 os:
9 - linux
10 - darwin
11 - win32
12---
13
14## Swap Execution
15- Slippage tolerance sets max acceptable price change — 0.5% for stablecoins, 1-3% for volatile pairs, higher for low liquidity tokens
16- "Price impact" and "slippage" are different — impact is immediate effect of your trade size, slippage is protection against price movement
17- High price impact (>2%) means you're moving the market — split large trades or use limit orders on Uniswap X
18- Transaction deadline prevents stale swaps — 20-30 minutes default is usually fine, but pending tx beyond deadline will fail
19
20## MEV and Frontrunning
21- Public swaps on Uniswap are visible in mempool before execution — bots can sandwich your trade
22- Use MEV protection: swap through Uniswap wallet (built-in protection), or connect via Flashbots Protect RPC
23- Signs of sandwich: execution price worse than quoted, with suspicious buy before and sell after your tx
24- Uniswap X routes through private order flow — significantly reduces MEV extraction
25
26## Token Approval Traps
27- First swap of any token requires approval transaction — this is normal, costs gas, and happens once per token per spender
28- "Infinite approval" is the default — convenient but risky if Uniswap router is ever compromised
29- Check and revoke old approvals at revoke.cash — approvals persist forever until explicitly revoked
30- Approval transaction can succeed while swap fails — user pays gas for approval but swap reverts on slippage
31
32## Fake Tokens
33- Anyone can create a token with any name and symbol — "USDC" on Uniswap might not be real USDC
34- Always verify token contract address on CoinGecko, CoinMarketCap, or project's official site
35- Warning signs: no liquidity, recently created, honeypot (can buy but not sell), tax on transfer
36- Uniswap shows warning for unverified tokens — don't ignore it, especially for tokens you found via links
37
38## Liquidity Provision
39- Impermanent loss is real and permanent when you withdraw — LPs lose vs just holding when prices diverge
40- V3 concentrated liquidity amplifies both gains and losses — narrow range means more fees but higher IL risk
41- Out-of-range positions earn zero fees — price moves outside your range, you hold 100% of the depreciating asset
42- V2 is simpler: full range, less management, but less capital efficient — consider for volatile pairs you want to forget
43
44## V3 Position Management
45- Narrower range = more fees per dollar but more rebalancing — only worth it if you actively manage
46- Gas costs to adjust positions add up — each add/remove liquidity is a transaction
47- "Collect fees" is separate from "remove liquidity" — uncollected fees stay in the position
48- NFT represents your V3 position — losing the NFT means losing access to the liquidity
49
50## Gas Optimization
51- Approve + swap is two transactions on first use — budget gas for both
52- L2s (Arbitrum, Base, Optimism) have Uniswap with 10-50x lower fees — same interface, same liquidity depth
53- Swapping during low gas periods (weekends, UTC night) saves significantly on mainnet
54- Failed transactions still cost gas — simulate first if unsure about slippage or liquidity
55
56## Failed Swap Causes
57- "Insufficient liquidity" — try smaller amount or different route
58- "Slippage exceeded" — price moved during pending period, increase slippage or retry
59- "Transfer failed" — token has transfer tax or restrictions, may be a scam token
60- "Deadline exceeded" — transaction was pending too long, just retry
61- "Approve first" — need to approve token before swap, this is normal
62
63## Uniswap X and Limit Orders
64- Uniswap X uses off-chain orders filled by market makers — no gas if order isn't filled
65- Limit orders let you set target price — order sits until price is reached or expires
66- Partial fills possible — large orders may fill incrementally
67- Check order status in the app — pending orders can be cancelled
68
69## Safety Checklist Before Large Swaps
70- Verify token contract address matches official source
71- Check price impact percentage — high impact means bad execution
72- Confirm slippage is set appropriately for the pair
73- Use MEV protection for mainnet trades
74- Consider splitting very large trades
75- Double-check recipient address if sending to different wallet