Withdraw Swap Liquidity
This endpoint withdraws liquidity from a pool, swaps the received tokens to a single output token, and sends to the specified address.
In: header
Optional provider for withdrawing from a liquidity pool. If not provided, Uniswap v3 will be used.
"UNISWAP_V3"The wallet address (in hexadecimal format) that owns the liquidity position.
^0x[a-fA-F0-9]{40}$The address (in hexadecimal format) that will receive the output tokens.
^0x[a-fA-F0-9]{40}$The blockchain network where the liquidity position exists. Supported EVM chains:
- Arbitrum One: 42161
- Avalanche: 43114
- Base: 8453
- BNB Smart Chain: 56
- Ethereum: 1
- Gnosis: 100
- OP Mainnet: 10
- Polygon: 137
The NFT token ID representing the liquidity position.
The address (in hexadecimal format) of the token to receive after withdrawing and swapping.
^0x[a-fA-F0-9]{40}$Percentage of the liquidity position to withdraw (e.g., 100 for full withdrawal, 50 for half).
0.01 <= value <= 100Percentage fee applied to the transaction (e.g., 5 for 5%).
00 <= value <= 99.99The token address (in hexadecimal format) used to pay the transaction fee.
^0x[a-fA-F0-9]{40}$Optional parameter controlling the maximum deviation allowed of the expected price of a trade and the actual price at which the trade is executed, with a minimum value of 0.5 and a maximum value of 99, default is 0.5, where 1 unit equals 1%.
0.50.5 <= value <= 99Optional extra fee that can be charged in addition to the transaction fee. This extra fee is deducted from the output token and sent to the specified toAddress.
Empty Object
Response Body
curl -X POST "https://api.notuslabs.xyz/api/v1/liquidity/withdraw" \ -H "Content-Type: application/json" \ -d '{ "walletAddress": "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464", "toAddress": "0x1337133713371337133713371337133713371337", "chainId": 42161, "tokenId": "123456", "tokenOut": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", "percentage": 100, "payGasFeeToken": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1" }'{
"operation": {
"liquidityProvider": "UNISWAP_V3",
"walletAddress": "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464",
"toAddress": "0x1337133713371337133713371337133713371337",
"chainId": 42161,
"tokenId": "123456",
"tokenOut": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"percentage": 100,
"transactionFeePercent": 2.5,
"payGasFeeToken": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"slippage": 1.2,
"extraFee": {
"percentage": 1.5,
"toAddress": "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464"
},
"metadata": {
"key": "value"
}
}
}{
"statusCode": 400,
"id": "NOT_AUTHORIZED_TOKENS",
"message": ""
}{
"statusCode": 403,
"id": "UNAVAILABLE_COMPUTE_UNITS",
"message": "The project doesn't have enough compute units to perform this action. Please upgrade your plan."
}{
"statusCode": 404,
"id": "ACCOUNT_ABSTRACTION_ADDRESS_NOT_REGISTERED_WITH_PROJECT",
"message": "The requested wallet \"0x6e397ddf51d9f15dbe0414538e7529f51f2e5464\" is not registered with the project"
}Rebalance a liquidity position with a new price range POST
Collects the entire position, swaps assets as needed, and mints a fresh Uniswap v3 position in the requested range.
Create Deposit Transaction POST
This endpoint provides a transaction to be executed by an EOA to deposit funds into a smart wallet. This is a convenience endpoint to easily build a transfer to be executed by Metamask or any other EOA wallet