Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions docs/contributing/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,12 @@ This is complementary to the above, but it's not directly related to creating st
- [Yearn Governance Forum](https://gov.yearn.fi/)
- [Yearn Snapshot Governance Voting](https://snapshot.box/#/s:veyfi.eth)

#### List of Yearn Tools
#### List of Yearn Data Tools

- Yearn Subgraphs, [Ethereum](https://thegraph.com/explorer/subgraph?id=0xf50b705e4eaba269dfe954f10c65bd34e6351e0c-0&version=0xf50b705e4eaba269dfe954f10c65bd34e6351e0c-0-0&view=Overview), [Fantom](https://thegraph.com/hosted-service/subgraph/yearn/yearn-vaults-v2-fantom), [GitHub](https://github.com/yearn/yearn-vaults-v2-subgraph)
- Yearn SDK, [GitHub](https://github.com/yearn/yearn-sdk)
- Yearn API, [GitHub](https://github.com/yearn/kong)
- Yearn Discord FAQ Bot, [GitHub](https://github.com/danijelthales/yfi-faq-bot)
- yDaemon API, [GitHub](https://github.com/yearn/ydaemon)
- Kong API, [GitHub](https://github.com/yearn/kong)

### Legacy Products and Websites
### Old Legacy Products and Websites

- Former list of [open GitHub issues here](https://contribute.yearn.rocks/).
- [v1 yearn.fi](https://v1.yearn.fi), [GitHub](https://github.com/yearn/iearn-finance)
Expand Down
12 changes: 5 additions & 7 deletions docs/developers/building-on-yearn.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,19 @@ V2 and V3 vaults implement strategies differently, so it is important to get fam

### Frontend Integrations

Yearn uses a JavaScript SDK for formatting protocol data and generating transactions for reading/writing protocol data. Yearn SDK integrates several components, both on-chain and off-chain.

[The repository here](https://github.com/turtlemoji/yearn-sdk-examples) contains a live preview and example usage of the Yearn SDK. Explore this codebase to learn how to start interacting with the Yearn protocol in your own app.
Yearn uses Kong and yDaemon as frontend data sources. Old Yearn SDKs existed, but as of late 2025, only yDaemon and Kong are actively used.

Check out the [Frontend Integrations](front-end-development) section of this documentation for more information about Frontend Integrations.

### Data Sources

[**yDaemon**](https://ydaemon.yearn.fi/) is a public API for a broad range of Vault data.
[**Kong**](https://kong.yearn.fi/api/gql) is an API to submit graphql queries for Yearn data.

- Learn more about yDaemon in the [README](https://github.com/yearn/ydaemon)
- Learn more about kong [here](/developers/data-services/kong) and in the [README](https://github.com/yearn/kong).

**The Graph** - Query contract data with GQL using the Yearn subgraphs
[**yDaemon**](https://ydaemon.yearn.fi/) is a public API for a broad range of Vault data.

- Learn more about the Graph and Subgraphs that Yearn provides [here](./data-services/subgraph-info).
- Learn more about yDaemon [here](/developers/data-services/ydaemon) and in the [README](https://github.com/yearn/ydaemon)

## Data Analysis

Expand Down
447 changes: 0 additions & 447 deletions docs/developers/data-services/entities.md

This file was deleted.

125 changes: 125 additions & 0 deletions docs/developers/data-services/kong.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Kong

[Kong](https://github.com/yearn/kong) is a real-time/historical EVM indexer and analytics platform designed to make it easy to index EVM logs, enrich blockchain data, and query indexed data via GraphQL. It comes pre-configured with an index over Yearn's v2 and v3 vault ecosystems. For more detailed docs, reference [deepwiki](https://deepwiki.com/yearn/kong).

## Key Features

### Event Sourcing Architecture

- Stores EVM logs and contract snapshots in PostgreSQL without transformation
- Supports index replay without re-extracting data from blockchain
- Handles events out of order for faster historical indexing

### Hook System

Three types of custom enrichment hooks:
- **Snapshot Hooks**: Process recurring snapshots of contracts
- **Event Hooks**: Process and enrich blockchain events
- **Timeseries Hooks**: Generate time-series analytics data

### Real-Time Webhooks

- Real-time notifications triggered during indexing
- HMAC-SHA256 authentication
- Configurable filtering by chains and contract addresses

### Domain Modeling with "Things"

- Dynamically created entities (analogous to "entities" in conventional ETL)
- Used as sources for further indexing
- Supports hierarchical indexing (e.g., Registry → Vaults → Strategies)

## GraphQL API

### Base URL

- GraphQL Explorer: https://kong.yearn.fi/api/gql

### Example Queries

#### List Yearn Vaults on mainnet

```graphql
query MainnetVaults {
vaults(chainId: 1) {
address
name
symbol
}
}
```

#### List Yearn v2 vaults on all chains

```graphql
query GetV2VaultAddresses {
vaults(vaultType: 2) {
chainId
address
name
symbol
}
}
```

### Query last 100 deposit events for specific vault

```graphql
query GetDeposits {
deposits(chainId: 1, address: "0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204") {
amount
shares
recipient
}
}
```

#### Query Timeseries Data for specific vault

```graphql
query Timeseries {
timeseries(
label: "tvl-c",
component: "tvl",
chainId: 1,
address: "0xdA816459F1AB5631232FE5e97a05BBBb94970c95",
limit: 1000
) {
chainId
address
label
component
value
time
period
}
}
```

## Database Schema

### Core Tables

#### `thing`
Domain object definitions (vaults, strategies, etc.)
- `chain_id`, `address`, `label`, `defaults` (JSONB)

#### `snapshot`
Latest contract snapshots with hook data
- Stores contract state and enriched hook data
- JSONB fields for flexible schema

#### `evmlog`
Raw EVM logs with hook enrichments
- Full event history with args and hook data in JSONB
- Limited history on transfers, deposits, withdraws, approves

#### `evmlog_strides`
Track which blocks have been indexed
- Prevents duplicate indexing
- Identifies gaps in coverage

#### `output`
Timeseries data from timeseries hooks
- TVL, APY, PPS calculations
- Time-series analytics
144 changes: 0 additions & 144 deletions docs/developers/data-services/queries.md

This file was deleted.

74 changes: 0 additions & 74 deletions docs/developers/data-services/subgraph-info.md

This file was deleted.

Loading