# Reinvest the accumulated fees of a liquidity position URL: /docs/api-reference/liquidity-pools/ReinvestFeesController_handle_v1 Collects the accumulated pool fees of the position, swaps the excess side to the exact token proportion the position range demands at the current pool price, and increases the liquidity of the same NFT — all in a single user operation. ## POST /api/v1/liquidity/reinvest ```json { "description": "Collects the accumulated pool fees of the position, swaps the excess side to the exact token proportion the position range demands at the current pool price, and increases the liquidity of the same NFT — all in a single user operation.", "operationId": "ReinvestFeesController_handle_v1", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReinvestFeesDTO" } } } }, "responses": { "200": { "description": "Quote information for the reinvest operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReinvestFeesOperationResponseDTO" } } } }, "400": { "description": "BAD_REQUEST", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "description": "NOT_AUTHORIZED_TOKENS", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "NOT_AUTHORIZED_TOKENS" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "" ] } } }, { "type": "object", "description": "NOT_SUPPORTED_CHAIN", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "NOT_SUPPORTED_CHAIN" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "UNISWAP_V3 does not support this chain ([object Object])." ] } } }, { "type": "object", "description": "NO_FEES_TO_REINVEST", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "NO_FEES_TO_REINVEST" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The liquidity position has no accumulated fees available to reinvest" ] } } }, { "type": "object", "description": "LIQUIDITY_PROVIDER_MISMATCH", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "LIQUIDITY_PROVIDER_MISMATCH" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The liquidityProvider does not match the provider of the position manager given in nftAddress" ] } } }, { "type": "object", "description": "UNKNOWN_POSITION_MANAGER", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "UNKNOWN_POSITION_MANAGER" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The nftAddress is not a supported liquidity position manager on this chain" ] } } } ] } } } }, "403": { "description": "FORBIDDEN", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "description": "UNAVAILABLE_COMPUTE_UNITS", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 403 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "UNAVAILABLE_COMPUTE_UNITS" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The project doesn't have enough compute units to perform this action. Please upgrade your plan." ] } } }, { "type": "object", "description": "POSITION_NOT_OWNED_BY_WALLET", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 403 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "POSITION_NOT_OWNED_BY_WALLET" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The liquidity position NFT does not belong to the provided wallet address" ] } } } ] } } } }, "404": { "description": "NOT_FOUND", "content": { "application/json": { "schema": { "type": "object", "description": "ACCOUNT_ABSTRACTION_ADDRESS_NOT_REGISTERED_WITH_PROJECT", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 404 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "ACCOUNT_ABSTRACTION_ADDRESS_NOT_REGISTERED_WITH_PROJECT" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The requested wallet \"0x6e397ddf51d9f15dbe0414538e7529f51f2e5464\" is not registered with the project" ] } } } } } }, "500": { "description": "INTERNAL_SERVER_ERROR", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "description": "SWAP_QUOTE_UNAVAILABLE", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 500 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "SWAP_QUOTE_UNAVAILABLE" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "No swap provider was able to quote the proportion-adjustment swap for the reinvest operation. Try again in a few moments." ] } } }, { "type": "object", "description": "BLOCKCHAIN_ERROR", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 500 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "BLOCKCHAIN_ERROR" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "We had a problem fetching the data from the blockchain. If the problem persists, contact our support." ] } } } ] } } } } }, "summary": "Reinvest the accumulated fees of a liquidity position", "tags": [ "Liquidity Pools" ] } ``` ### Schema ReinvestFeesDTO ```json { "type": "object", "properties": { "liquidityProvider": { "description": "Optional provider for the reinvest operation. Defaults to Uniswap v3 if omitted.", "type": "string", "enum": [ "UNISWAP_V3", "PANCAKESWAP_V3", "UNISWAP_V4" ], "examples": [ "UNISWAP_V3" ] }, "nftAddress": { "description": "Optional position manager (NFT contract) of the position: the `nftAddress` returned when the position was created. It selects the liquidity provider; if `liquidityProvider` is also sent, both must name the same provider. Without either, Uniswap V3 is used.", "type": [ "string", "null" ], "examples": [ "0xC36442b4a4522E871399CD717aBDD847Ab11FE88" ] }, "walletAddress": { "description": "Wallet that owns the liquidity position NFT.", "type": "string", "examples": [ "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464" ] }, "chainId": { "description": "Target blockchain for the reinvest operation. Supported EVM chains:\n- Arbitrum One: 42161\n- Avalanche: 43114\n- Base: 8453\n- BNB Smart Chain: 56\n- Ethereum: 1\n- Gnosis: 100\n- OP Mainnet: 10\n- Polygon: 137\n- X Layer Mainnet: 196\n- Robinhood Chain: 4663", "type": "number", "examples": [ 42161 ] }, "nftId": { "type": "string", "description": "ID of the NFT that represents the liquidity", "examples": [ "2375619234" ] }, "slippage": { "default": 0.5, "description": "Maximum tolerated slippage for the increaseLiquidity leg (1 unit = 1%). The proportion-adjustment swap runs with a fixed 0.5% slippage.", "type": "number", "exclusiveMinimum": 0, "maximum": 99, "examples": [ 1 ] }, "transactionFeePercent": { "default": 0, "description": "Custom project fee percent to apply over the adjustment swap amount.", "type": "number", "minimum": 0, "maximum": 99.99, "examples": [ 2.5 ] }, "extraFee": { "description": "Optional extra fee configuration that is charged once during the reinvest.", "type": "object", "properties": { "percentage": { "type": "number", "minimum": 0, "maximum": 99.99, "description": "Percentage of an optional extra fee applied during the reinvest.", "examples": [ 1.5 ] }, "toAddress": { "description": "Recipient wallet for the extra fee.", "type": "string", "examples": [ "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464" ] } }, "required": [ "percentage", "toAddress" ] }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Custom metadata. Key-value pairs with string values. Max 1KB size.", "examples": [ { "key": "value" } ] } }, "required": [ "walletAddress", "chainId", "nftId" ] } ``` ### Schema ReinvestFeesOperationResponseDTO ```json { "type": "object", "properties": { "operation": { "$ref": "#/components/schemas/ReinvestFeesDTO" } }, "required": [ "operation" ] } ```