
As a RareSkills researcher, you will be contributing to the technical content we post on our website.
Compound Finance is the most forked DeFi lending protocol.
By learning the Compound Finance codebase and tokenomics in depth, you will be able to understand dozens of other lending protocols and be able to navigate their codebases more efficiently.
The RareSkills Compound V3 book is a line-by-line examination of the Compound V3 protocol. We explain the tokenomics, architecture, and the code in great detail — down to the number of decimals certain variables have.
Our hope is for you to gain an understanding of the protocol with a depth comparable to if you had written it yourself.
Even if you develop on non-EVM blockchains or layer 2s, what you learn here will still be relevant.
Imagine a protocol engineer sat down with you and walked you through the codebase and design decisions. That is what this book is like.
Pace yourself.
We do not shy away from difficult subjects in our code walkthroughs, so don’t try to cram the information. This resource makes this process as simple as possible, but no matter how you slice it, this is still a big undertaking. Have realistic expectations for how many new ideas you can learn in one session. Compound was groundbreaking when it launched, so mastering the whole thing in 3 days isn’t realistic at all.
On the other hand, if you understand the building blocks of Compound V3, the codebase is not as complex as its line count would suggest. We do not simply provide screenshots of each line and explain the code — we provide a mental framework about how all the high level ideas fit together.
Make sure you are familiar with each of the prerequisites, then read the chapters of the Compound V3 book in order.
Unlike Compound V2 (and AAVE) where the borrower can borrow from a menu of assets, in Compound V3, borrowers can only borrow a single asset (and lenders can only lend a single asset) — per “market.” At this time of writing, there is a market for borrowing (and lending) USDC and a market for borrowing and lending ETH.
The available markets are shown on the “Compound V3 markets” page which we provide a screenshot of below. As you can see, it is only possible to borrow USDC or ETH depending on the chain.
Because USDC is the most common asset to borrow and lend, we will refer to the base asset as USDC throughout this series. Collateral does not earn interest in Compound V3.
Compound V3 refers to itself by the codeword “Comet.” Sometimes, the word “Comet” may refer to the “core lending smart contract” and “Compound V3” referring to the entire system of smart contracts. Other times, “Comet” and “Compound V3” are used interchangeably, but don’t worry, it will be very clear from the context.
We would like to thank Faybian Byrd, Andrew Chiaramonte, and Walter Cavinaw for their invaluable comments during review of this work.
As a RareSkills researcher, you will be contributing to the technical content we post on our website.
We’re looking for someone to design and implement security measures and defense-in-depth controls to prevent and limit vulnerabilities.
We’re looking for a Senior Full-Stack Engineer to play a foundational role in working across the entire offchain stack of products.
We are seeking a talented Rust Developer to build a robust, scalable blockchain indexers and analytic backend.