Skip to content

libevm/uniswapv3-by-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UniswapV3 By Examples

I couldn't find a repository that contained straightforward Uniswap V3 action examples, so I decided to make one myself.

This repostiory assumes you understand how UniswapV3 operates at a high level, if not, check out their docs.

# forge 0.1.0 (0f58c52 2022-03-14T00:17:17.595445+00:00)
forge build

# RPC_URL=https://mainnet.infura.io/v3/<PROJECT_ID>
forge test -f $RPC_URL -vvv

# ganache-cli -f $RPC_URL
forge run --debug src/test/Swap.t.sol -f http://127.0.0.1:8545 --sig "test_swapExactInput()"

Examples

  • Calculate SqrtPriceX96/SqrtRatioX96
  • Add Liquidity
  • Remove Liquidity
  • Swap Exact In
  • Swap Exact Out

About

UniswapV3 by examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published