---
title: "Remove Liquidity"
method: POST
path: "/defi/v1/yieldaggregator/removeliquidity"
tags: ["yieldaggregator"]
---

# Remove Liquidity

`POST /defi/v1/yieldaggregator/removeliquidity`

## Request

- Base URL: `https://svc.blockdaemon.com`
- URL: `https://svc.blockdaemon.com/defi/v1/yieldaggregator/removeliquidity`
- Auth: API key in header `X-API-Key`

Withdraws tokens from a yield aggregator market, supporting advanced options like dual-token removal and slippage control. The response includes chain details, addresses, gas usage, and a unique reference ID for transaction tracking.

> 💡 
**Compute Unit Value:** `120` (Fixed)

## Request body

- YieldaggregatorRemoveliquidityRequest: The request body for a /defi/v1/yieldaggregator/removeliquidity
  - `yieldAggregatorId` '5200' | '5201' | '5202' | '5203' | '5204': A unique identifier to route the transaction to the appropriate yield aggregator instance. This parameter is optional if a default aggregator is used.
  - `marketAddress` string, required: The blockchain address of the liquidity pool or market where tokens will be deposited. This parameter directs the transaction to the correct pool within the yield aggregator.
  - `tokenOut` string, required: The token that the user wishes to receive as a result of the liquidity removal. This parameter specifies which output token is desired when liquidity is withdrawn from the pool.
  - `amountIn` string, required: Amount of tokens to remove from the liquidity pool, specified in the token's smallest denomination (base units). Do not send human-readable decimal values. Examples: 1 WETH (18 decimals) = "1000000000000000000"; 1 USDC (6 decimals) = "1000000".
  - `from` string, required: Blockchain address of the sender. For EVM chains, use a checksummed hex address (e.g., 0xABCDEF...). This address must hold sufficient balance and will sign the transaction.
  - `isDual` boolean: An optional flag indicating whether the liquidity removal should be executed in dual-token mode. If set to true, liquidity will be removed for both tokens in the pool according to the pool’s ratio; if false or omitted, only a single token (as specified by tokenOut) will be withdrawn.
  - `slippage` string: The maximum allowable percentage deviation between the expected and executed swap price. Default is 1, meaning a 1% tolerance (acceptable range: 0 to 100).
  - `enableAggregator` boolean: Enable swap aggregator functionality to facilitate swaps between tokens that are not directly convertible with the underlying asset. Set this boolean flag to true to activate advanced routing logic for such conversions.
  - `gas` string: Maximum number of gas units to allocate for the transaction, as an integer string (e.g., '200000'). If omitted, gas is estimated automatically. Note: this is gas units, not wei or gwei.
  - `gasPriority` string: Specifies the desired gas fee priority (e.g., 'low', 'medium', or 'high'), which influences the transaction speed and cost.
  - `enableFee` boolean: Flag to include a basis points fee transaction alongside the main transaction when set to true.

## Response `200`

Successful response

- object
  - `status` integer
  - `msg` string
  - `data` object

---

[API](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api.md) - [All operations](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api/llms.txt) - [OpenAPI document](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api/revisions/ec053b7c8041?raw)
