SONEX
  • ABOUT US
    • Introduction
    • Overview
    • Features
    • Roadmap
    • Media Kit
    • Social Media
    • FAQ
    • SONEX V3 Contract Deployments and Liquidity Guide
  • 📔Learn How
    • Swap
    • Liquidity
    • Astar Surge Pre-Deposit
    • Farm
    • X-Pool
  • How to Bridge Tokens from BSC to Soneium Using SONEX Bridge (Powered by Hyperlane)
  • 🚀Policies & Terms
    • Terms of Service
    • Privacy Policy
Powered by GitBook
On this page
  • Introduction
  • Contract Addresses
  • Key Features
  • 1. createAndInitializePoolIfNecessary (Contract: NonfungiblePositionManager)
  • 5. burn(Contract: NonfungiblePositionManager)
  1. ABOUT US

SONEX V3 Contract Deployments and Liquidity Guide

Introduction

SONEX currently supports V3 contract deployments exclusively, offering advanced features to enable seamless pool creation, liquidity provisioning, and trading. This guide explains the deployed contracts, their functions, and how to interact with them for pool creation and liquidity management.


Contract Addresses

Below is the complete list of SONEX V3 contract addresses:

Type

Contract Address

UniswapV3Factory

FACTORY_MULTICALL

PROXY_ADMIN

TRANSPARENT_UPGRADABLE_PROXY

TICK_LENS

SWAP_ROUTER

SWAP_ROUTER_V2

NFT_DESCRIPTOR

POSITION_DESCRIPTOR

NonfungiblePositionManager

QUOTER

QUOTER_V2


Key Features

1. createAndInitializePoolIfNecessary (Contract: NonfungiblePositionManager)

Creates a new pool if it does not exist, then initializes if not initialized

Note:

  • This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool.

Parameter:

  • token0:The contract address of token0 of the pool.

  • token1:The contract address of token1 of the pool.

  • fee:The fee amount of the v3 pool for the specified token pair.

  • sqrtPriceX96:The initial square root price of the pool as a Q64.96 value.

Return:

  • pool:Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessar

  function createAndInitializePoolIfNecessary(
    address token0,
    address token1,
    uint24 fee,
    uint160 sqrtPriceX96
  ) external returns (address pool)

2. Mint (Contract: NonfungiblePositionManager)

Creates a new position wrapped in a NFT. ( Adds liquidity )

Note :

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

Parameter :

  • struct INonfungiblePositionManager.MintParams:The params necessary to mint a position, encoded as MintParams in calldata.

Return :

  • tokenId:The ID of the token that represents the minted position.

  • liquidity:The amount of liquidity for this position.

  • amount0:The amount of token0.

  • amount1:The amount of token1.

  function mint(
    struct INonfungiblePositionManager.MintParams params
  ) external returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1)

3. getPool (Contract: UniswapV3Factory )

Use the getPool function in the FACTORY contract to check if a pool already exists.

Parameter:

  • tokenA:The contract address of either token0 or token1.

  • tokenB:The contract address of the other token.

  • fee:The fee collected upon every swap in the pool, denominated in hundredths of a bip.

Return:

  • pool:The pool address.

  function getPool(
    address tokenA,
    address tokenB,
    uint24 fee
  ) external view returns (address pool)

4. decreaseLiquidity(Contract: NonfungiblePositionManager)

Decreases the amount of liquidity in a position and accounts it to the position (remove Liquidity)

Parameter:

  • struct INonfungiblePositionManager.DecreaseLiquidityParams : tokenId The ID of the token for which liquidity is being decreased,

Return:

  • amount0:The amount of token0 accounted to the position's tokens owed.

  • amount1:The amount of token0 accounted to the position's tokens owed.

function decreaseLiquidity(
   struct INonfungiblePositionManager.DecreaseLiquidityParams params
) external returns (uint256 amount0, uint256 amount1)

5. burn(Contract: NonfungiblePositionManager)

Burns a token ID, which deletes it from the NFT contract.

Note :

  • The token must have 0 liquidity and all tokens must be collected first.

Parameter:

  • tokenId:The ID of the token that is being burned.

function burn(
   uint256 tokenId
) external

6. positions (Contract: NonfungiblePositionManager)

Returns the position information associated with a given token ID.

Note :

  • Throws if the token ID is not valid.

Parameter:

  • tokenId:The ID of the token that represents the position.

Return:

  • nonce:The nonce for permits.

  • operator:The address that is approved for spending.

  • token0:The address of the token0 for a specific pool.

  • token1:The address of the token1 for a specific pool.

  • fee:The fee associated with the pool.

  • tickLower:The lower end of the tick range for the position.

  • tickUpper:The higher end of the tick range for the position.

  • liquidity:The liquidity of the position.

  • feeGrowthInside0LastX128:The fee growth of token0 as of the last action on the individual position.

  • feeGrowthInside1LastX128:The fee growth of token1 as of the last action on the individual position.

  • tokensOwed0:The uncollected amount of token0 owed to the position as of the last computation.

  • tokensOwed1:The uncollected amount of token1 owed to the position as of the last computation

function getPool(
   address tokenA,
   address tokenB,
   uint24 fee
) external view returns (address pool)
PreviousFAQNextSwap

Last updated 3 months ago

0x3E4ff8662820E3dec3DACDb66ef1FFad5Dc5Ab83
0x73348e34bE30A2275E78f88185542f986c4Fe6E9
0x947391374Fe2d4ED1173F644049104993cF2AE00
0xD5B959339E58f0A1dd2dD53412c32B0c8872F05c
0xf8369D9023657749521FB1Bef6F7A520ce898A13
0xDEf357D505690F1b0032a74C3b581163c23d1535
0xd2DdF58Bcc188F335061e41C73ED2A8894c2dD98
0x80557c2EaE4A28E7101d6D7473f87f73Dfd07d71
0x9C31f28b0f46CCa5D2CD64485936984C271382A1
0x6f5F9d55f727928b644B04d987B1c0Cf50AF8C0B
0x12528928e792e6665d52d77c1F59d3e1adBD14DA
0x715BE426a0c8E0A14aBc0130f08F06aa41B1f218