Exercise 2 Inc Liq

A comprehensive guide to increasing liquidity in a Uniswap V3 position. This lesson covers the process of increasing liquidity for a specific token ID, including the use of the mint function to create a position, the role of the increase liquidity function, and how to call the increase liquidity function in a non-fungible position manager.

DeFi Developer

Uniswap V3

1. Math Liquidity
A comprehensive guide to calculating liquidity in a Uniswap V3 pool. The lesson covers the equations for liquidity when the current price is less than or equal to the lower price, greater than or equal to the upper price, and when the current price is between the lower and upper price. Duration: 6min
2. Math Liquidity Delta
A deep dive into Uniswap v3's liquidity delta. This lesson covers how much of token X or token Y you need to add or remove to change your liquidity by a set amount between two price ranges. Duration: 8min
3. Graph Tick Spacing
A comprehensive guide to understanding Uniswap V3 tick spacing. This lesson explores the concept of tick spacing in Uniswap V3 and its implications for liquidity provision. The lesson covers the relationship between tick spacing, price ranges for liquidity provision, and gas consumption during swaps. Duration: 5min
4. Code Walkthrough Pool Mint
A detailed explanation of Uniswap V3 Pool's `mint` function, specifically focusing on the internal function calls and their associated variables. The video lesson breaks down the code flow, starting with how `mint` utilizes `modifyPosition` and delves into the `updatePosition` and `tick` functions, highlighting the roles of crucial variables such as `liquidityDelta` and `feeGrowthInside`. It also explains how the `mint` function checks the contract's balance for token zero and token one after the `uniswapV3MintCallback` is executed. Duration: 9min
5. Code Walkthrough Pool Burn
A comprehensive guide to understanding the burn function in the UniswapV3 pool smart contract - This function is a low-level function used to remove liquidity. The function does not transfer the tokens directly to your wallet. You'll need to call the 'collect' function to do so. Duration: 2min
6. Code Walkthrough Pool Collect
A comprehensive guide to the "collect" function in UniswapV3PoolActions - The lesson explains the purpose of the "collect" function and how it is used in UniswapV3PoolActions. It also explains the inputs and outputs of the function and provides a detailed code walkthrough. Duration: 1min
7. Contract Call Position Manager Mint
A comprehensive guide to managing Uniswap V3 liquidity using the NonfungiblePositionManager contract. This lesson covers the four functions available on the contract; mint, increase liquidity, decrease liquidity, and collect. We will explore each function's purpose and how they interact with Uniswap V3 pools. Duration: 1min
8. Code Walkthrough Position Manager Mint
A comprehensive guide to understanding the mint function in the NonFungiblePositionManager contract. This lesson will demonstrate the parameters that are passed into the mint function and will explain the actions taken when the mint function is executed in a specific scenario. Duration: 5min
9. Contract Call Position Manager Increase Liq
A comprehensive guide to increasing liquidity on Uniswap v3 using non-fungible positions - The lesson covers the steps involved in increasing liquidity on Uniswap v3, starting with calling the 'increaseLiquidity' function on the NonFungiblePositionManager, to the 'mint' function on Uniswap v3, and ending with the transfer of tokens. Duration: 1min
10. Code Walkthrough Position Manager Increase Liq
A comprehensive code walkthrough of the increaseLiquidity() function in a NonFungiblePositionManager Solidity smart contract. This function allows a user to add liquidity to a position, and the video highlights the key steps involved, including how the function handles calculating fees and updating liquidity levels. Duration: 3min
11. Contract Call Position Manager Decrease Liq
A detailed explanation of the decrease liquidity function in Uniswap V3. The lesson covers the two main functions involved in the decrease liquidity process: 'decreaseLiquidity' and 'burn'. The video walks through each function, detailing how the process works and how tokens are transferred. Duration: 1min
12. Code Walkthrough Position Manager Decrease Liq
A detailed code walkthrough of the 'decreaseLiquidity' function in a Solidity smart contract. The lesson covers what the function does, the parameters and modifiers it uses, and how the code updates the position and fee growth inside variables. Duration: 3min
13. Contract Call Position Manager Collect
A technical overview of the Uniswap V3 collect function. The lesson covers the two scenarios in which the collect function is called: to collect swap fees for providing liquidity, or to remove liquidity. It also includes a breakdown of the four steps involved in the removal of liquidity process. Duration: 1min
14. Code Walkthrough Position Manager Collect
A detailed walkthrough of the Solidity `collect` function for Non-Fungible Position Manager. The function collects fees owed to a specific position, updates the position's fee growth, and transfers the fees to the specified recipient. It is designed to handle the collection of fees that are owed to a specific position in a liquidity pool. Duration: 3min
15. Exercise 1 Mint
A beginner's guide to managing liquidity in Uniswap V3. This lesson covers the fundamentals of managing liquidity in Uniswap V3 using a test contract. The lesson focuses on how to interact with the NonFungiblePositionManager contract, minting new positions, and understanding how to choose the right price range for liquidity. Duration: 2min
16. Solution 1 Mint
A comprehensive guide to minting liquidity using Uniswap V3 - The lesson covers how to interact with Uniswap V3 non-fungible position manager contract and how to mint a liquidity position in DAI/WETH pool. It shows how to calculate the tick range (tick lower and tick upper) and how to pass the necessary parameters, like tokens, pool fee, amount desired, amount in, recipient, and deadline, to the mint function. Duration: 3min
17. Exercise 2 Inc Liq
A comprehensive guide to increasing liquidity in a Uniswap V3 position. This lesson covers the process of increasing liquidity for a specific token ID, including the use of the mint function to create a position, the role of the increase liquidity function, and how to call the increase liquidity function in a non-fungible position manager. Duration: 1min
18. Solution 2 Inc Liq
A comprehensive guide to increasing liquidity to an existing position. This lesson dives into the process of increasing liquidity, which involves calling the increase liquidity function of the NonFungiblePositionManager contract and passing in the relevant parameters such as tokenId, amount0Desired, amount1Desired, amount0Min, amount1Min, and deadline. The lesson also demonstrates how to execute this test in the terminal using the correct commands. Duration: 2min
19. Exercise 3 Dec Liq
A comprehensive guide to decreasing liquidity in a Uniswap V3 position using the nonfungible position manager. The lesson covers the basics of decreasing liquidity, including the helper function mint, the get position function, the decrease liquidity function, and the nonfungible position manager interface. Duration: 1min
20. Solution 3 Dec Liq
A comprehensive guide to decreasing liquidity in a Uniswap V3 position using the NonfungiblePositionManager contract - In this lesson, we'll explore the functionality of the NonfungiblePositionManager to decrease liquidity in a Uniswap V3 position. We'll learn how to call the "decreaseLiquidity" function, passing in the correct parameters to ensure a successful liquidity reduction. We will explore the role of struct to handle the parameters for decreaseLiquidity. Duration: 2min
21. Exercise 4 Collect
A comprehensive guide to removing liquidity from a position using Uniswap V3. The lesson covers how to use the `decreaseLiquidity` and `collect` functions to remove all liquidity (including fees) from a position. Duration: 1min
22. Solution 4 Collect
A comprehensive guide to removing all liquidity from a position by calling collect - This lesson covers how to create a test to remove all liquidity from a position by decreasing the liquidity and then using the collect function to transfer the tokens to the contract. Duration: 2min

Course Overview

About the course

What you'll learn

Concentrated liquidity and derive its equations

Uniswap V3 math

How to calculate the spot price of tokens

Single and multi position swapping

Factory contract architecture

How to calculate liquidity requirements

Uniswap V3 fee algorithm

Flash loans

TWAP price oracle

Course Description

Who is this course for?

  • Software Engineers
  • Financial Analysts
  • Web3 Developers
  • Finance developers
  • Smart Contract Security Researchers

Potential Careers

Smart Contract Auditor

$100,000 - $200,000 (avg. salary)

Blockchain Financial Analyst

$100,000 - $150,000 (avg. salary)

DeFi Developer

$75,000 - $200,000 (avg. salary)

Smart Contract Engineer

$100,000 - $150,000 (avg. salary)

Web3 developer

$60,000 - $150,000 (avg. salary)

Web3 Developer Relations

$85,000 - $125,000 (avg. salary)

Meet your instructors

Tasuku Nakamura

Tasuku Nakamura

Founder at smartcontract.engineer

Smart contract engineer and educator.

Last updated on May 15, 2025