> For the complete documentation index, see [llms.txt](https://docs.exact.ly/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exact.ly/guides/the-graph.md).

# The Graph

Exactly Protocol uses [The Graph Decentralized Network](https://thegraph.com/docs/en/network/overview/) on Mainnet and [The Graph Hosted Service](https://thegraph.com/docs/en/deploying/hosted-service/) on Optimism to index and query data on the blockchain more efficiently and accurately.

Our GitHub repo: <https://github.com/exactly/subgraph>

## The Graph Protocol

[The Graph](https://thegraph.com/en/) is an **indexing protocol** that makes it easier to query networks like Ethereum and Optimism. With The Graph, anyone can build and publish open-source APIs, known as **subgraphs**, which organize blockchain data to make it more easily accessible.

The Graph is powered by a decentralized, global network of thousands of participants. These participants worldwide take on the roles of [Indexers](https://thegraph.com/docs/en/network/indexing/), [Delegators](https://thegraph.com/docs/en/network/delegating/), [Curators](https://thegraph.com/docs/en/network/curating/), and [Developers](https://thegraph.com/docs/en/network/developing/).

## Subgraphs

When any decentralized application (dapp) adds data to the blockchain, 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.

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.

At Exactly Protocol, our subgraph allows us to perform advanced queries and operations like aggregation, search, relationships, and non-trivial filtering. It enables 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.

### Exactly Protocol’s Subgraphs

| Network          | Subgraphs                                                                                                                                                                                                                                  |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Ethereum Mainnet | [https://thegraph.com/explorer/subgraphs/As6Xz6GCvbW8B9Xb7Rx2LqQeJcL3FcUyD8Tk95L8rG5d?view=Overview\&chain=mainnet ](<https://thegraph.com/explorer/subgraphs/As6Xz6GCvbW8B9Xb7Rx2LqQeJcL3FcUyD8Tk95L8rG5d?view=Overview\&chain=mainnet >) |
| Optimism         | <https://thegraph.com/explorer/subgraphs/9jpa2F3ZuirB11m3GL36wcNoNGETd3Z2zf7Cre5iwyeC?view=Query&chain=arbitrum-one>                                                                                                                       |
|                  |                                                                                                                                                                                                                                            |

<div align="right"><figure><img src="/files/r6O4pMLp7l8Y3Avjtts2" alt=""><figcaption></figcaption></figure></div>

\
\
\ <br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.exact.ly/guides/the-graph.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
