Uni V3 pools (Concentrated Liquidity)

Our concentrated liquidity pools are built on Uniswap v3 with added staking features.

You could find relevant Uni V3 contract addresses at Testnet Contract Addresses

Modifications from Uniswap v3

  • Liquidity providers can now choose to receive continuous KYO rewards by staking their liquidity.

  • Trading fees generated from staked liquidity will be distributed to veKYO stakers instead.

  • Unstaked liquidity will still earn trading fees.

Technical Details of the Modifications

  • UniswapV3Pool now tracks rewardGrowth alongside feeGrowth0 and feeGrowth1

  • UniswapV3Pool also tracks liquidityStaked (along with liquidity), which ranges from 0 to total liquidity, representing the portion that is staked.

  • NonfungiblePositionManager has been modified to support both staking and unstaking functionality.

Interacting with Concentrated Liquidity Pools

We've intentionally kept all function signatures unchanged to simplify integration.

Kyo-specific interactions can be performed as follows.

Important: Transferring a position NFT will automatically un-stake all staked liquidity within that position.

NonfungiblePositionManager nft;
UniswapV3Factory factory;

(uint256 tokenId,,) = nft.mint(...) // provide liquidity first


// how to read position information
// liquidity: the total liquidity of the position, including staked and unstaked portions.
// liquidityStaked: the staked portion of liquidity. between 0 and liquidity
(, , , , , , , uint128 liquidity, , , , ) = nft.positions(tokenId);
(uint128 liquidityStaked,) = nft.positions2(tokenId);

//how to stake:
uint128 liquidityAmountToStake; // must be less than or equal to (liquidity - liquidityStaked) or reverts
nft.stake(tokenId, liquidityAmountToStake);

//how to unstake:
uint128 liquidityAmountToUnstake; // must be less than or equal to liquidityStaked or reverts
nft.unstake(tokenId, liquidityAmountToUnstake);

Last updated

Was this helpful?