Skip to Content
Dashboard
API ReferenceLiquidity poolsCreate Swap Liquidity POST

Create Swap Liquidity

This endpoint creates liquidity for a swap liquidity pool

POST
/api/v1/liquidity

Authorization

x-api-key
headerx-api-key<token>

Request Body

application/json
  1. body
liquidityProvider?string

Optional provider for entering a liquidity pool. If not provided, Uniswap v3 will be used.

Value in"UNISWAP_V3""PANCAKESWAP_V3""UNISWAP_V4"
walletAddress*string

The wallet address (in hexadecimal format) that will provide the liquidity.

toAddress*string

The address (in hexadecimal format) receiving the token that represents the provided liquidity.

chainId*number

The blockchain network where the liquidity will be provided. Supported EVM chains:

  • Arbitrum One: 42161
  • Avalanche: 43114
  • Base: 8453
  • BNB Smart Chain: 56
  • Ethereum: 1
  • Gnosis: 100
  • OP Mainnet: 10
  • Polygon: 137
  • X Layer Mainnet: 196
  • Robinhood Chain: 4663
transactionFeePercent?number

Percentage fee applied to the transaction (e.g., 5 for 5%).

Range0 <= value <= 99.99
Default0
payGasFeeToken*string

The token address (in hexadecimal format) used to pay the transaction fee.

gasFeePaymentMethod*string

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.

Value in"ADD_TO_AMOUNT""DEDUCT_FROM_AMOUNT"
tokenIn*string

The address (in hexadecimal format) of the token being swapped from.

amountIn*string

The amount of token being swapped from, expressed as a decimal string.

token0*string

The address (in hexadecimal format) of one of the tokens of the pool.

token1*string

The address (in hexadecimal format) of the other token of the pool.

poolFeePercent*number

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.

Range0 < value <= 100
tickSpacing?|

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.

Range0 < value <= 9007199254740991
poolId?|

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.

Match^[0-9]+-0x([0-9a-fA-F]{40}|[0-9a-fA-F]{64})$
stake?|

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.

minPrice*number

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

Range0 <= value
maxPrice*number

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

Range0 <= value
slippage?number

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%.

Range0 <= value <= 99
Default0.5
extraFee?

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.

metadata?

Custom metadata. Key-value pairs with string values. Max 1KB size.

Response Body

Data about the creation of the liquidity

application/json
  1. response
operation*