Yearn Treasury

This WIP library runs the dao-treasury exporter for the Yearn Finance treasury.

Installation

  • pip:

     pip install yearn-treasury
    
  • From Source:

    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 to use your RPC.

  • You will need an auth token for Etherscan’s API. Follow their guide to get your key, and set env var ETHERSCAN_TOKEN with its value.

  • You’ll also need Docker 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:

# For pip installations:
yearn-treasury --network mainnet --interval 12h

For local development (from source installation), use:

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)

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 for the dao-treasury dashboard.

Enjoy!

Screenshots

Transactions Dashboard

image

Indices and tables