Coder Social home page Coder Social logo

pmdaly / yearn-exporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yearn/yearn-exporter

0.0 0.0 0.0 934 KB

Realtime and historical Yearn metrics

Home Page: https://yearn.vision

License: MIT License

Python 98.22% Dockerfile 0.05% Shell 0.69% Makefile 0.88% Gherkin 0.16%

yearn-exporter's Introduction

Yearn Exporter

Collects realtime on-chain numeric data about all Yearn products and exposes it in multiple formats.

Hosted version is available at https://yearn.vision.

Installation

You will need:

  • Erigon for querying historical data
  • Prometheus to pull the metrics, persist them and make them queryable
  • Grafana if you want to set up custom dashboards and alerts
  • Etherscan API key

To run treasury.py, you will need:

  • Environment variable MORALIS_KEY set to your Moralis API Key

Usage

Prometheus exporter

# full info
brownie run exporter
# realtime tvl only
brownie run exporter tvl

Postgres exporter

# export historical tvl
brownie run historical_tvl
# complementary api server
uvicorn yearn.api:app --port 8000 --reload

On-demand stats

# tvl summary
brownie run tvl
# info about live v2 strategies
brownie run print_strategies

Docker setup

Grafana dashboard

export GF_SECURITY_ADMIN_USER=<YOUR_ADMIN_USER> # change this if you want to have a different admin user name, default is admin
export GF_SECURITY_ADMIN_PASSWORD=<YOUR_ADMIN_PASSWORD> # change this if you want to have a different admin password, default is admin
export WEB3_PROVIDER=<YOUR_WEB3_PROVIDER> # if this is set, it overrides Infura, and instead a custom url is used as the web3 provider
export ETHERSCAN_TOKEN=<YOUR_ETHERSCAN_TOKEN> # this needs to be set
export EXPLORER=<EXPLORER> # optional, default to: https://api.etherscan.io/api
export SLEEP_SECONDS=<YOUR_SLEEP_SECONDS> # if this is set, the exporters will wait the given amount of time between subsequent invocations to your web3 provider.
make dashboards

After successful startup you can go directly to grafana at http://localhost:3000. If you want to change your dashboards you can sign-in at the lower left with admin:admin.

Historical TVL

export WEB3_PROVIDER=<YOUR_WEB3_PROVIDER> # if this is set, it overrides Infura, and instead a custom url is used as the web3 provider
export ETHERSCAN_TOKEN=<YOUR_ETHERSCAN_TOKEN> # this needs to be set
export EXPLORER=<EXPLORER> # optional, default to: https://api.etherscan.io/api
make tvl

After successful startup you can access the tvl rest endpoint at http://localhost:4000.

Setting up GitHub Actions

Create Access Keys for apy-exporter-service-user user.

Create a new environment named production and add the newly created AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

yearn-exporter's People

Contributors

0xean avatar 0xfondue avatar 0xkofee avatar 0xm3rlin avatar amantay-a avatar ankarrr avatar bakhshandeh avatar banteg avatar bobthebuidler avatar crolev avatar darkghost7 avatar dudesahn avatar franzns avatar genysys avatar iris112 avatar jainkunal avatar jstashh avatar lukaskai avatar mariuspod avatar mickhagen avatar nourharidy avatar numan avatar nymmrx avatar pmdaly avatar publu avatar rashiq-ddc avatar saltyfacu avatar sandra-deeelite avatar tymmesyde avatar yuval-weiss avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.