The Graph and Exactly Protocol: Unlocking the full potential of DeFi

Exactly’s goal is to add an important missing feature on the Defi ecosystem: the ability to make fixed-rate deposits or loans for a specified period of time, which is known as “fixed income” in traditional finance.

This is a challenging task, and we need support from other projects to help us grow faster, safer, and more efficiently. That’s why we’re utilizing The Graph, the decentralized indexing and query layer of web3.

The Graph: Solving the challenges of indexing blockchain data

The decentralized nature of blockchains can make it difficult to index their data. Querying data from blockchain often requires a lot of computational power, which can be expensive and time-consuming. This is because transactions on a blockchain cannot be sorted based on different qualities, but are instead added in the order in which they are created.

Projects with complex smart contracts like Exactly Protocol, often store their data on Ethereum or other blockchains. This makes it difficult to read any other than basic data directly from the blockchain.

How can we solve these problems? With The Graph.

​​One solution to these challenges is The Graph, an indexing protocol that makes it easier to query networks like Ethereum and IPFS. With The Graph, anyone can build and publish open-source APIs, known as subgraphs, which organize blockchain data to make it more easily accessible.

How The Graph works

When any decentralized application (dapp) adds data to the blockchain through a transaction or a smart contract, the smart contract emits one or more events while processing the transaction. Indexers on The Graph Network index subgraphs that track the events emitted by the smart contract and organize them neatly, enabling dapps to access and rapidly display only the information relevant to their users. Hundreds of Indexers operate indexing nodes around the world in a decentralized way, so there’s always an Indexer to serve data organized by subgraphs. 

With subgraphs, it’s fast and easy to access blockchain data. Subgraphs identify smart contracts, the events in those contracts to pay attention to, and how to map event data to the data that will be indexed via The Graph’s decentralized network. This enables The Graph to efficiently and accurately index the data on the blockchain.

The Graph is powered by a decentralized, global network of thousands of participants. These participants all over the world take on the roles of Indexers, Delegators, Curators, and Developers. These different roles constitute the backbone of a robust, trustworthy protocol that serves data to the entire web3 ecosystem in a decentralized way.

Using subgraphs to unlock the potential of Exactly Protocol

In the case of Exactly Protocol, we can perform basic read operations on the smart contracts. For example, we can get the available liquidity for a Fixed Rate Pool or preview the yield offered by a maturity when depositing a certain amount of assets. These read operations are programmed directly into the smart contract (Previewer.sol). However, without using subgraphs, more advanced queries and operations like aggregation, search, relationships, and non-trivial filtering are impossible.

For instance, if we wanted to query for the deposits made by a certain address at a Fixed Rate Pool and filter by a particular characteristic, we would not be able to get that information by interacting directly with the contract. This is where The Graph comes in, as it allows us to index and query the data on the blockchain more efficiently and effectively.

Our subgraph allows us to index and return every event emitted by our smart contract on the blockchain. This includes details of all the different operations, such as borrows and deposits, as well as the Interest Rate Model that determines the protocol's earnings and debts.

We can also use the subgraph to show the user's transaction history on the protocol, by feeding it with data based on the user's wallet address. Additionally, we can use the subgraph to calculate and display the variable APR, by using it to compute the protocol's status in different time windows and show the actual changes. Overall, The Graph makes it much easier for us to query and analyze the data on the blockchain.


Are you interested in staying up-to-date on the latest developments at Exactly Protocol and learning how we're disrupting the DeFi ecosystem? Follow us on Twitter and Mirror, and join our Discord and Telegram to stay in the loop.

Subscribe to 𝚵xactly Protocol
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.