# Vault blocks

Vault blocks are detailed blockchain-based snapshots of a vault’s state at a specific block height. They are used for calculating APR/APY, tracking liquidity, and generating analytics.

## Structure

Each vault block object includes:

* `_id` *(string)* — Unique identifier
* `vaultId` *(string)* — Vault being tracked
* `vaultAddress` *(string)* — Smart contract address of the vault
* `block` *(object)*:
  * `number` *(number)* — Block number
  * `timestamp` *(number)* — Unix timestamp of the block
* `APRs` *(object)* — Non-compounded APRs:
  * `BASE`, `HARVEST`, `REWARDS`, `GROSS`, `NET`, `FEE` *(number)*
* `APYs` *(object)* — Compounded yield rates:
  * `BASE`, `HARVEST`, `REWARDS`, `GROSS`, `NET`, `FEE` *(number)*
* `totalSupply` *(string)* — Total shares issued by the vault
* `price` *(string)* — Price per share
* `TVL` *(object)* —
  * `token` *(string)* — TVL in vault token
  * `USD` *(string)* — TVL in USD
* `pools` *(array of objects)* — Breakdown of pool-level performance:
  * `address` *(string)*
  * `protocol` *(string)*
  * `rates`: `{ supply: number, borrow: number }`
  * `utilization`: `{ supplied: string, borrowed: string, rate: number }`
  * `available`: `{ toBorrow: string, toWithDraw: string }`
* `allocations` *(array)* — Optional pool allocation breakdown
* `createdAt`, `updatedAt` *(string)* — ISO timestamps
* `createdBy`, `updatedBy` *(string)* — Actor IDs

## Endpoints

{% openapi src="<https://4223418165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVSPclqPyChB4NMxFfG2X%2Fuploads%2FutXySYq67YODk76iQB8a%2FVaultBlocks.yaml?alt=media&token=864b3632-a901-4f33-9d4f-d59b74ccb7ba>" path="/vault-blocks" method="get" %}
[VaultBlocks.yaml](https://4223418165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVSPclqPyChB4NMxFfG2X%2Fuploads%2FutXySYq67YODk76iQB8a%2FVaultBlocks.yaml?alt=media\&token=864b3632-a901-4f33-9d4f-d59b74ccb7ba)
{% endopenapi %}

{% openapi src="<https://4223418165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVSPclqPyChB4NMxFfG2X%2Fuploads%2FutXySYq67YODk76iQB8a%2FVaultBlocks.yaml?alt=media&token=864b3632-a901-4f33-9d4f-d59b74ccb7ba>" path="/vault-blocks/{vaultBlockId}" method="get" %}
[VaultBlocks.yaml](https://4223418165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVSPclqPyChB4NMxFfG2X%2Fuploads%2FutXySYq67YODk76iQB8a%2FVaultBlocks.yaml?alt=media\&token=864b3632-a901-4f33-9d4f-d59b74ccb7ba)
{% endopenapi %}

## Vault latest blocks

Vault latest blocks are real-time snapshots of the most recent state for each vault. Unlike vault blocks (historical), these represent the **current** or **latest available** data.

## Endpoints

{% openapi src="<https://4223418165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVSPclqPyChB4NMxFfG2X%2Fuploads%2FZmlBYllofNTVGllwBoao%2FVaultLatestBlocks.yaml?alt=media&token=158a3b3b-1268-476d-8c20-3fde8bf3bc49>" path="/vault-latest-blocks" method="get" %}
[VaultLatestBlocks.yaml](https://4223418165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVSPclqPyChB4NMxFfG2X%2Fuploads%2FZmlBYllofNTVGllwBoao%2FVaultLatestBlocks.yaml?alt=media\&token=158a3b3b-1268-476d-8c20-3fde8bf3bc49)
{% endopenapi %}
