# Subgraph

### Overview

The Kodiak Islands subgraph indexes and tracks data from the Kodiak Islands protocol, a DeFi liquidity management system focusing on automated vault strategies. This subgraph captures essential metrics, events, and state changes from the protocol's smart contracts, making the data easily accessible for analysis and integration with other applications.

#### Purpose

The Kodiak Islands subgraph serves several key purposes:

1. **Track Protocol Performance** - Monitor TVL, fees earned, APR, and other financial metrics across all vaults
2. **User Activity Analysis** - Track deposits, withdrawals, and user engagement metrics
3. **Vault Strategy Insights** - Monitor position ticks, rebalances, and strategy changes
4. **Historical Data Access** - Access time-series data through hourly and daily snapshots

#### Key Features

* **Comprehensive Vault Tracking**: Monitor the creation, performance, and activity of all Kodiak vaults
* **Financial Metrics**: Track TVL, fees (LP fees and manager fees), volumes, and APR for vaults
* **Detailed Event Logging**: Record deposits, withdrawals, fee earnings, rebalances, and other protocol events
* **Time-Series Data**: Access historical data through hourly and daily snapshots for both vaults and protocol metrics
* **Position Management**: Monitor liquidity positions through lower and upper tick tracking

#### Architecture

The Kodiak Islands subgraph is structured around several core entities:

* **KodiakIslandProtocol**: The parent entity representing the entire protocol
* **KodiakVault**: Individual vault instances managed by the protocol
* **Events**: Transactions like deposits and withdrawals made to vaults
* **Snapshots**: Time-based records of protocol and vault metrics (hourly and daily)
* **Token Information**: Details about the tokens managed within vaults

#### Data Flow

Data is captured through event handlers that process blockchain events emitted by the Kodiak Islands smart contracts. Key events include:

1. **Island Creation**: When a new vault is created
2. **Minting/Burning**: When users deposit or withdraw funds
3. **Rebalancing**: When vaults adjust their position ranges
4. **Fee Collection**: When fees are earned by vaults

#### Getting Started

To start using the Kodiak Islands subgraph:

1. Query the subgraph endpoint using GraphQL
2. Explore available entities and their relationships
3. Build custom queries to extract the specific data you need

See the Query Guide section for examples of common queries and usage patterns.


---

# 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://documentation.kodiak.finance/developers/kodiak-islands/subgraph.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.
