Process
How to Quickly Understand a Protocol
Last updated:
October 28, 2021

Who this is for

This document describes how to quickly familiarize with third-party smart contracts. This document is offered in buffet form, creating a couple of suggestions that can be mixed and matched to serve different reasons for learning more:

  • Developers looking to integrate third-party contracts
  • Researchers looking to understand third-party contracts
  • Strategists and Product Leaders looking to research the market and competition

Interact with the protocol

The first and best step is usually to use a testnet account or DeFi simulator (defi.instadapp.io) and try to use the protocol directly.

Read the Whitepaper

While this can be a time-consuming step, the Whitepaper can be helpful in both understanding the overall goals and assumptions going into a protocol design, it will also provide plenty of references for concepts that are prerequisite. For example, if you are looking to study Balancer, it is important to understand Uniswap V1 first as it is a simpler instantiation of the same protocol.

Is there a collection of resources?

Most popular protocols have a repository called "awesome-X" where X is the protocol name. This usually has a comprehensive set of resources including articles, videos and code to learning more about a protocol. These may also exist in the project documentation on the website or be in the project Discord.

Example for Uniswap V3 https://github.com/GammaStrategies/awesome-uniswap-v3#guides.

Use a visual inspector

Use a Visual Inspection Tool like Surya to see all the major components and how they interact. We recommend using the control flow graph, the inheritance graph and the describe report as a starting point.

Explore several transactions

Go to a front-end application that features transactions using the current protocol, pick one transaction going to Etherscan. There are a number of things worth studying:

  • What was the exact function called and what arguments were used (go to "Click to see More", "Decode Input Data") to see
  • What state changes occured

You can also use a transaction debugger like Tenderly or Auditless to review a given transaction and understand what code files are used.

Read the code

While we do not recommend doing this as a first step, at some point it is useful to see how the smart contracts are structured and study the most important functions and flows.

See Also: