https://github.com/bobthebuidler/yearn-treasury
This WIP library runs the eth-portfolio and dao-treasury exporters for the Yearn Finance treasury.
https://github.com/bobthebuidler/yearn-treasury
blockchain crypto cryptocurrency defi erc20 erc20-token erc20-tokens ethereum evm evm-blockchain evm-chains python token token-price tokens treasury yearn yearn-finance
Last synced: 4 months ago
JSON representation
This WIP library runs the eth-portfolio and dao-treasury exporters for the Yearn Finance treasury.
- Host: GitHub
- URL: https://github.com/bobthebuidler/yearn-treasury
- Owner: BobTheBuidler
- Created: 2025-05-09T00:39:32.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2026-01-20T06:49:57.000Z (4 months ago)
- Last Synced: 2026-01-20T14:50:41.602Z (4 months ago)
- Topics: blockchain, crypto, cryptocurrency, defi, erc20, erc20-token, erc20-tokens, ethereum, evm, evm-blockchain, evm-chains, python, token, token-price, tokens, treasury, yearn, yearn-finance
- Language: Python
- Homepage: https://bobthebuidler.github.io/yearn-treasury/
- Size: 21 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
This WIP library runs the [dao-treasury](https://github.com/BobTheBuidler/dao-treasury) exporter for the [Yearn Finance](https://yearn.fi/) treasury.
## Installation
- **pip:**
```bash
pip install yearn-treasury
```
- **From Source:**
```bash
git clone https://github.com/BobTheBuidler/yearn-treasury
cd yearn-treasury
poetry install
```
## Requirements
- Python 3.10 or higher.
- At least 16GB of RAM.
- All dependencies installed as specified in the project’s pyproject.toml file.
## Prerequisites
- First, you will need to bring your own archive node. This can be one you run yourself, or one from one of the common providers (Tenderly, Alchemy, QuickNode, etc.). Your archive node must have tracing enabled (free-tier Alchemy nodes do not support this option).
- You must configure a [brownie network](https://eth-brownie.readthedocs.io/en/stable/network-management.html) to use your RPC.
- You will need an auth token for [Etherscan](https://etherscan.io/)'s API. Follow their [guide](https://docs.etherscan.io/etherscan-v2/getting-an-api-key) to get your key, and set env var `ETHERSCAN_TOKEN` with its value.
- You'll also need [Docker](https://www.docker.com/get-started/) installed on your system. If on MacOS, you will need to leave Docker Desktop open while Yearn Treasury is running.
## Usage
Run the treasury export tool:
```bash
# For pip installations:
GF_SECURITY_ADMIN_USER=admin GF_SECURITY_ADMIN_PASSWORD=... yearn-treasury --network mainnet --interval 12h
```
For local development (from source installation), use:
```bash
GF_SECURITY_ADMIN_USER=admin GF_SECURITY_ADMIN_PASSWORD=... poetry run yearn-treasury --network mainnet --interval 12h
```
**CLI Options:**
- `--network`: The id of the brownie network the exporter will connect to (default: mainnet)
- `--interval`: The time interval between each data snapshot (default: 12h)
- `--daemon`: Run the export process in the background (default: False) (NOTE: currently unsupported)
- `--grafana-port`: Set the port for the Grafana dashboard where you can view data (default: 3004)
- `--renderer-port`: Set the port for the report rendering service (default: 8080)
- `--victoria-port`: Set the port for the Victoria metrics reporting endpoint (default: 8430)
**Grafana Auth:**
- Requires `GF_SECURITY_ADMIN_USER` and `GF_SECURITY_ADMIN_PASSWORD`.
- Optional anonymous access via `DAO_TREASURY_GRAFANA_ANON_ENABLED=true`.
After running the command, the export script will run continuously until you close your terminal.
To access the dashboard, open your browser and navigate to [http://localhost:3004](http://localhost:3004) for the [dao-treasury](https://github.com/BobTheBuidler/dao-treasury) dashboard and log in with your Grafana admin credentials.
Enjoy!
## Screenshots
#### [Transactions Dashboard](https://bobthebuidler.github.io/yearn-treasury/transactions.html)
