- Notifications
You must be signed in to change notification settings - Fork0
sambacha/foundry-tutorial
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
UniswapV3 Liquidity Testing
forgetest -f$ETH_RPC_URL -vvv --fork-block-number 14327540
// from src/test/UniswapV3.solemitlog_named_uint("amount0 (USDC)", amount0);emitlog_named_uint("amount1 (ETH)", amount1);emitlog("------- amount0/amount1 for liquidity at range [lower, upper] at LOWER price");emitlog_named_uint("lowerPrice (ETH/USDC)",token0Price(sqrtPriceLowerX96));
$ forgetest -f$ETH_RPC_URL -vvv --fork-block-number 14327540Compiling...No files changed, compilation skippedRunning 1testfor UniswapV3Test.json:UniswapV3Test[PASS]testExample() (gas: 36365)Logs: ------- amount0/amount1for liquidity at range [lower, upper] at CURRENT price currentPrice (ETH/USDC): 378261998000000 amount0 (USDC): 9409580115 amount1 (ETH): 5698544927171011234 ------- amount0/amount1for liquidity at range [lower, upper] at LOWER price lowerPrice (ETH/USDC): 189073881000000 amount0 (USDC): 30718029649 amount1 (ETH): 0 ------- amount0/amount1for liquidity at range [lower, upper] at UPPER price upperPrice (ETH/USDC): 566703047000000 amount0 (USDC): 0 amount1 (ETH): 10055111697431443031
Foundry is released underMIT/Apache-20 by@gakonst
Solidity contracts are Copyright 2021 by@MrToph