> For the complete documentation index, see [llms.txt](https://docs.lagoon.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lagoon.finance/developer-hub/integration/vault-subgraphs.md).

# Vault Subgraphs

{% hint style="warning" %}
**Deprecated** — the Lagoon subgraphs documented on this page have been replaced by the [Lagoon API](/developer-hub/lagoon-api.md), a single multi-chain GraphQL endpoint. The subgraphs remain available during the transition but new integrations should target the new API.
{% endhint %}

You can find the list of graphql endpoints [here](/resources/networks-and-addresses.md).

Lagoon subgraphs include all the events emitted by vaults and some of the factories.\
On top of the vault events, you can find an extra entity named PeriodSummary:

```
type PeriodSummary @entity(immutable: false) {
  id: Bytes!
  vault: Bytes! # address
  totalAssetsAtStart: BigInt!
  totalSupplyAtStart: BigInt!
  totalAssetsAtEnd: BigInt!
  totalSupplyAtEnd: BigInt!
  netTotalSupplyAtEnd: BigInt!
  blockNumber: BigInt!
  blockTimestamp: BigInt!
  duration: BigInt!
}
```

Period summaries are not events but are piece of data that summaries key vault metrics evolution. A period being a portion of time between two updates of TotalAssets.

At the start of each period, we create a new PeriodSummary entity, meaning that as long as the vault is open, the most recent PeriodSummary will be partially filled. It will be completely filled when TotalAssets is updated again and consequently, the period is over.

Elements definition:

| Elements              | Definition                                                                                                                                          |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                  | the id of the entity.                                                                                                                               |
| `totalAssetsAtStart`  | the value of TotalAssets at the beginning of the period.                                                                                            |
| `vault`               | the address of the vault                                                                                                                            |
| `totalSupplyAtStart`  | the amount of shares at the beginning of the period.                                                                                                |
| `totalAssetsAtEnd`    | the value of TotalAssets at the end of the period, meaning after the TotalAssetsUpdate but before the potential settlements of requests.            |
| `totalSupplyAtEnd`    | the amount of shares at the end of the period, meaning after the TotalAssetsUpdate but before the settlements of requests and fee taking.           |
| `netTotalSupplyAtEnd` | the amount of shares at the end of the period, meaning after the TotalAssetsUpdate and after the fee taking but before the settlements of requests. |
| `blockNumber`         | the block number at the beginning of the period.                                                                                                    |
| `blockTimestamp`      | the timestamp at the beginning of the period.                                                                                                       |
| `duration`            | the duration of the period.                                                                                                                         |

\ <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.lagoon.finance/developer-hub/integration/vault-subgraphs.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.
