Mint

Uniswap V3 Action Plugin - Mint

Description

Creates a new position wrapped in a NFT

Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized a method does not exist, i.e. the pool is assumed to be initialized.

Method

mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256))

Input Parameters

NamePlugin TypeDescription

to

FctAddress

Non-fungible Position Manager Address

Method Parameters

NamePlugin TypeDescription

params.tuple

FctTuple

"Params.tuple" parameters

NamePlugin TypeRequired?Description

token0

FctAddress

Address of token0

token1

FctAddress

Address of token1

fee

FctValue24

Fee of token0/token1 Pool

tickLower

FctInteger24

tickUpper

FctInteger24

amount0Desired

FctValue

amount1Desired

FctValue

amount0Min

FctValue

amount1Min

FctValue

recipient

FctAddress

deadline

FctValue

Returned Values

NamePlugin TypeDescription

tokenID

FctValue

TokenID of minted token

liquidity

FctValue128

The new liquidity amount as a result of the increase

amount0

FctValue

The amount of token0 to acheive resulting liquidity

amount1

FctValue

The amount of token1 to acheive resulting liquidity

Example

Example with initParams

const mint = new UniswapV3.actions.Mint({
 chainId: 1,
 initParams: {
   to: "0x..." // Non-fungible Position Manager
   methodParams: {
     "params.tuple": {
       token0: "...",
       token1: "...",
       fee: "...",
       tickLower: "...",
       tickUpper: "...",
       amount0Desired: "...",
       amount1Desired: "...",
       amount0Min: "...", 
       amount1Min: "...",
       recipient: "...",
       deadline: "...",
     }
   }
 }
})

Example without initParams

const mint = new UniswapV3.actions.Mint({ chainId: 1 })

mint.input.set({
   to: "0x..." // Non-fungible Position Manager
   methodParams: {
     "params.tuple": {
       token0: "...",
       token1: "...",
       fee: "...",
       tickLower: "...",
       tickUpper: "...",
       amount0Desired: "...",
       amount1Desired: "...",
       amount0Min: "...", 
       amount1Min: "...",
       recipient: "...",
       deadline: "...",
     }
   }
})

Learn more

Learn more about Uniswap V3 Mint function here

Last updated