FMZ Quant Uniswap V3 Exchange Pool Liquidity Related Operations Guide (Part 1)

Author: Lydia, Created: 2023-07-21 09:22:33, Updated: 2023-09-12 15:52:51

urrentTick < posData.tickUpper) { amount0wei = Math.floor(posData.liquidity * ((sqrtRatioB - sqrtPrice) / (sqrtPrice * sqrtRatioB))) amount1wei = Math.floor(posData.liquidity * (sqrtPrice - sqrtRatioA)) }

var rangeToken0 = (1.0001 ** -posData.tickUpper) + " ~ " + (1.0001 ** -posData.tickLower)
var amount0 = toAmount(amount0wei, token0Symbol.decimals)
var amount1 = toAmount(amount1wei, token1Symbol.decimals)

return [rangeToken0, token0Symbol.symbol, token1Symbol.symbol, posData.fee / 10000 + "%", 
    `${lowerPrice}(tickLower:${posData.tickLower})`, `${upperPrice}(tickUpper:${posData.tickUpper})`, posData.liquidity, 
        amount0, amount1]

}

function getPool(token0Address, token1Address, fee) { if (BigInt(token0Address) > BigInt(token1Address)) { var tmp = token0Address token0Address = token1Address token1Address = tmp }

// Calculating the contract address of an exchange pool using Uniswap's factory contract
exchange.IO("abi", ContractV3Factory, ABI_Factory)
var poolAddress = exchange.IO("api", ContractV3Factory, "getPool", token0Address, token1Address, fee)
if (!poolAddress) {
    throw "getPool failed"
}

// ABI for registered pool contracts
exchange.IO("abi", poolAddress, ABI_Pool)

// Call the pool contract's slot0 method to query the current exchange pool's data
var slot0 = exchange.IO("api", poolAddress, "slot0")
if (!slot0) {
	throw "get slot0 failed"
}

return {
	"slot0": slot0
}

}


The retrieved liquidity position information (which needs further parsing):

{ “nonce”: “0”, “operator”: “0x0000000000000000000000000000000000000000”, “token1”: “0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2”, “fee”: “3000”, “feeGrowthInside0LastX128”: “552824104363438506727784685971981736468”, “feeGrowthInside1LastX128”: “2419576808699564757520565912733367379”, “tokensOwed0”: “0”, “tokensOwed1”: “0”, “token0”: “0x1f9840a85d5af5bf1d1762f925bdaddc4201f984”, “tickLower”: “-62160”, “tickUpper”: “-41280”, “liquidity”: “19090316141441365693” }


## Parsing Liquidity Holdings for Market Making Ranges

The positions method of Uniswap's NonfungiblePositionManager contract returns tickLower and tickUpper in the liquidity position data. In Uniswap V3, liquidity can be specified within a range, whereas the initial design of Uniswap had uniform distribution of liquidity. The specification of a liquidity range in subsequent versions is aimed at improving the utilization of liquidity capital.

> tickLower: The lower end of the tick range for the position
> tickUpper: The higher end of the tick range for the position

tickLower and tickUpper represent the upper and lower limits of the liquidity. Referring to the Uniswap documentation and its complex formulas, tickLower and tickUpper are essentially price boundaries recorded in exponential form. So, how can we calculate the price range for market-making from these "exponential boundaries"?

It's quite simple. Uniswap uses a base of ```1.0001```. Lower price: ```lowerPrice = 1.0001 ** tickLower```; Upper price: ```upperPrice = 1.0001 ** tickUpper```. The ```**``` operator represents exponentiation. For example, ```1.0001 ** 100``` calculates 1.0001 raised to the power of 100.

This calculated price range is denominated in token1. But what if we want to see the price range denominated in token0?

It can be calculated as follows:
Lower price: 1.0001 ** -tickUpper
Upper price: 1.0001 ** -tickLower

![img](/upload/asset/28d1c03f58dde2c067c45.png)

Compare this to the NFT position we looked up on the chain:

![img](/upload/asset/28d8aa6d6865e0bc32610.png)

![img](/upload/asset/28da47350e28db89b3a5d.png)

![img](/upload/asset/28e296340f3bbc4501cf2.png)

## Parsing the Asset Value in the Current Liquidity Position

In addition to tickUpper and tickLower, the positions method of Uniswap's NonfungiblePositionManager contract returns another important data: liquidity.

By combining the liquidity, tickUpper, tickLower data from the position information with the current price data in the exchange pool, we can calculate the asset value in the current liquidity position.

You may wonder why we need to know the current price in the exchange pool to make the calculation.

This is because once you add liquidity, any price changes within the effective range of your liquidity position imply that your assets have been exchanged. If the current exchange price is not within the effective range of your liquidity provision, there won't be any changes. Therefore, there are three scenarios to consider when calculating:

- The tick of the current price is less than tickLower.
- The tick of the current price is greater than tickUpper.
- The tick of the current price is within the range of tickLower to tickUpper.

This corresponds to the following calculation and processing in the code:

if (currentTick <= posData.tickLower) {
    amount0wei = Math.floor(posData.liquidity * ((sqrtRatioB - sqrtRatioA) / (sqrtRatioA * sqrtRatioB)))
} else if (currentTick > posData.tickUpper) {
    amount1wei = Math.floor(posData.liquidity * (sqrtRatioB - sqrtRatioA))
} else if (currentTick >= posData.tickLower && currentTick < posData.tickUpper) {
    amount0wei = Math.floor(posData.liquidity * ((sqrtRatioB - sqrtPrice) / (sqrtPrice * sqrtRatioB)))
    amount1wei = Math.floor(posData.liquidity * (sqrtPrice - sqrtRatioA))
}

To perform the above calculations, we need to obtain the tick of the current price, which can be obtained directly from the pool contract. To get the address of the pool contract, we can use the getPool method of Uniswap's factory contract. By using the ```slot0``` method of the pool contract, we can retrieve the current price information, including the tick value we need.

![img](/upload/asset/28e366ec4acbd65fbbff4.png)

## Market-making Fees

How to calculate the fees earned by liquidity providers (LPs) based on their positions? Let's explain it step by step:

1. Constants and helper functions:
The code defines some constants (ZERO, TWO, Q96, Q128, Q192, Q256) and two utility functions for converting between readable amount and amount used for internal parameter passing and calculations. These functions handle the conversion of token amount.

2. Token data initialization:
The init() function retrieves token data from the Coingecko API and stores it in the tokens array.

3. Main function main(): This is the main entry point of the code.
- It specifies a wallet address (walletAddress) to query its Uniswap V3 positions.
- It retrieves the address of the Uniswap V3 NonfungiblePositionManager contract (NonfungiblePositionManagerAddress) from the Uniswap V3 Router contract.
- It registers the ABI of the NonfungiblePositionManager contract.
- It queries the number of Uniswap V3 positions owned by the given walletAddress and stores the result in nftBalance.
- Then, it retrieves the token IDs of the NFTs owned by the wallet and stores them in the nftTokenIds array.
- For each NFT token ID, it calls the positions method of the NonfungiblePositionManager contract with it as a parameter to retrieve position data, and then uses the getFees() function to retrieve detailed information about the exchange pool and calculate fee data.
- The result data is stored in the positions array.

4. Function getFees():
This function is used to calculate the fees earned by a specific position as a liquidity provider. It takes position data as input and processes the data to gather relevant information. It uses the API and data from the Uniswap V3 contract (such as fee growth, tick, liquidity, etc.) to perform the fee calculation. The function then returns the fees for token0 and token1 in a specific format.

// Uniswap ABI const ABI_UniswapV3Router = [{"inputs":[{"internalType":"address","name":"_factoryV2","type":"address"},{"internalType":"address","name":"factoryV3","type":"address"},{"internalType":"address","name":"_positionManager","type":"address"},{"internalType":"address","name":"_WETH9","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH9","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"approveMax","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"approveMaxMinusOne","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"approveZeroThenMax","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"approveZeroThenMaxMinusOne","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"callPositionManager","outputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"paths","type":"bytes[]"},{"internalType":"uint128[]","name":"amounts","type":"uint128[]"},{"internalType":"uint24","name":"maximumTickDivergence","type":"uint24"},{"internalType":"uint32","name":"secondsAgo","type":"uint32"}],"name":"checkOracleSlippage","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint24","name":"maximumTickDivergence","type":"uint24"},{"internalType":"uint32","name":"secondsAgo","type":"uint32"}],"name":"checkOracleSlippage","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMinimum","type":"uint256"}],"internalType":"struct IV3SwapRouter.ExactInputParams","name":"params","type":"tuple"}],"name":"exactInput","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMinimum","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct IV3SwapRouter.ExactInputSingleParams","name":"params","type":"tuple"}],"name":"exactInputSingle","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMaximum","type":"uint256"}],"internalType":"struct IV3SwapRouter.ExactOutputParams","name":"params","type":"tuple"}],"name":"exactOutput","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMaximum","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct IV3SwapRouter.ExactOutputSingleParams","name":"params","type":"tuple"}],"name":"exactOutputSingle","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factoryV2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getApprovalType","outputs":[{"internalType":"enum IApproveAndCall.ApprovalType","name":"","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"}],"internalType":"struct IApproveAndCall.IncreaseLiquidityParams","name":"params","type":"tuple"}],"name":"increaseLiquidity","outputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct IApproveAndCall.MintParams","name":"params","type":"tuple"}],"name":"mint","outputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"previousBlockhash","type":"bytes32"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"positionManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"pull","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"refundETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitAllowed","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitAllowedIfNecessary","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitIfNecessary","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"}],"name":"swapExactTokensForTokens","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"}],"name":"swapTokensForExactTokens","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"sweepToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountMinimum","type":"uint256"}],"name":"sweepToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"uint256","name":"feeBips","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"sweepTokenWithFee","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"feeBips","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"sweepTokenWithFee","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"unwrapWETH9","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"}],"name":"unwrapWETH9","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"feeBips","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"unwrapWETH9WithFee","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"uint256","name":"feeBips","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"unwrapWETH9WithFee","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"wrapETH","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}] const ABI_NonfungiblePositionManager = [{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH9","type":"address"},{"internalType":"address","name":"_tokenDescriptor_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Collect","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"liquidity","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"DecreaseLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"liquidity","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"IncreaseLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH9","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"}],"internalType":"struct INonfungiblePositionManager.CollectParams","name":"params","type":"tuple"}],"name":"collect","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"name":"createAndInitializePoolIfNecessary","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct INonfungiblePositionManager.DecreaseLiquidityParams","name":"params","type":"tuple"}],"name":"decreaseLiquidity","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct INonfungiblePositionManager.IncreaseLiquidityParams","name":"params","type":"tuple"}],"name":"increaseLiquidity","outputs":[{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct INonfungiblePositionManager.MintParams","name":"params","type":"tuple"}],"name":"mint","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"positions","outputs":[{"internalType":"uint96","name":"nonce","type":"uint96"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"feeGrowthInside0LastX128","type":"uint256"},{"internalType":"uint256","name":"feeGrowthInside1LastX128","type":"uint256"},{"internalType":"uint128","name":"tokensOwed0","type":"uint128"},{"internalType":"uint128","name":"tokensOwed1","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refundETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitAllowed","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitAllowedIfNecessary","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"selfPermitIfNecessary","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"sweepToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0Owed","type":"uint256"},{"internalType":"uint256","name":"amount1Owed","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"uniswapV3MintCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"unwrapWETH9","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}] const ABI_Pool = ‘[{“inputs”:[],“stateMutability”:“nonpayable”,“type”:“constructor”},{“anonymous”:false,“inputs”:[{“indexed”:true,“internalType”:“address”,“name”:“owner”,“type”:“address”},{“indexed”:true,“internalType”:“int24”,“name”:“tickLower”,“type”:“int24”},{“indexed”:true,“internalType”:“int24”,“name”:“tickUpper”,“type”:“int24”},{“indexed”:false,“internalType”:“uint128”,“name”:“amount”,“type”:“uint128”},{“indexed”:false,“internalType”:“uint256”,“name”:“amount0”,“type”:“uint256”},{“indexed”:false,“internalType”:“uint256”,“name”:“amount1”,“type”:“uint256”}],“name”:“Burn”,“type”:“event”},{“anonymous”:false,“inputs”:[{“indexed”:true,“internalType”:“address”,“name”:“owner”,“type”:“address”},{“indexed”:false,“internalType”:“address”,“name”:“recipient”,“type”:“address”},{“indexed”:true,“internalType”:“int24”,“name”:“tickLower”,“type”:“int24”},{“indexed”:true,“internalType”:“int24”,“name”:“tickUpper”,“type”:“int24”},{“indexed”:false,“internalType”:“uint128”,“name”:“amount0”,“type”:“uint128”},{“indexed”:false,“internalType”:“uint128”,“name”:“amount1”,“type”:“uint128”}],“name”:“Collect”,“type”:“event”},{“anonymous”:false,“inputs”:[{“indexed”:true,“internalType”:“address”,“name”:“sender”,“type”:“address”},{“indexed”:true,“internalType”:“address”,“name”:“recipient”,“type”:“address”},{“indexed”:false,“internalType”:“uint128”,“name”:“amount0”,“type”:“uint128”},{“indexed”:false,“internalType”:“uint128”,“name”:“amount1”,“type”:“uint128”}],“name”:“CollectProtocol”,“type”:“event”},{“anonymous”:false,“inputs”:[{“indexed”:true,“internalType”:“address”,“name”:“sender”,“type”:“address”},{“indexed”:true,“internalType”:“address”,“name”:“recipient”,“type”:“address”},{“indexed”:false,“internalType”:“uint256”,“name”:“amount0”,“type”:“uint256”},{“indexed”:false,“internalType”:“uint256”,“name”:“amount1”,“type”:“uint256”},{“indexed”:false,“internalType”:“uint256”,“name”:“paid0”,“type”:“uint256”},{“indexed”:false,“internalType”:“uint256”,“name”:“paid1”,“type”:“uint256”}],“name”:“Flash”,“type”:“event”},{“anonymous”:false,“inputs”:[{“indexed”:false,“internalType”:“uint16”,“name”:“observationCardinalityNextOld”,“type”:“uint16”},{“indexed”:false,“internalType”:“uint16”,“name”:“observationCardinalityNextNew”,“type”:“uint16”}],“name”:“IncreaseObservationCardinalityNext”,“type”:“event”},{“anonymous”:false,“inputs”:[{“indexed”:false,“internalType”:“uint160”,“name”:“sqrtPriceX96”,“type”:“uint160”},{“indexed”:false,“internalType”:“int24”,“name”:“tick”,“type”:“int24”}],“name”:“Initialize”,“type”:“event”},{“anonymous”:false,“inputs”:[{“indexed”:false,“internalType”:“address”,“name”:“sender”,“type”:“address”},{“indexed”:true,“internalType”:“address”,“name”:“owner”,“type”:“address”},{“indexed”:true,“internalType”:“int24”,“name”:“tickLower”,“type”:“int24”},{“indexed”:true,“internalType”:“int24”,“name”:“tickUpper”,“type”:“int24”},{“indexed”:false,“internalType”:“uint128”,“name”:“amount”,“type”:“uint128”},{“indexed”:false,“internalType”:“uint256”,“name”:“amount0”,“type”:“uint256”},{“indexed”:false,“internalType”:“uint256”,“name”:“amount1”,“type”:“uint256”}],“name”:“Mint”,“type”:“event”},{“anonymous”:false,“inputs”:[{“indexed”:false,“internalType”:“uint8”,“name”:“feeProtocol0Old”,“type”:“uint8”},{“indexed”:false,“internalType”:“uint8”,“name”:“feeProtocol1Old”,“type”:“uint8”},{“indexed”:false,“internalType”:“uint8”,“name”:“feeProtocol0New”,“type”:“uint8”},{“indexed”:false,“internalType”:“uint8”,“name”:“feeProtocol1New”,“type”:“uint8”}],“name”:“SetFeeProtocol”,“type”:“event”},{“anonymous”:false,“inputs”:[{“indexed”:true,“internalType”:“address”,“name”:“sender”,“type”:“address”},{“indexed”:true,“internalType”:“address”,“name”:“recipient”,“type”:“address”},{“indexed”:false,“internalType”:“int256”,“name”:“amount0”,“type”:“int256”},{“indexed”:false,“internalType”:“int256”,“name”:“amount1”,“type”:“int256”},{“indexed”:false,“internalType”:“uint160”,“name”:“sqrtPriceX96”,“type”:“uint160”},{“indexed”:false,“internalType”:“uint128”,“name”:“liquidity”,“type”:“uint128”},{“indexed”:false,“internalType”:“int24”,“name”:“tick”,“type”:“int24”}],“name”:“Swap”,“type”:“event”},{“inputs”:[{“internalType”:“int24”,“name”:“tickLower”,“type”:“int24”},{“internalType”:“int24”,“name”:“tickUpper”,“type”:“int24”},{“internalType”:“uint128”,“name”:“amount”,“type”:“uint128”}],“name”:“burn”,“outputs”:[{“internalType”:“uint256”,“name”:“amount0”,“type”:“uint256”},{“internalType”:“uint256”,“name”:“amount1”,“type”:“uint256”}],“stateMutability”:“nonpayable”,“type”:“function”},{“inputs”:[{“internalType”:“address”,“name”:“recipient”,“type”:“address”},{“internalType”:“int24”,“name”:“tickLower”,“type”:“int24”},{“internalType”:“int24”,“name”:“tickUpper”,“type”:“int24”},{“internalType”:“uint128”,“name”:“amount0Requested”,“type”:“uint128”},{“internalType”:“uint128”,“name”:“amount1Requested”,“type”:“uint128”}],“name”:“collect”,“outputs”:[{“internalType”:“uint128”,“name”:“amount0”,“type”:“uint128”},{“internalType”:“uint128”,“name”:“amount1”,“type”:“uint128”}],“stateMutability”:“nonpayable”,“type”:“function”},{“inputs”:[{“internalType”:“address”,“name”:“recipient”,“type”:“address”},{“internalType”:“uint128”,“name”:“amount0Requested”,“type”:“uint128”},{“internalType”:“uint128”,“name”:“amount1Requested”,“type”:“uint128”}],“name”:“collectProtocol”,“outputs”:[{“internalType”:“uint128”,“name”:“amount0”,“type”:“uint128”},{“internalType”:“uint128”,“name”:“amount1”,“type”:“uint128”}],“stateMutability”:“nonpayable”,“type”:“function”},{“inputs”:[],“name”:“factory”,“outputs”:[{“internalType”:“address”,“name”:"",“type”:“address”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[],“name”:“fee”,“outputs”:[{“internalType”:“uint24”,“name”:"",“type”:“uint24”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[],“name”:“feeGrowthGlobal0X128”,“outputs”:[{“internalType”:“uint256”,“name”:"",“type”:“uint256”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[],“name”:“feeGrowthGlobal1X128”,“outputs”:[{“internalType”:“uint256”,“name”:"",“type”:“uint256”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[{“internalType”:“address”,“name”:“recipient”,“type”:“address”},{“internalType”:“uint256”,“name”:“amount0”,“type”:“uint256”},{“internalType”:“uint256”,“name”:“amount1”,“type”:“uint256”},{“internalType”:“bytes”,“name”:“data”,“type”:“bytes”}],“name”:“flash”,“outputs”:[],“stateMutability”:“nonpayable”,“type”:“function”},{“inputs”:[{“internalType”:“uint16”,“name”:“observationCardinalityNext”,“type”:“uint16”}],“name”:“increaseObservationCardinalityNext”,“outputs”:[],“stateMutability”:“nonpayable”,“type”:“function”},{“inputs”:[{“internalType”:“uint160”,“name”:“sqrtPriceX96”,“type”:“uint160”}],“name”:“initialize”,“outputs”:[],“stateMutability”:“nonpayable”,“type”:“function”},{“inputs”:[],“name”:“liquidity”,“outputs”:[{“internalType”:“uint128”,“name”:"",“type”:“uint128”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[],“name”:“maxLiquidityPerTick”,“outputs”:[{“internalType”:“uint128”,“name”:"",“type”:“uint128”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[{“internalType”:“address”,“name”:“recipient”,“type”:“address”},{“internalType”:“int24”,“name”:“tickLower”,“type”:“int24”},{“internalType”:“int24”,“name”:“tickUpper”,“type”:“int24”},{“internalType”:“uint128”,“name”:“amount”,“type”:“uint128”},{“internalType”:“bytes”,“name”:“data”,“type”:“bytes”}],“name”:“mint”,“outputs”:[{“internalType”:“uint256”,“name”:“amount0”,“type”:“uint256”},{“internalType”:“uint256”,“name”:“amount1”,“type”:“uint256”}],“stateMutability”:“nonpayable”,“type”:“function”},{“inputs”:[{“internalType”:“uint256”,“name”:"",“type”:“uint256”}],“name”:“observations”,“outputs”:[{“internalType”:“uint32”,“name”:“blockTimestamp”,“type”:“uint32”},{“internalType”:“int56”,“name”:“tickCumulative”,“type”:“int56”},{“internalType”:“uint160”,“name”:“secondsPerLiquidityCumulativeX128”,“type”:“uint160”},{“internalType”:“bool”,“name”:“initialized”,“type”:“bool”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[{“internalType”:“uint32[]”,“name”:“secondsAgos”,“type”:“uint32[]”}],“name”:“observe”,“outputs”:[{“internalType”:“int56[]”,“name”:“tickCumulatives”,“type”:“int56[]”},{“internalType”:“uint160[]”,“name”:“secondsPerLiquidityCumulativeX128s”,“type”:“uint160[]”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[{“internalType”:“bytes32”,“name”:"",“type”:“bytes32”}],“name”:“positions”,“outputs”:[{“internalType”:“uint128”,“name”:“liquidity”,“type”:“uint128”},{“internalType”:“uint256”,“name”:“feeGrowthInside0LastX128”,“type”:“uint256”},{“internalType”:“uint256”,“name”:“feeGrowthInside1LastX128”,“type”:“uint256”},{“internalType”:“uint128”,“name”:“tokensOwed0”,“type”:“uint128”},{“internalType”:“uint128”,“name”:“tokensOwed1”,“type”:“uint128”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[],“name”:“protocolFees”,“outputs”:[{“internalType”:“uint128”,“name”:“token0”,“type”:“uint128”},{“internalType”:“uint128”,“name”:“token1”,“type”:“uint128”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[{“internalType”:“uint8”,“name”:“feeProtocol0”,“type”:“uint8”},{“internalType”:“uint8”,“name”:“feeProtocol1”,“type”:“uint8”}],“name”:“setFeeProtocol”,“outputs”:[],“stateMutability”:“nonpayable”,“type”:“function”},{“inputs”:[],“name”:“slot0”,“outputs”:[{“internalType”:“uint160”,“name”:“sqrtPriceX96”,“type”:“uint160”},{“internalType”:“int24”,“name”:“tick”,“type”:“int24”},{“internalType”:“uint16”,“name”:“observationIndex”,“type”:“uint16”},{“internalType”:“uint16”,“name”:“observationCardinality”,“type”:“uint16”},{“internalType”:“uint16”,“name”:“observationCardinalityNext”,“type”:“uint16”},{“internalType”:“uint8”,“name”:“feeProtocol”,“type”:“uint8”},{“internalType”:“bool”,“name”:“unlocked”,“type”:“bool”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[{“internalType”:“int24”,“name”:“tickLower”,“type”:“int24”},{“internalType”:“int24”,“name”:“tickUpper”,“type”:“int24”}],“name”:“snapshotCumulativesInside”,“outputs”:[{“internalType”:“int56”,“name”:“tickCumulativeInside”,“type”:“int56”},{“internalType”:“uint160”,“name”:“secondsPerLiquidityInsideX128”,“type”:“uint160”},{“internalType”:“uint32”,“name”:“secondsInside”,“type”:“uint32”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[{“internalType”:“address”,“name”:“recipient”,“type”:“address”},{“internalType”:“bool”,“name”:“zeroForOne”,“type”:“bool”},{“internalType”:“int256”,“name”:“amountSpecified”,“type”:“int256”},{“internalType”:“uint160”,“name”:“sqrtPriceLimitX96”,“type”:“uint160”},{“internalType”:“bytes”,“name”:“data”,“type”:“bytes”}],“name”:“swap”,“outputs”:[{“internalType”:“int256”,“name”:“amount0”,“type”:“int256”},{“internalType”:“int256”,“name”:“amount1”,“type”:“int256”}],“stateMutability”:“nonpayable”,“type”:“function”},{“inputs”:[{“internalType”:“int16”,“name”:"",“type”:“int16”}],“name”:“tickBitmap”,“outputs”:[{“internalType”:“uint256”,“name”:"",“type”:“uint256”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[],“name”:“tickSpacing”,“outputs”:[{“internalType”:“int24”,“name”:"",“type”:“int24”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[{“internalType”:“int24”,“name”:"",“type”:“int24”}],“name”:“ticks”,“outputs”:[{“internalType”:“uint128”,“name”:“liquidityGross”,“type”:“uint128”},{“internalType”:“int128”,“name”:“liquidityNet”,“type”:“int128”},{“internalType”:“uint256”,“name”:“feeGrowthOutside0X128”,“type”:“uint256”},{“internalType”:“uint256”,“name”:“feeGrowthOutside1X128”,“type”:“uint256”},{“internalType”:“int56”,“name”:“tickCumulativeOutside”,“type”:“int56”},{“internalType”:“uint160”,“name”:“secondsPerLiquidityOutsideX128”,“type”:“uint160”},{“internalType”:“uint32”,“name”:“secondsOutside”,“type”:“uint32”},{“internalType”:“bool”,“name”:“initialized”,“type”:“bool”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[],“name”:“token0”,“outputs”:[{“internalType”:“address”,“name”:"",“type”:“address”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:[],“name”:“token1”,“outputs”:[{“internalType”:“address”,“name”:"",“type”:“address”}],“stateMutability”:“view”,“type”:“function”}]’ const ABI_Factory = '[{“inputs”:[],“stateMutability”:“nonpayable”,“type”:“constructor”},{“anonymous”:false,“inputs”:[{“indexed”:true,“internalType”:“uint24”,“name”:“fee”,“type”:“uint24”},{“indexed”:true,“internalType”:“int24”,“name”:“tickSpacing”,“type”:“int24”}],“name”:“FeeAmountEnabled”,“type”:“event”},{“anonymous”:false,“inputs”:[{“indexed”:true,“internalType”:“address”,“name”:“oldOwner”,“type”:“address”},{“indexed”:true,“internalType”:“address”,“name”:“newOwner”,“type”:“address”}],“name”:“OwnerChanged”,“type”:“event”},{“anonymous”:false,“inputs”:[{“indexed”:true,“internalType”:“address”,“name”:“token0”,“type”:“address”},{“indexed”:true,“internalType”:“address”,“name”:“token1”,“type”:“address”},{“indexed”:true,“internalType”:“uint24”,“name”:“fee”,“type”:“uint24”},{“indexed”:false,“internalType”:“int24”,“name”:“tickSpacing”,“type”:“int24”},{“indexed”:false,“internalType”:“address”,“name”:“pool”,“type”:“address”}],“name”:“PoolCreated”,“type”:“event”},{“inputs”:[{“internalType”:“address”,“name”:“tokenA”,“type”:“address”},{“internalType”:“address”,“name”:“tokenB”,“type”:“address”},{“internalType”:“uint24”,“name”:“fee”,“type”:“uint24”}],“name”:“createPool”,“outputs”:[{“internalType”:“address”,“name”:“pool”,“type”:“address”}],“stateMutability”:“nonpayable”,“type”:“function”},{“inputs”:[{“internalType”:“uint24”,“name”:“fee”,“type”:“uint24”},{“internalType”:“int24”,“name”:“tickSpacing”,“type”:“int24”}],“name”:“enableFeeAmount”,“outputs”:[],“stateMutability”:“nonpayable”


More