Get Liquidity Amounts
Get the amounts of tokens needed to provide liquidity to a pool based on the maximum you want to spend in one token. You can pass the max amount for both tokens and receive quotes for the two possible scenarios, this way you can check in a single call what option works based on the amounts your user has. E.g. your user wants to provide liquidity to the ETH-USDC pool, and they have 100 USDC and 100 ETH in their wallet. By passing both as the max amounts in `tokenXMaxAmount` you'll get two quotes. One telling how much ETH you need to provided if you send 100 USDC and another telling how much USDC you need to provide given 100 ETH. Then you can choose which one actually fits the liquidity your user has. **Note**: If only one of them is returned it means the price range is outside the current price, so only one token can be provided to create liquidity, the other will always be zero.
x-api-keyx-api-key<token>liquidityProvider?stringOptional provider for entering a liquidity pool. If not provided, Uniswap v3 will be used.
"UNISWAP_V3""PANCAKESWAP_V3""UNISWAP_V4"chainId*numberThe 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
token0*stringThe address (in hexadecimal format) of one of the tokens of the pool. Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for the native token (POL, ETH...); the pool is the one holding its wrapped token (WPOL, WETH...).
token1*stringThe address (in hexadecimal format) of the other token of the pool. Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for the native token (POL, ETH...).
poolFeePercent*numberDefines 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.
0 < value <= 100tickSpacing?|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.
0 < value <= 9007199254740991poolId?|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.
^[0-9]+-0x([0-9a-fA-F]{40}|[0-9a-fA-F]{64})$token0MaxAmount?stringThe maximum amount of token0 to add to the liquidity pool, expressed as a decimal string.
"1"token1MaxAmount?stringThe maximum amount of token1 to add to the liquidity pool, expressed as a decimal string.
"1"minPrice*numberMinimum 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
0 <= value <= 3.4026e+38maxPrice*numberMaximum 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
0 <= value <= 3.4026e+38payGasFeeToken*stringThe token address (in hexadecimal format) used to pay the transaction fee.
gasFeePaymentMethod*stringDefines 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.
"ADD_TO_AMOUNT""DEDUCT_FROM_AMOUNT"type?stringOptional operation type to align the gas estimate with a future add or change liquidity transaction.
"add-liquidity""add-liquidity""change-liquidity"The amounts of tokens needed to provide liquidity.
application/json- response
poolPrice*stringCurrent price of the pool as a string. Price is always p = token1 / token0
amounts*Amounts you need to provide to the pool. If the amounts for two tokens were provided, this will have two items, otherwise it's a single item.