The 3 most important smart contracts in DeFi

Julien Klepatch

It’s so exhausting to keep up with all these new DeFi projects. 

But very few DeFi projects are really original. 

Most of them are copies and just re-use the same smart contracts.

 And if you know these contracts, it’s much easier to analyze new DeFi projects and spot patterns.

 Let’s explore the 3 most important smart contracts in DeFi, that have been re-used times and times again.



UniswapV2Pair is a smart contract created by Uniswap. 

Uniswap is the biggest decentralized exchange on Ethereum.

Traders can use Uniswap to trade their ERC20 tokens in a decentralized way, and the UniswapV2Pair contract is at the core of this system.

Each pair contract represents an automated market maker, for a specific market.

 There is a separate pair contract for each market.

 What makes this smart contract so special is the so-called constant product formula, an algorithm that is used to determine the price of a token.

It is used by a large number of decentralized exchange on Ethereum and on other chain, including Sushiswap And Pancakeswap.

 UniswapV2Pair has been updated to V3, but most protocols who forked Uniswap still use the V2 version, and this version is also easier to understand. That’s why I recommend to study the V2 version first.







GovernorAlpha is a smart contract created by Compound.

Compound is the biggest lending protocol on Ethereum.

It is used to borrow and lender ERC20 tokens on the Blockchain. 

The GovernorAlpha contract is used for the governance of the Compound ecosystem.

Holders of the COMP token, the governance token of Compound, can use GovernorAlpha to vote for the parameters and the evolution of the Compound protocol.

GovernorAlpha is used in the governance of a large number of protocols and DAOs.

 GovernorAlpha has been updated to a new version called GovernorBravo. Most other protocols still use GovernorAlpha, and the updates of GovernorBravo are not very significant, that’s why I recommend to study GovernorAlpha first.





MasterChef is a smart contract created by Sushiswap.
 
Sushiswap is one of the largest decentralized on Ethereum.

 Sushiswap was originally a fork of Uniswap, but it did bring some innovations like MasterChef.

MasterChef is a smart contract that is used to build staking pools.

With MasterChef, users can lock their tokens in the smart contract, and in exchange, they will get a token reward.

Beside Sushiswap, MasterChef has been used in many other protocols like PancakeSwap.

 MasterChef is probably the most forked smart contracts in the whole Blockchain ecosystem.





So now, you know the most important smart contracts in DeFi.

The next step is to go read their code and understand how they work in detail.

 What is especially important is to understand how you can interact with these smart contracts.

And on my channel, I have another tutorial that dives into UniswapV2Pair.

 I will see you there!

More great articles

Solana explained in 2 mins

Solana has been described as the next Ethereum killer.

 In 2021, the price of Solana skyrocketed. 

Even Celebrities are jumping…

Read Story

Walkthrough the new UI of Remix

TIP: If you have never used Remix, check out my intro to Remix on Youtube. Remix, the online IDE for…

Read Story

(Part 7/18 updated) Introduction to Web3.js 1.2 (Latest version) – Beginners Tutorial

When you develop an Ethereum Dapp, once you have the frontend and the smart contract, you need to connect them…

Read Story

Never miss a minute

Get great content to your inbox every week. No spam.

    Only great content, we don’t share your email with third parties.
    Arrow-up