# Notional V3 Subgraphs

## The Graph & subgraphs&#x20;

The Graph is a decentralized protocol for indexing and querying data from blockchains. Anyone can build and publish open APIs, called subgraphs, making data easily accessible in a decentralized and reliable way. Subgraphs make it possible for anyone to query data that would otherwise be difficult to query on-chain directly. Each subgraph pays attention to events of a project’s contracts and maps that event data to data that The Graph stores in its database. Learn more about The Graph [here](https://thegraph.com/docs/en/about/introduction/).&#x20;

### GraphQL&#x20;

GraphQL is the underlying query language utilized in The Graph. GraphQL is especially useful for calls requiring lots of information where instead of making multiple API calls one only needs to do one subgraph call to get all of the information needed. Learn more about GraphQL [here](https://graphql.org/learn/).&#x20;

## Notional Subgraphs

| Version     | Network  | Subgraph Endpoint                                                                       |
| ----------- | -------- | --------------------------------------------------------------------------------------- |
| Notional V3 | Mainnet  | [Link](https://api.studio.thegraph.com/query/60626/notional-v3-mainnet/v0.0.9)          |
| Notional V3 | Arbitrum | [Link](https://api.studio.thegraph.com/query/60626/notional-v3-arbitrum/version/latest) |

## Query Notional’s subgraph with python&#x20;

To run subgraph queries through python one can use the following script and modify the url to the appropriate endpoint and modify the GQL query:

```
from gql import gql, Client from gql.transport.requests 
import RequestsHTTPTransport

#Connect with theGraph
sample_transport = RequestsHTTPTransport( url="https://api.studio.thegraph.com/proxy/33671/notional-finance-v3-arbitrum/v0.0.135/", # change to the appropriate endpoint 
verify=True, retries=10, ) client = Client( transport=sample_transport )

#Update the GQL query
query = gql('''
{
  accounts(first: 1000, where:{ systemAccountType: None}) {
    id
  }
}
''')

response = client.execute(query) 
```

We will go over a few example queries to explore Notional's V3 subgraph.


---

# Agent Instructions: 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:

```
GET https://docs.notional.finance/v3-technical-docs/subgraph-guides/notional-v3-subgraphs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
