# On-Chain Treasury Tracker (`gochujang/onchain-treasury-tracker`) Actor

Tracks on-chain treasury balances of major DeFi protocols using DeFiLlama public APIs. No API key required.

- **URL**: https://apify.com/gochujang/onchain-treasury-tracker.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 protocol trackeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does On-Chain Treasury Tracker do?

**On-Chain Treasury Tracker** is an Apify actor that fetches real-time **on-chain treasury** balances for any DeFiLlama-listed protocol and enriches them with diversification scores, runway estimates, and tier classifications — all without an API key. Powered by [DeFiLlama's public treasury API](https://defillama.com/docs/api), it delivers structured **DAO treasury analytics** for up to 10 protocols per run, making it the fastest way to benchmark **protocol treasury** health across the DeFi ecosystem. Each result includes native token concentration, stablecoin allocation, governance metrics, and a normalized diversification score so you can instantly spot which treasuries are overexposed to their own governance token.

***

### Why use On-Chain Treasury Tracker?

Whether you are monitoring risk, conducting investment research, or building a governance dashboard, having structured **protocol treasury monitor** data in a single API call saves hours of manual aggregation.

- **DAO health monitoring** — track runway estimates and native token concentration risk for protocols in your portfolio or coverage list
- **Investment research** — compare treasury strength across DeFi blue chips; identify protocols with dangerously low diversification before they become liabilities
- **Risk dashboards** — flag any protocol where native token concentration exceeds 80%, indicating high governance sell-pressure risk
- **Governance analytics** — monitor how treasuries diversify over time as DAOs execute on-chain proposals to reduce native token exposure
- **Competitive intelligence** — benchmark your protocol's treasury tier (`whale` / `large` / `mid` / `small` / `micro`) against peers with a single run

***

### How to use On-Chain Treasury Tracker

1. Click **Try for free** on the actor page
2. In the **Input** tab, specify the DeFiLlama protocol slugs you want to track (e.g., `["uniswap", "aave", "compound"]`)
3. Set any filters: minimum treasury size, sort order, or number of top holdings
4. Click **Start** — results appear in the **Dataset** tab within seconds
5. Export as JSON, CSV, or connect via the Apify API for automated monitoring

***

### Input

```json
{
  "protocols": ["uniswap", "aave", "compound"],
  "minTreasuryUsd": 1000000,
  "includeBreakdown": true,
  "sortBy": "treasury_desc",
  "topHoldingsCount": 10
}
```

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `protocols` | string\[] | top 10 DeFi protocols | DeFiLlama protocol slugs to track |
| `minTreasuryUsd` | integer | `0` | Skip protocols below this USD threshold |
| `includeBreakdown` | boolean | `true` | Include per-token USD breakdown in output |
| `sortBy` | string | `treasury_desc` | Sort: `treasury_desc`, `treasury_asc`, `diversification_desc`, `runway_desc` |
| `topHoldingsCount` | integer | `10` | Number of top holdings in `treasury_breakdown` |

***

### Output

```json
{
  "protocol_name": "Uniswap",
  "slug": "uniswap",
  "chain_count": 3,
  "treasury_usd_total": 2850000000.0,
  "treasury_breakdown": {
    "UNI": 2100000000.0,
    "USDC": 420000000.0,
    "ETH": 180000000.0
  },
  "native_token_pct": 73.68,
  "stablecoin_pct": 14.74,
  "treasury_diversification_score": 41.2,
  "treasury_tier": "whale",
  "runway_years_estimate": 47.5,
  "governance_concentration": 73.68,
  "dao_financial_health": "moderate",
  "fetched_at": "2026-09-02T09:00:00+00:00"
}
```

***

### Data fields

| Field | Description |
|-------|-------------|
| `protocol_name` | Human-readable protocol name |
| `slug` | DeFiLlama protocol slug |
| `treasury_usd_total` | Total treasury value in USD |
| `treasury_breakdown` | Top token holdings `{symbol: usd_value}` |
| `native_token_pct` | % of treasury in native/governance token |
| `stablecoin_pct` | % of treasury in stablecoins (USDC/USDT/DAI/etc.) |
| `treasury_diversification_score` | 0–100 (100 = perfectly diversified, HHI-normalized) |
| `treasury_tier` | `whale` (>$500M) / `large` (>$100M) / `mid` (>$10M) / `small` / `micro` |
| `runway_years_estimate` | Estimated years of runway (treasury divided by proxy expenses) |
| `governance_concentration` | % held in top governance token |
| `chain_count` | Number of chains treasury is deployed on |
| `dao_financial_health` | Composite health signal: `strong` / `moderate` / `weak` / `critical` |
| `market_downturn_resilience` | Estimated resilience under 50% market drawdown |
| `fetched_at` | UTC ISO 8601 timestamp of data retrieval |

***

### Diversification Score

Uses the **Herfindahl-Hirschman Index (HHI)** normalized to 0–100:

- **100** — treasury spread evenly across many uncorrelated assets
- **0** — 100% concentrated in a single token

Higher scores = lower concentration risk. Scores below 30 typically indicate dangerous native-token overweight.

***

### Runway Estimate

`runway_years_estimate = treasury_usd / (annual_revenue x 0.30)`

Uses a 30% expense proxy on DeFiLlama-reported protocol revenue. Returns `null` when revenue data is unavailable.

***

### Cost estimation

| Event | Price |
|-------|-------|
| Actor start | $0.001 |
| Per protocol tracked | $0.005 |

| Scenario | Cost |
|----------|------|
| 10 protocols (default run) | ~$0.051 |
| 50 protocols | ~$0.251 |
| 100 protocols | ~$0.501 |

***

### Default Protocols

Uniswap, Aave, Compound, MakerDAO, Lido, Curve DAO, Synthetix, Balancer, SushiSwap, Yearn Finance. Any DeFiLlama protocol slug can be added via the `protocols` input field.

***

### FAQ

**What protocols can I track?**
Any protocol listed on DeFiLlama. Pass its slug (visible in the DeFiLlama URL, e.g., `uniswap`, `aave`, `lido`) in the `protocols` input field. The default run includes the top 10 DeFi protocols by TVL.

**How fresh is the data?**
Data is fetched live from DeFiLlama's public treasury API at run time. There is no cached layer — every run reflects the current on-chain state.

**Do I need an API key or wallet?**
No. All data comes from DeFiLlama's public, unauthenticated API. No wallet connection, no API key, no proxy required.

> **Disclaimer:** Treasury data is sourced from DeFiLlama's public API and is provided for informational and research purposes only. Runway estimates are approximations based on proxy expense models and may not reflect actual protocol spending. Nothing in this actor constitutes financial or investment advice.

***

### Related actors

- [Protocol Revenue Leaderboard](https://apify.com/gochujang/protocol-revenue-leaderboard) — Protocol fee revenue to pair with treasury balance for sustainability assessment
- [DeFi Governance Tracker](https://apify.com/gochujang/defi-governance-tracker) — Governance proposals affecting treasury spending for protocols tracked here
- [DeFi Risk Dashboard](https://apify.com/gochujang/defi-risk-dashboard) — Protocol risk scores alongside treasury runway for full protocol health picture

### Feedback

If this actor powers your protocol research, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/onchain-treasury-tracker#reviews)

***

**Keywords:** onchain treasury tracker, DeFi protocol treasury, DAO treasury balance, crypto protocol reserves, stablecoin treasury, Bitcoin treasury holdings, treasury runway calculator, protocol sustainability, Ethereum treasury data, DeFi governance funds, DeepDAO treasury, crypto foundation holdings, protocol balance sheet, token treasury analysis, on-chain fund tracking

# Actor input Schema

## `protocols` (type: `array`):

List of DeFiLlama protocol slugs to track. Defaults to top 10 DeFi protocols.

## `minTreasuryUsd` (type: `integer`):

Skip protocols with treasury value below this threshold (USD).

## `includeBreakdown` (type: `boolean`):

Include detailed token-level treasury breakdown in output.

## `sortBy` (type: `string`):

How to sort the output.

## `topHoldingsCount` (type: `integer`):

Number of top holdings to include in treasury_breakdown.

## Actor input object example

```json
{
  "protocols": [
    "uniswap",
    "aave",
    "compound",
    "makerdao",
    "lido",
    "curve-dao",
    "synthetix",
    "balancer",
    "sushiswap",
    "yearn"
  ],
  "minTreasuryUsd": 0,
  "includeBreakdown": true,
  "sortBy": "treasury_desc",
  "topHoldingsCount": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/onchain-treasury-tracker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/onchain-treasury-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call gochujang/onchain-treasury-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/onchain-treasury-tracker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/PeOKySiHklh4LC62m/builds/eO4nbsdptwQfytqzl/openapi.json
