0.1.1 • Published 2 years ago

@scom/scom-uniswap-v3-contract v0.1.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Contract Addresses

https://docs.uniswap.org/contracts/v3/reference/deployments

ContractAddress
UniswapV3Factory0x1F98431c8aD98523631AE4a59f267346ea31F984
Multicall20x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696
ProxyAdmin0xB753548F6E010e7e680BA186F9Ca1BdAB2E90cf2
TickLens0xbfd8137f7d1516D3ea5cA83523914859ec47F573
Quoter0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6
SwapRouter0xE592427A0AEce92De3Edee1F18E0157C05861564
NFTDescriptor0x42B24A95702b9986e82d421cC3568932790A48Ec
NonfungibleTokenPositionDescriptor0x91ae842A5Ffd8d12023116943e72A606179294f3
NonfungiblePositionManager0xC36442b4a4522E871399CD717aBDD847Ab11FE88
TransparentUpgradeableProxy0xEe6A57eC80ea46401049E92587E52f5Ec1c24785
V3Migrator0xA5644E29708357803b5A882D272c41cC0dF92B34
QuoterV20x61fFE014bA17989E743c5F6cB21bF9697530B21e
SwapRouter020x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45
Permit20x000000000022d473030f116ddee9f6b43ac78ba3

Uniswap's own Deployer

0x6c9fc64a53c1b71fb3f9af64d1ae3a4931a5f4e9

Notes on calling uniswap router swap function:

  1. Prices are always based on token0 (token with smaller address); independent of in-token / out-token direction.
  2. sqrtPriceLimitX96 can be set to 0 to trade at the slot0 price
  3. sqrtPriceLimitX96 should be smaller then the slot0 price when swapping from token0 to token1 or highter then the slot0 price for token1 to token0 swaps.
  4. ETH input is automatically wrapped.
  5. To get native ETH output: 1. set router as the recipient in swap paramters, 2. use router.multicall() with router.unwrapWETH9() as the second call.
  6. For ETH input and router.exactOut(): use router.multicall() with router.refundETH() as the second call to get excess ETH back.
  7. For multi-hop exactOut, path are reversed (token-out is the first in the list and token-in is the last).

Notes on logarithm

  1. log1.0001(X) = log(X) / log(1.0001)
  2. log10(big_X) = log10(x*1eY) = Y + log10(x)

Resources