POST
/
lp
/
migrate
Migrate LP position calldata
curl --request POST \
  --url https://trade-api.gateway.uniswap.org/v1/lp/migrate \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "tokenId": 123,
  "walletAddress": "<string>",
  "chainId": 1,
  "inputProtocol": "V2",
  "inputPosition": {
    "pool": {
      "token0": "<string>",
      "token1": "<string>",
      "fee": 123,
      "tickSpacing": 123,
      "hooks": "<string>"
    },
    "tickLower": 123,
    "tickUpper": 123
  },
  "inputPoolLiquidity": "<string>",
  "inputCurrentTick": 123,
  "inputSqrtRatioX96": "<string>",
  "inputPositionLiquidity": "<string>",
  "signature": "<string>",
  "amount0": "<string>",
  "amount1": "<string>",
  "outputProtocol": "V2",
  "outputPosition": {
    "pool": {
      "token0": "<string>",
      "token1": "<string>",
      "fee": 123,
      "tickSpacing": 123,
      "hooks": "<string>"
    },
    "tickLower": 123,
    "tickUpper": 123
  },
  "initialPrice": "<string>",
  "outputPoolLiquidity": "<string>",
  "outputCurrentTick": 123,
  "outputSqrtRatioX96": "<string>",
  "expectedTokenOwed0RawAmount": "<string>",
  "expectedTokenOwed1RawAmount": "<string>",
  "slippageTolerance": 123,
  "deadline": 123,
  "signatureDeadline": 123,
  "simulateTransaction": false
}'
{
  "requestId": "<string>",
  "migrate": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "gasFee": "<string>"
}

Authorizations

x-api-key
string
header
required

Body

application/json
tokenId
number
required
walletAddress
string
required
chainId
enum<number>
required

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
inputProtocol
enum<string>
required

The protocol to use for the swap/order.

Available options:
V2,
V3,
V4,
UNISWAPX_V2,
UNISWAPX_V3
inputPosition
object
required
inputPoolLiquidity
string
required

The amount of liquidity in the pool at a given tick. For more information see the Uniswap V3 Whitepaper.

inputCurrentTick
number
required

The current tick of the pool. For more information see the Uniswap V3 Whitepaper.

inputSqrtRatioX96
string
required

The square root of the ratio of the token0 and token1 in the pool, as a Q64.64 number. For more information see the Uniswap V3 Whitepaper.

inputPositionLiquidity
string
required

The amount of liquidity in the pool at a given tick. For more information see the Uniswap V3 Whitepaper.

amount0
string
required

The quantity of tokens denominated in the token's base units. (For example, for an ERC20 token one token is 1x10^18 base units. For one USDC token one token is 1x10^6 base units.) This value must be greater than 0.

amount1
string
required

The quantity of tokens denominated in the token's base units. (For example, for an ERC20 token one token is 1x10^18 base units. For one USDC token one token is 1x10^6 base units.) This value must be greater than 0.

outputProtocol
enum<string>
required

The protocol to use for the swap/order.

Available options:
V2,
V3,
V4,
UNISWAPX_V2,
UNISWAPX_V3
outputPosition
object
required
expectedTokenOwed0RawAmount
string
required
expectedTokenOwed1RawAmount
string
required
signature
string
initialPrice
string
outputPoolLiquidity
string

The amount of liquidity in the pool at a given tick. For more information see the Uniswap V3 Whitepaper.

outputCurrentTick
number

The current tick of the pool. For more information see the Uniswap V3 Whitepaper.

outputSqrtRatioX96
string

The square root of the ratio of the token0 and token1 in the pool, as a Q64.64 number. For more information see the Uniswap V3 Whitepaper.

slippageTolerance
number

The slippage tollerace as a percentage up to a maximum of two decimal places. For Uniswap Protocols (v2, v3, v4), the slippage tolerance is the maximum amount the price can change between the time the transaction is submitted and the time it is executed. The slippage tolerance is a percentage of the total value of the swap.

When submitting a quote, note that slippage tolerance works differently in UniswapX swaps where it does not set a limit on the Spread in an order. See here for more information.

Note that if the trade type is EXACT_INPUT, then the slippage is in terms of the output token. If the trade type is EXACT_OUTPUT, then the slippage is in terms of the input token.

When submitting a request, slippageTolerance may not be set when autoSlippage is defined. One of slippageTolerance or autoSlippage must be defined.

deadline
number

The unix timestamp at which the order will be reverted if not filled.

signatureDeadline
number
simulateTransaction
boolean
default:false

Response

Migrate LP Position successful.

requestId
string

A unique ID for the request.

migrate
object
gasFee
string

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