MCPcopy Index your code
hub / github.com/Uniswap/v3-periphery

github.com/Uniswap/v3-periphery @v1.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.0 ↗ · + Follow
71 symbols 344 edges 41 files 0 documented · 0% 3 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Uniswap V3 Periphery

Tests Lint

This repository contains the periphery smart contracts for the Uniswap V3 Protocol. For the lower level core contracts, see the uniswap-v3-core repository.

Bug bounty

This repository is subject to the Uniswap V3 bug bounty program, per the terms defined here.

Local deployment

In order to deploy this code to a local testnet, you should install the npm package @uniswap/v3-periphery and import bytecode imported from artifacts located at @uniswap/v3-periphery/artifacts/contracts/*/*.json. For example:

import {
  abi as SWAP_ROUTER_ABI,
  bytecode as SWAP_ROUTER_BYTECODE,
} from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'

// deploy the bytecode

This will ensure that you are testing against the same bytecode that is deployed to mainnet and public testnets, and all Uniswap code will correctly interoperate with your local deployment.

Using solidity interfaces

The Uniswap v3 periphery interfaces are available for import into solidity smart contracts via the npm artifact @uniswap/v3-periphery, e.g.:

import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol';

contract MyContract {
  ISwapRouter router;

  function doSomethingWithSwapRouter() {
    // router.exactInput(...);
  }
}

Core symbols most depended-on inside this repo

encodePriceSqrt
called by 137
test/shared/encodePriceSqrt.ts
snapshotGasCost
called by 86
test/shared/snapshotGasCost.ts
getMinTick
called by 62
test/shared/ticks.ts
getMaxTick
called by 60
test/shared/ticks.ts
encodePath
called by 50
test/shared/path.ts
expandTo18Decimals
called by 29
test/shared/expandTo18Decimals.ts
computePoolAddress
called by 19
test/shared/computePoolAddress.ts
sortedTokens
called by 15
test/shared/tokenSort.ts

Shape

Function 70
Enum 1

Languages

TypeScript100%

Modules by API surface

test/SwapRouter.spec.ts7 symbols
test/SwapRouter.gas.spec.ts7 symbols
test/OracleLibrary.spec.ts5 symbols
test/shared/externalFixtures.ts4 symbols
test/TickLens.spec.ts4 symbols
test/NFTDescriptor.spec.ts4 symbols
test/shared/ticks.ts3 symbols
test/shared/quoter.ts3 symbols
test/shared/path.ts3 symbols
test/shared/tokenSort.ts2 symbols
test/shared/base64.ts2 symbols
test/PairFlash.spec.ts2 symbols

For agents

$ claude mcp add v3-periphery \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page