
Periphery: Periphery consists of a bunch of domain-specific smart contracts which help in interaction with the core. They also emit data that can be used to built decentralized price oracles. Its primary purpose is to act as automated market makers and keep track of token balances in a pool. Pairs: The markets which the factory creates are known as pairs.It also makes sure that only one smart contract is formed per unique token pair. Factory: The factory contract’s role is to create different markets on Uniswap called pairs and act as a registry for different markets.It is not recommended for users to interact with core contracts directly instead, use a periphery contract because core contracts are very minimal and functionally straightforward. Factory contract is responsible for creating many pair contracts. Uniswap V2 has two smart contract systems: core and periphery.Ĭore: This consists of one factory and many pairs of contracts. Now let us understand smart contracts in Uniswap. V2 has few other features, including on-chain price feeds and flash swaps. Offering ERC20-ERC20 pools was also better for liquidity providers who didn’t want to supply ETH. For example, to trade from USDC to DAI, the user had to trade USDC for ETH and then ETH for DAI, which usually resulted in higher gas fees and more slippage. Before V2, each liquidity pool had to consist of ETH as one of the currencies. In 2020 a second version was released named Uniswap V2 the main feature was the addition of the ERC20-ERC20 liquidity pools. Hayden Adams built the first version of Uniswap with vyper and deployed that version of the Uniswap protocol on the Ethereum Mainnet in 2018. It is built on the concept of Liquidity pools, automated market makers, or, to be precise, a constant product market maker. Uniswap protocol is deployed as the set of smart contracts and is entirely decentralized, permissionless, and is censorship-resistant. Uniswap is a protocol for the decentralized exchange of tokens on the Ethereum blockchain. It’s a pretty popular project for many reasons - in this guide, we will learn how to interact with the Uniswap smart contracts using a JavaScript library called ethers.js and uniswap’s js sdk.

Uniswap is one of the most discussed and important projects in the DeFi space. How to Interact with Uniswap using Javascript
