V2 DEX Remove Liquidity
Remove liquidity from V2-compatible DEX pools (Uniswap V2, SushiSwap, PancakeSwap). Burns LP tokens and returns underlying token pair. Supports token/token and token/ETH pairs. Configurable slippage and deadline. Ideal for: exiting positions, rebalancing, withdrawing from yield farms, LP management.
Catalog action EVM Onchain wallet Gas receive
Remove liquidity from V2-compatible DEX pools (Uniswap V2, SushiSwap, PancakeSwap). Burns LP tokens and returns underlying token pair. Supports token/token and token/ETH pairs. Configurable slippage and deadline. Ideal for: exiting positions, rebalancing, withdrawing from yield farms, LP management.
This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.
At a Glance
| Field | Value |
|---|---|
| Action ID | v2-remove-liquidity |
| Category | EVM Onchain |
| Connector | wallet |
| Requires gas | Yes |
| Funds movement | receive |
| Tags | blockchain, evm, dex, liquidity, lp, amm, defi, withdraw, v2 |
Payload Schema
| Field | Type | Required | Description |
|---|---|---|---|
chainId | number | Yes | Chain |
tokenA | string | Yes | First token address (use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH) |
tokenB | string | Yes | Second token address (use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH) |
liquidity | string | Yes | Amount of LP tokens to remove (in wei) |
amountAMin | string | No | Minimum amount of tokenA to receive. If not provided, calculated from slippage. |
amountBMin | string | No | Minimum amount of tokenB to receive. If not provided, calculated from slippage. |
slippageBps | number | No | Slippage tolerance in basis points (100 = 1%). Default: 50 (0.5%). Used when amountAMin/amountBMin not provided. |
deadlineMinutes | number | No | Transaction deadline in minutes from now. Default: 20 |
routerAddress | string | No | Optional custom router address. If not provided, uses default V2 router for the chain. |
pairAddress | string | No | Optional LP pair contract address. If not provided, will be fetched from factory. |
Result Schema
| Field | Type | Required | Description |
|---|---|---|---|
status | string | Yes | - |
transactionHash | string | Yes | The transaction hash |
amountA | string | No | Amount of tokenA received |
amountB | string | No | Amount of tokenB received |
liquidityRemoved | string | No | Amount of LP tokens removed |
Examples
json{ "type": "v2-remove-liquidity", "payload": { "tokenA": "ETH", "tokenB": "ETH", "liquidity": "example-liquidity", "chainId": 8453 }, "children": [], "connector": { "type": "wallet", "id": "conn_wallet" }}
bashcurl -X POST "https://api.b3os.org/v1/actions/v2-remove-liquidity/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "tokenA": "ETH", "tokenB": "ETH", "liquidity": "example-liquidity", "chainId": 8453 }}'
Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.
