POST
/
lp
/
approve
Check if tokens and permits need to be approved to add liquidity
curl --request POST \
  --url https://trade-api.gateway.uniswap.org/v1/lp/approve \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "protocol": "V2",
  "token0": "<string>",
  "token1": "<string>",
  "positionToken": "<string>",
  "chainId": 1,
  "walletAddress": "<string>",
  "amount0": "<string>",
  "amount1": "<string>",
  "generatePermitAsTransaction": false,
  "positionAmount": "<string>",
  "simulateTransaction": true
}'
{
  "requestId": "<string>",
  "token0Approval": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "token1Approval": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "token0Cancel": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "token1Cancel": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "positionTokenApproval": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "permitData": {
    "domain": {},
    "values": {},
    "types": {}
  },
  "token0PermitTransaction": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "token1PermitTransaction": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "positionTokenPermitTransaction": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "gasFeeToken0Approval": "<string>",
  "gasFeeToken1Approval": "<string>",
  "gasFeePositionTokenApproval": "<string>",
  "gasFeeToken0Cancel": "<string>",
  "gasFeeToken1Cancel": "<string>",
  "gasFeeToken0Permit": "<string>",
  "gasFeeToken1Permit": "<string>",
  "gasFeePositionTokenPermit": "<string>"
}

Authorizations

x-api-key
string
header
required

Body

application/json
protocol
enum<string>

The protocol to use for the swap/order.

Available options:
V2,
V3,
V4,
UNISWAPX_V2,
UNISWAPX_V3
token0
string

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

token1
string

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

positionToken
string

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

chainId
enum<number>

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

Available options:
1,
10,
56,
130,
137,
324,
480,
1868,
8453,
10143,
42161,
42220,
43114,
81457,
7777777,
1301,
84532,
11155111
walletAddress
string
amount0
string

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.

amount1
string

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.

generatePermitAsTransaction
boolean
default:false

Indicates whether you want toreceive a permit2 transaction to sign and submit onchain, or a permit message to sign. When set to true, the quote response returns the Permit2 as a calldata which the user signs and broadcasts. When set to false (the default), the quote response returns the Permit2 as a message which the user signs but does not need to broadcast. When using a 7702-delegated wallet, set this field to true. Except for this scenario, it is recommended that this field is set to false. Note that a Permit2 calldata (e.g. true), will provide indefinite permission for Permit2 to spend a token, in contrast to a Permit2 message (e.g. false) which is only valid for 30 days. Further, a Permit2 calldata (e.g. true) requires the user to pay gas to submit the transaction, whereas the Permit2 message (e.g. false ) does not require the user to submit a transaction and requires no gas.

positionAmount
string

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

simulateTransaction
boolean

Response

Approve LP successful.

requestId
string

A unique ID for the request.

token0Approval
object
token1Approval
object
token0Cancel
object
token1Cancel
object
positionTokenApproval
object
permitData
object | null

the permit2 message object for the customer to sign to permit spending by the permit2 contract.

token0PermitTransaction
object
token1PermitTransaction
object
positionTokenPermitTransaction
object
gasFeeToken0Approval
string

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

gasFeeToken1Approval
string

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

gasFeePositionTokenApproval
string

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

gasFeeToken0Cancel
string

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

gasFeeToken1Cancel
string

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

gasFeeToken0Permit
string

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

gasFeeToken1Permit
string

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

gasFeePositionTokenPermit
string

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