# Create Liquidity URL: /docs/api-reference/liquidity-pools/CreateLiquidityController_handle_v1 This endpoint creates liquidity for a liquidity pool ## POST /api/v1/liquidity/create Request: `POST https://api.notus.team/api/v1/liquidity/create` Authentication: send your project's API key in the `x-api-key` header. ```json { "description": "This endpoint creates liquidity for a liquidity pool", "operationId": "CreateLiquidityController_handle_v1", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateLiquidityDTO" } } } }, "responses": { "200": { "description": "Data about the creation of the liquidity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LiquidityOperationResponseDTO" } } } }, "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": "BAD_DEDUCT_FEE_TOKEN", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "BAD_DEDUCT_FEE_TOKEN" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "You requested to deduct the gas fee from the amounts, but the token given \"0x82af49447d8a07e3bd95bd0d56f35241523fbab1\" is not one of tokens of the pool 0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f,0xaf88d065e77c8cc2239327c5edb3a432268e5831." ] } } }, { "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": "BAD_FEE", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "BAD_FEE" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "Wrong fee given." ] } } }, { "type": "object", "description": "BAD_AMOUNTS", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "BAD_AMOUNTS" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The amounts given to change the liquidity can't have one positive and another negative, nor can they be zero." ] } } }, { "type": "object", "description": "TICK_OUT_OF_RANGE", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "TICK_OUT_OF_RANGE" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The provided value in `minPrice` is too high." ] } } }, { "type": "object", "description": "PRICE_RANGE_TOO_NARROW", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "PRICE_RANGE_TOO_NARROW" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The price range between `minPrice` and `maxPrice` does not cover a full tick-spacing step of this pool (10 ticks, about 0.1%); widen it." ] } } }, { "type": "object", "description": "NOT_SUPPORTED_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_SUPPORTED_TOKENS" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "Uniswap V3 does not support these tokens (0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)." ] } } }, { "type": "object", "description": "POOL_ID_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": [ "POOL_ID_MISMATCH" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The poolId does not match the pool the request resolves to" ] } } }, { "type": "object", "description": "INVALID_ADDRESS", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "INVALID_ADDRESS" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The address '0x556B9306565093C855AEA9AE92A594704c2Cd59e' is not valid for chain '56'" ] } } } ] } } } }, "403": { "description": "FORBIDDEN", "content": { "application/json": { "schema": { "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." ] } } } } } }, "404": { "description": "NOT_FOUND", "content": { "application/json": { "schema": { "oneOf": [ { "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" ] } } }, { "type": "object", "description": "POOL_NOT_FOUND", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 404 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "POOL_NOT_FOUND" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "This pool was not found in our systems (pool: 42161-0x864abca0a6202dba5b8868772308da953ff125b0f95015adbf89aaf579e903a8). Make sure you are passing the right 'poolId'." ] } } } ] } } } } }, "summary": "Create Liquidity", "tags": [ "Liquidity Pools" ] } ``` ### Schema CreateLiquidityDTO ```json { "type": "object", "properties": { "liquidityProvider": { "description": "Optional provider for entering a liquidity pool. If not provided, Uniswap v3 will be used.", "type": "string", "enum": [ "UNISWAP_V3", "PANCAKESWAP_V3", "UNISWAP_V4" ], "examples": [ "UNISWAP_V3" ] }, "walletAddress": { "description": "The wallet address (in hexadecimal format) that will provide the liquidity.", "type": "string", "examples": [ "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464" ] }, "toAddress": { "description": "The address (in hexadecimal format) receiving the token that represents the provided liquidity.", "type": "string", "examples": [ "0x1337133713371337133713371337133713371337" ] }, "chainId": { "description": "The blockchain network where the liquidity will be provided. \n 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 ] }, "transactionFeePercent": { "default": 0, "description": "Percentage fee applied to the transaction (e.g., 5 for 5%).", "type": "number", "minimum": 0, "maximum": 99.99, "examples": [ 2.5 ] }, "payGasFeeToken": { "description": "The token address (in hexadecimal format) used to pay the transaction fee.", "type": "string", "examples": [ "0x82af49447d8a07e3bd95bd0d56f35241523fbab1" ] }, "gasFeePaymentMethod": { "type": "string", "enum": [ "ADD_TO_AMOUNT", "DEDUCT_FROM_AMOUNT" ], "description": "Defines how the fee will be paid: \"ADD_TO_AMOUNT\" adds it to the input amount, while \"DEDUCT_FROM_AMOUNT\" subtracts it from the input amount.", "examples": [ "ADD_TO_AMOUNT" ] }, "tokenIn": { "description": "The address (in hexadecimal format) of the token being swapped from.", "type": "string", "examples": [ "0x2791bca1f2de4661ed88a30c99a7a9449aa84174" ] }, "amountIn": { "type": "string", "description": "The amount of token being swapped from, expressed as a decimal string.", "examples": [ "1.2" ] }, "token0": { "description": "The address (in hexadecimal format) of one of the tokens of the pool.", "type": "string", "examples": [ "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f" ] }, "token1": { "description": "The address (in hexadecimal format) of the other token of the pool.", "type": "string", "examples": [ "0xaf88d065e77c8cc2239327c5edb3a432268e5831" ] }, "poolFeePercent": { "type": "number", "exclusiveMinimum": 0, "maximum": 100, "description": "Defines the fee earned by providing liquidity. Lower values are recommended for more stable tokens, while higher values are better suited for volatile assets. The values allowed depend on the provider, so check the provider docs too to know which fee tiers are allowed.", "examples": [ 1 ] }, "tickSpacing": { "type": [ "integer", "null" ], "exclusiveMinimum": 0, "maximum": 9007199254740991, "description": "Tick spacing of the pool (`tickSpacing` from the pool list). Part of the pool's identity where the fee alone does not fix it: required for UNISWAP_V4, ignored by the providers that read it from the pool.", "examples": [ 60 ] }, "poolId": { "type": [ "string", "null" ], "pattern": "^[0-9]+-0x([0-9a-fA-F]{40}|[0-9a-fA-F]{64})$", "description": "Optional `id` of the pool from the pool list. When sent, the request fails with POOL_ID_MISMATCH unless the pool it resolves to is this one.", "examples": [ "137-0x5b5bf85e5dc1e76ff90025ac5d8e8595fb575443" ] }, "stake": { "description": "PANCAKESWAP_V3 only: also stake the new position in the pool's MasterChefV3 farm, in the same operation, so it earns CAKE from the start. The wallet approves the staker contract on the position manager once: on the pool's network that approval is part of this operation; coming from another network it is a second, sponsored operation returned as `stakeApprovalUserOperation`. Ignored when the pool has no live farm or `toAddress` is not `walletAddress`. The response's `staked` tells whether the position will be staked.", "type": [ "boolean", "null" ], "examples": [ false ] }, "minPrice": { "type": "number", "minimum": 0, "description": "Minimum price the liquidity will be active. If the price goes below this, the liquidity won't be active and will generate no revenues. This will allow to concentrate the liquidity to a price range, thus enhancing the gains. Price is always `p = token1 / token0`", "examples": [ 83475.12 ] }, "maxPrice": { "type": "number", "minimum": 0, "description": "Maximum price the liquidity will be active. If the price goes above this, the liquidity won't be active and will generate no revenues. This will allow to concentrate the liquidity to a price range, thus enhancing the gains. Price is always `p = token1 / token0`", "examples": [ 102300.5 ] }, "slippage": { "default": 0.5, "description": "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%.", "type": "number", "minimum": 0, "maximum": 99, "examples": [ 1.2 ] }, "extraFee": { "description": "Optional extra fee that can be charged in addition to the transaction fee (configured in the dashboard or via `transactionFeePercent`). This extra fee is deducted from the input token and sent to the specified `toAddress`, allowing you to define a custom recipient for this additional charge.", "type": "object", "properties": { "percentage": { "type": "number", "minimum": 0, "maximum": 99.99, "description": "The percentage of the extra fee to be charged", "examples": [ 1.5 ] }, "toAddress": { "description": "The address (in hexadecimal format) receiving 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", "toAddress", "chainId", "payGasFeeToken", "gasFeePaymentMethod", "tokenIn", "amountIn", "token0", "token1", "poolFeePercent", "minPrice", "maxPrice" ] } ``` ### Schema LiquidityOperationResponseDTO ```json { "type": "object", "properties": { "operation": { "$ref": "#/components/schemas/CreateLiquidityDTO" } }, "required": [ "operation" ] } ```