Manage Liquidity
Overview
This is the primary skill for all liquidity operations on Uniswap. It handles three distinct actions:
- Add liquidity — Find the best pool, recommend a range, handle approvals, deposit tokens
- Remove liquidity — Withdraw tokens from an existing position (partial or full)
- Collect fees — Claim accumulated trading fees from a position
Each action delegates to the liquidity-manager agent for execution, with optional pool-researcher delegation for intelligent pool selection. This skill extracts the user's intent, validates parameters, and orchestrates the right agent workflow.
When to Use
Activate when the user says anything related to providing, removing, or managing Uniswap liquidity:
Adding liquidity:
- "Add liquidity to ETH/USDC"
- "Provide LP for WETH/USDC on Base"
- "LP into the best pool for ETH/USDC"
- "Open a position in UNI/WETH"
- "I want to LP $5000 into ETH/USDC"
- "Deposit liquidity into the 0.05% pool"
- "Add $10K to my WETH/USDC position"
Removing liquidity:
- "Remove my liquidity"
- "Close my ETH/USDC position"
- "Withdraw 50% from position #12345"
- "Exit my LP position"
Collecting fees:
- "Collect my fees"
- "Claim accumulated fees from position #12345"
- "How much in fees have I earned?" (check first, then offer to collect)
Parameters
For Adding Liquidity
| Parameter |
Required |
Default |
How to Extract |
| action |
Yes |
— |
Always "add" for this sub-flow |
| token0 |
Yes |
— |
First token: "ETH", "WETH", "USDC", or 0x address |
| token1 |
Yes |
— |
Second token |
| amount |
Yes |
— |
Dollar amount ("$5000"), token amount ("2.5 ETH"), or both |
| chain |
No |
ethereum |
"ethereum", "base", "arbitrum", "optimism", "polygon" |
| version |
No |
v3 |
"v2" (passive), "v3" (concentrated), "v4" (hooks) |
| range |
No |
medium |
"narrow" (±5%), "medium" (±15%), "wide" (±50%), "full" (±∞) |
| feeTier |
No |
Auto-detect |
"0.01%", "0.05%", "0.3%", "1%" or bps: 100, 500, 3000, 10000 |
For Removing Liquidity / Collecting Fees
| Parameter |
Required |
Default |
How to Extract |
| action |
Yes |
— |
"remove" or "collect" |
| positionId |
Yes* |
— |
NFT token ID ("position #12345") or found via search |
| chain |
No |
ethereum |
Chain where the position exists |
| percentage |
No |
100 |
"50%", "all", "half" — only for remove |
| collectFees |
No |
true |
Whether to also collect fees when removing |
*If the user doesn't provide a position ID (e.g., "remove my ETH/USDC position"), search for it using get_positions_by_owner and confirm with the user before proceeding.
Workflow
Add Liquidity Flow
Step 1: PARSE INTENT
├── Extract: tokens, amount, chain, version, range, fee tier
├── Normalize: "ETH" → "WETH", "$5K" → "$5000"
└── If any required params missing → ASK the user (don't guess)
Step 2: POOL SELECTION (if user didn't specify exact pool)
├── If "best pool" or no fee tier specified:
│ └── Delegate to pool-researcher: "Find the best pool for {token0}/{token1} on {chain}"
│ Pool researcher returns ranked pools with APY, TVL, depth
│ Pick the recommended pool (or present top 3 if user wants to choose)
└── If specific pool given: use directly
Step 3: PRE-FLIGHT CHECKS
├── Check safety status via check_safety_status
├── Verify wallet has sufficient token balances
└── If checks fail → STOP and tell user what's wrong
Step 4: DELEGATE TO LIQUIDITY-MANAGER
├── Pass: token0, token1, amount, chain, version, range, feeTier, pool address
├── The liquidity-manager agent handles:
│ a. Check and execute token approvals (Permit2)
│ b. Calculate optimal tick range based on range strategy
│ c. Simulate the add-liquidity transaction
│ d. Route through safety-guardian for validation
│ e. Execute the transaction
│ f. Wait for confirmation
└── Returns: positionId, amounts deposited, tick range, tx hash
Step 5: PRESENT RESULT
├── Position ID (NFT token ID)
├── Tokens deposited with USD values
├── Price range (lower price, upper price, current price)
├── Estimated fee APY (from pool-researcher data)
├── Explorer link to the transaction
└── Tip: "Monitor with /track-performance"
Remove Liquidity Flow
Step 1: IDENTIFY POSITION
├── If position ID given → use directly
├── If "my ETH/USDC position" → call get_positions_by_owner
│ ├── Filter by token pair and chain
│ ├── If multiple matches → LIST them and ask user to choose
│ └── If no matches → tell user "No positions found for {pair}"
└── Confirm: "I found position #{id} — {pair} {feeTier} with {value}. Remove?"
Step 2: DELEGATE TO LIQUIDITY-MANAGER
├── Pass: positionId, chain, percentage (default 100%), collectFees
├── Agent handles: fee collection → partial/full removal → safety validation → execution
└── Returns: tokens received, fees collected, tx hash
Step 3: PRESENT RESULT
├── Tokens received with USD values
├── Fees collected (if any)
├── Total value received
├── Explorer link
└── If partial removal: remaining position details
Collect Fees Flow
Step 1: IDENTIFY POSITION (same as remove)
Step 2: CHECK UNCOLLECTED FEES
├── Call get_position to see tokensOwed0 and tokensOwed1
├── If fees are zero → "No fees to collect on this position"
└── Show fee amounts and ask to proceed
Step 3: DELEGATE TO LIQUIDITY-MANAGER
├── Pass: positionId, chain, action: "collect"
└── Returns: fees collected, tx hash
Step 4: PRESENT RESULT
├── Fees collected (token amounts + USD values)
├── Explorer link
└── Tip: "Your position is still active and earning more fees"
Critical Decision Points
These are the moments where the skill must stop and ask rather than assume:
| Situation |
Action |
| Multiple positions match |
List all matches, ask user to pick one |
| Amount exceeds wallet balance |
Show balance, ask if they want a smaller amount |
| Pool TVL < $10,000 |
Warn about low liquidity risk, ask to confirm |
| Range strategy not specified |
Default to "medium" but mention the tradeoffs |
| First time LPing |
Briefly explain IL risk before proceeding |
| Remove > 50% of pool liquidity |
Warn about price impact on exit |
Output Format
Successful Add
Liquidity Added Successfully
Position: #456789
Pool: WETH/USDC 0.05% (V3, Ethereum)
Deposited:
0.5 WETH ($980)
980 USDC ($980)
Total: $1,960
Range:
Lower: $1,700 (tick -204714)
Upper: $2,300 (tick -199514)
Current: $1,963 — IN RANGE ✓
Width: ±15% (medium)
Expected Fee APY: ~15-21% (based on 7d pool data)
Tx: https://etherscan.io/tx/0x...
Next steps:
- Monitor with: "How are my positions doing?"
- Rebalance if out of range: "Rebalance position #456789"
- Collect fees anytime: "Collect fees from position #456789"
Successful Remove
Liquidity Removed
Position: #456789 (CLOSED)
Received:
0.52 WETH ($1,020)
950 USDC ($950)
Total: $1,970
Fees Collected:
0.01 WETH ($19.60)
15.20 USDC ($15.20)
Total fees: $34.80
Net Result: +$44.80 (+2.3%) including fees
Tx: https://etherscan.io/tx/0x...
Important Notes
- IL risk: Always mention impermanent loss risk when adding liquidity to volatile pairs. Don't bury it.
- Gas costs: On Ethereum mainnet, LP operations cost $15-50 in gas. Mention this for small positions.
- Range tradeoffs: Narrow = higher fees but more rebalancing. Wide = lower fees but less maintenance. Always explain.
- V2 vs V3: V2 is "set and forget" with lower returns. V3 requires active management but earns more. Help the user choose.
- Never auto-execute: For remove and rebalance, always confirm with the user before executing.
Error Handling
| Error |
User-Facing Message |
Suggested Action |
| Wallet not configured |
"No wallet configured for transactions." |
Set WALLET_TYPE + PRIVATE_KEY in .env |
| Insufficient balance |
"You have X but need Y to add liquidity." |
Reduce amount or swap for needed tokens |
| Pool not found |
"No pool found for X/Y at this fee tier." |
Try different fee tier or check token names |
| Position not found |
"Position #ID not found on this chain." |
Check chain and position ID |
| Safety check failed |
"Transaction blocked by safety: {reason}" |
Adjust parameters or check safety config |
| Transaction reverted |
"Transaction failed: {reason}" |
Check slippage, amounts, or try again |
| liquidity-manager unavailable |
"Liquidity agent is not available." |
Check agent configuration |
1---
2name: manage-liquidity
3description: Add liquidity, remove liquidity, or collect fees on Uniswap V2/V3/V4 pools. Handles the full flow including pool selection, range optimization, approvals, safety checks, and transaction execution. Use when the user wants to LP, provide liquidity, remove a position, or collect accumulated fees.
4model: opus
5allowed-tools: [Task(subagent_type:liquidity-manager), Task(subagent_type:pool-researcher), mcp__uniswap__get_positions_by_owner, mcp__uniswap__get_position, mcp__uniswap__check_safety_status]
6metadata:
7 source: https://skillmd.com/skills/modbender/manage-liquidity
8---
9
10# Manage Liquidity
11
12## Overview
13
14This is the primary skill for all liquidity operations on Uniswap. It handles three distinct actions:
15
161. **Add liquidity** — Find the best pool, recommend a range, handle approvals, deposit tokens
172. **Remove liquidity** — Withdraw tokens from an existing position (partial or full)
183. **Collect fees** — Claim accumulated trading fees from a position
19
20Each action delegates to the `liquidity-manager` agent for execution, with optional `pool-researcher` delegation for intelligent pool selection. This skill extracts the user's intent, validates parameters, and orchestrates the right agent workflow.
21
22## When to Use
23
24Activate when the user says anything related to providing, removing, or managing Uniswap liquidity:
25
26**Adding liquidity:**
27- "Add liquidity to ETH/USDC"
28- "Provide LP for WETH/USDC on Base"
29- "LP into the best pool for ETH/USDC"
30- "Open a position in UNI/WETH"
31- "I want to LP $5000 into ETH/USDC"
32- "Deposit liquidity into the 0.05% pool"
33- "Add $10K to my WETH/USDC position"
34
35**Removing liquidity:**
36- "Remove my liquidity"
37- "Close my ETH/USDC position"
38- "Withdraw 50% from position #12345"
39- "Exit my LP position"
40
41**Collecting fees:**
42- "Collect my fees"
43- "Claim accumulated fees from position #12345"
44- "How much in fees have I earned?" (check first, then offer to collect)
45
46## Parameters
47
48### For Adding Liquidity
49
50| Parameter | Required | Default | How to Extract |
51| --------- | -------- | ------------ | ------------------------------------------------------------- |
52| action | Yes | — | Always "add" for this sub-flow |
53| token0 | Yes | — | First token: "ETH", "WETH", "USDC", or 0x address |
54| token1 | Yes | — | Second token |
55| amount | Yes | — | Dollar amount ("$5000"), token amount ("2.5 ETH"), or both |
56| chain | No | ethereum | "ethereum", "base", "arbitrum", "optimism", "polygon" |
57| version | No | v3 | "v2" (passive), "v3" (concentrated), "v4" (hooks) |
58| range | No | medium | "narrow" (±5%), "medium" (±15%), "wide" (±50%), "full" (±∞) |
59| feeTier | No | Auto-detect | "0.01%", "0.05%", "0.3%", "1%" or bps: 100, 500, 3000, 10000 |
60
61### For Removing Liquidity / Collecting Fees
62
63| Parameter | Required | Default | How to Extract |
64| ---------- | -------- | ---------- | ------------------------------------------------------- |
65| action | Yes | — | "remove" or "collect" |
66| positionId | Yes* | — | NFT token ID ("position #12345") or found via search |
67| chain | No | ethereum | Chain where the position exists |
68| percentage | No | 100 | "50%", "all", "half" — only for remove |
69| collectFees| No | true | Whether to also collect fees when removing |
70
71*If the user doesn't provide a position ID (e.g., "remove my ETH/USDC position"), search for it using `get_positions_by_owner` and confirm with the user before proceeding.
72
73## Workflow
74
75### Add Liquidity Flow
76
77```
78Step 1: PARSE INTENT
79├── Extract: tokens, amount, chain, version, range, fee tier
80├── Normalize: "ETH" → "WETH", "$5K" → "$5000"
81└── If any required params missing → ASK the user (don't guess)
82
83Step 2: POOL SELECTION (if user didn't specify exact pool)
84├── If "best pool" or no fee tier specified:
85│ └── Delegate to pool-researcher: "Find the best pool for {token0}/{token1} on {chain}"
86│ Pool researcher returns ranked pools with APY, TVL, depth
87│ Pick the recommended pool (or present top 3 if user wants to choose)
88└── If specific pool given: use directly
89
90Step 3: PRE-FLIGHT CHECKS
91├── Check safety status via check_safety_status
92├── Verify wallet has sufficient token balances
93└── If checks fail → STOP and tell user what's wrong
94
95Step 4: DELEGATE TO LIQUIDITY-MANAGER
96├── Pass: token0, token1, amount, chain, version, range, feeTier, pool address
97├── The liquidity-manager agent handles:
98│ a. Check and execute token approvals (Permit2)
99│ b. Calculate optimal tick range based on range strategy
100│ c. Simulate the add-liquidity transaction
101│ d. Route through safety-guardian for validation
102│ e. Execute the transaction
103│ f. Wait for confirmation
104└── Returns: positionId, amounts deposited, tick range, tx hash
105
106Step 5: PRESENT RESULT
107├── Position ID (NFT token ID)
108├── Tokens deposited with USD values
109├── Price range (lower price, upper price, current price)
110├── Estimated fee APY (from pool-researcher data)
111├── Explorer link to the transaction
112└── Tip: "Monitor with /track-performance"
113```
114
115### Remove Liquidity Flow
116
117```
118Step 1: IDENTIFY POSITION
119├── If position ID given → use directly
120├── If "my ETH/USDC position" → call get_positions_by_owner
121│ ├── Filter by token pair and chain
122│ ├── If multiple matches → LIST them and ask user to choose
123│ └── If no matches → tell user "No positions found for {pair}"
124└── Confirm: "I found position #{id} — {pair} {feeTier} with {value}. Remove?"
125
126Step 2: DELEGATE TO LIQUIDITY-MANAGER
127├── Pass: positionId, chain, percentage (default 100%), collectFees
128├── Agent handles: fee collection → partial/full removal → safety validation → execution
129└── Returns: tokens received, fees collected, tx hash
130
131Step 3: PRESENT RESULT
132├── Tokens received with USD values
133├── Fees collected (if any)
134├── Total value received
135├── Explorer link
136└── If partial removal: remaining position details
137```
138
139### Collect Fees Flow
140
141```
142Step 1: IDENTIFY POSITION (same as remove)
143
144Step 2: CHECK UNCOLLECTED FEES
145├── Call get_position to see tokensOwed0 and tokensOwed1
146├── If fees are zero → "No fees to collect on this position"
147└── Show fee amounts and ask to proceed
148
149Step 3: DELEGATE TO LIQUIDITY-MANAGER
150├── Pass: positionId, chain, action: "collect"
151└── Returns: fees collected, tx hash
152
153Step 4: PRESENT RESULT
154├── Fees collected (token amounts + USD values)
155├── Explorer link
156└── Tip: "Your position is still active and earning more fees"
157```
158
159## Critical Decision Points
160
161These are the moments where the skill must **stop and ask** rather than assume:
162
163| Situation | Action |
164| ---------------------------------- | ------------------------------------------------------------- |
165| Multiple positions match | List all matches, ask user to pick one |
166| Amount exceeds wallet balance | Show balance, ask if they want a smaller amount |
167| Pool TVL < $10,000 | Warn about low liquidity risk, ask to confirm |
168| Range strategy not specified | Default to "medium" but mention the tradeoffs |
169| First time LPing | Briefly explain IL risk before proceeding |
170| Remove > 50% of pool liquidity | Warn about price impact on exit |
171
172## Output Format
173
174### Successful Add
175
176```text
177Liquidity Added Successfully
178
179 Position: #456789
180 Pool: WETH/USDC 0.05% (V3, Ethereum)
181
182 Deposited:
183 0.5 WETH ($980)
184 980 USDC ($980)
185 Total: $1,960
186
187 Range:
188 Lower: $1,700 (tick -204714)
189 Upper: $2,300 (tick -199514)
190 Current: $1,963 — IN RANGE ✓
191 Width: ±15% (medium)
192
193 Expected Fee APY: ~15-21% (based on 7d pool data)
194
195 Tx: https://etherscan.io/tx/0x...
196
197 Next steps:
198 - Monitor with: "How are my positions doing?"
199 - Rebalance if out of range: "Rebalance position #456789"
200 - Collect fees anytime: "Collect fees from position #456789"
201```
202
203### Successful Remove
204
205```text
206Liquidity Removed
207
208 Position: #456789 (CLOSED)
209
210 Received:
211 0.52 WETH ($1,020)
212 950 USDC ($950)
213 Total: $1,970
214
215 Fees Collected:
216 0.01 WETH ($19.60)
217 15.20 USDC ($15.20)
218 Total fees: $34.80
219
220 Net Result: +$44.80 (+2.3%) including fees
221
222 Tx: https://etherscan.io/tx/0x...
223```
224
225## Important Notes
226
227- **IL risk**: Always mention impermanent loss risk when adding liquidity to volatile pairs. Don't bury it.
228- **Gas costs**: On Ethereum mainnet, LP operations cost $15-50 in gas. Mention this for small positions.
229- **Range tradeoffs**: Narrow = higher fees but more rebalancing. Wide = lower fees but less maintenance. Always explain.
230- **V2 vs V3**: V2 is "set and forget" with lower returns. V3 requires active management but earns more. Help the user choose.
231- **Never auto-execute**: For remove and rebalance, always confirm with the user before executing.
232
233## Error Handling
234
235| Error | User-Facing Message | Suggested Action |
236| ----------------------------- | --------------------------------------------------------- | ----------------------------------------- |
237| Wallet not configured | "No wallet configured for transactions." | Set WALLET_TYPE + PRIVATE_KEY in .env |
238| Insufficient balance | "You have X but need Y to add liquidity." | Reduce amount or swap for needed tokens |
239| Pool not found | "No pool found for X/Y at this fee tier." | Try different fee tier or check token names|
240| Position not found | "Position #ID not found on this chain." | Check chain and position ID |
241| Safety check failed | "Transaction blocked by safety: {reason}" | Adjust parameters or check safety config |
242| Transaction reverted | "Transaction failed: {reason}" | Check slippage, amounts, or try again |
243| liquidity-manager unavailable | "Liquidity agent is not available." | Check agent configuration |