How to get data from a DeFi protocol

A practical exercise using the Aave protocol

Iván Alberquilla
Coinmonks
Published in
5 min readJun 16, 2020

--

Photo by Markus Winkler on Unsplash

Introduction

There is always talk about the clarity of blockchain, that everything is traceable and everyone can see what was written, but is it easy to access this information? How can I get data to do my analysis in a simple way?

In this post we are going to see three ways to do it, using the DeFi Aavesome protocol as an example, in which we are going to obtain the history of deposits made on the platform, using three different methods:

  • The Graph: A protocol for building decentralized applications using GraphQL.
  • alethio: An api rest to obtain data from the blockchain in a friendly way.
  • Web3 Foundation Team: Reading the events directly on the blockchain using the web3js library

How to obtain this data

In order to access certain data on the blockchain, the easiest way is to query the events. When a function in a smart contract is called, if a certain action is executed, an event can be emitted, which can listen at that time by clients who are listening for that particular event, or in the future, accessing their history, which is recorded on the blockchain.

--

--

Iván Alberquilla
Coinmonks

After 9 years developing banking technology, bumping into blockchain was not a coincidence. linkedin.com/in/ialberquilla twitter.com/ialberquilla