v1

latestOpenAPI 3.0.02026-07-142115792.8 KB
Liquidity

Check if tokens and permits need to be approved to add liquidity

Checks if the wallet address has the required approvals. If the wallet address does not have the required approval, then the response will include the transactions to approve the tokens. If the wallet address has the required approval, then the response will be empty for the corresponding tokens. If the parameter simulateTransaction is set to true, then the response will include the gas fees for the approval transactions.

Note that approval is required for both creating and removing positions in V2 pools. Approval is only required for creating positions in V3 and V4 pools.

post/lp/approve

Request body

protocol'V2' | 'V3' | 'V4' | 'UNISWAPX' | 'UNISWAPX_V2' | 'UNISWAPX_V3'

The protocol to use for the swap/order.

token0string

The token which will be sent, specified by its token address. For a list of supported tokens, see the FAQ.

token1string

The token which will be sent, specified by its token address. For a list of supported tokens, see the FAQ.

positionTokenstring

The address of the NFT representing the position. Required when requesting approval for removing liquidity from a V2 position (provide address of V2 NFT). Required when requesting approval for migrating a V3 position to a V4 position (provide address of V3 NFT).

chainId1 | 10 | 56 | 130 | 137 | 324 | 480 | 1868 | 8453 | 10143 | 42161 | 42220 | 43114 | 81457 | 7777777 | 1301 | 84532 | 11155111 | 143 | 196

The unique ID of the blockchain. For a list of supported chains see the FAQ.

walletAddressstring
amount0string

The amount of token0 to be added or removed from the position. To estimate the amount of token0 needed when adding a new position, use the /lp/create endpoint to simulate the position creation.

amount1string

The amount of token1 to be added or removed from the position. To estimate the amount of token1 needed when adding a new position, use the /lp/create endpoint to simulate the position creation.

generatePermitAsTransactionboolean

Dictates whether you receive permits to sign or permit approval transactions to submit onchain for your wallet in order to swap or LP. If set to true, the response will include an approval transaction depending on your allowance. If set to false you would receive a permit to sign depending on your allowance. The default is false.

positionAmountstring

Only required when getting approval for removing a V2 position. Populated with the amount of the V2 position to be removed (eg. amount0*amount1).

simulateTransactionboolean

Response

Approve LP successful.

requestIdstring

A unique ID for the request.

gasFeeToken0Approvalstring

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.

gasFeeToken1Approvalstring

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.

gasFeePositionTokenApprovalstring

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.

gasFeeToken0Cancelstring

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.

gasFeeToken1Cancelstring

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.

gasFeeToken0Permitstring

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.

gasFeeToken1Permitstring

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.

gasFeePositionTokenPermitstring

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.