Badger-Finance / Badger-Finance/gitcoin

Keeper dashboard

Open
#35 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
8
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Create user friendly site displaying relevant keeper info for Convex setts. Submissions will differentiate themselves based on the user friendliness and simplicity of the data and display. All Convex setts are harvested and earned using the [keeper acl](https://etherscan.io/address/0x711A339c002386f9db409cA55b6A35a604aB6cF6) contract via the [botsquad keeper address](https://etherscan.io/address/0xF8dbb94608E72A3C4cEeAB4ad495ac51210a341e). Currently all transactions are sent via webhook to Discord monitoring channels as they are confirmed. We would like to expand upon this monitoring to better understand performance and cost of the keepers.

Goals for this dashboard are:
- compare expected to actual apr for harvests
- track profitability of harvests per sett
- track frequency of harvests and earns
- see historical harvests and earns per sett
- track spend over time
- see how operations change over time
- and any other useful information that might be presented.

Winning submission to receive **150 BADGER**. The below are merely suggestions / guidelines, feel free to go above and beyond and restructure if needed. Data visualizations > text and tables.

#### Keeper Data
- keeper balances
- keeper gas usages
- average harvest timing (per sett)
- historical $$ moved (both allocating into strats + harvested yield, per sett and aggregate)
- total bot system tx count
- total bot system eth spent

then we could translate that into a formulaic way given we know our # of users

- person hours saved
- gas saved
- average return improvement (harvest apr => apy given bot harvest frequency vs. yearly apr)

#### Sett Data

- list of all the convex badger vaults
- list of all previous harvests (or last 10 or whatever) with the etherscan transaction
- expected apr for strategy (based on curve apr / convex apr)
- actual apr (based on the harvest tx data)
- track expected APY at next harvest
- APY is compared against the "expected" APY
- too much difference, show red

#### Potentially helpful code snippets
List of [addresses](https://github.com/DevOps4DeFi/scout/blob/master/docker/scout/scripts/addresses.py) (should be up to date, can confirm sett addresses on https://app.badger.com)

Example code used by keepers to get most recent harvests from etherscan:
```
def get_last_harvest_times(
web3: Web3, keeper_acl: contract, start_block: int = 0, etherscan_key: str = None
):
"""Fetches the latest harvest timestamps of strategies from Etherscan API which occur after `start_block`.
NOTE: Temporary function until Harvested events are emitted from all strategies.
Args:
web3 (Web3): Web3 node instance.
keeper_acl (contract): Keeper ACL web3 contract instance.
start_block (int, optional): Minimum block number to start fetching harvest timestamps from. Defaults to 0.
Returns:
dict: Dictionary of strategy addresses and their latest harvest timestamps.
"""
if etherscan_key is None:
etherscan_key = get_secret("keepers/etherscan", "ETHERSCAN_TOKEN")

endpoint = "https://api.etherscan.io/api"
payload = {
"module": "account",
"action": "txlist",
"address": keeper_acl.address,
"startblock": start_block,
"endblock": web3.eth.block_number,
"sort": "desc",
"apikey": etherscan_key,
}
try:
response = requests.get(endpoint, params=payload)
response.raise_for_status() # Raise HTTP errors

data = response.json()
times = {}
for tx in data["result"]:
if (
tx["to"] == ""
or web3.toChecksumAddress(tx["to"]) != keeper_acl.address
or "input" not in tx
):
continue
fn, args = keeper_acl.decode_function_input(tx["input"])
if (
str(fn)
in [
"",
"",
]
and args["strategy"] not in times
):
times[args["strategy"]] = int(tx["timeStamp"])
return times
except (KeyError, requests.HTTPError):
raise ValueError("Last harvest time couldn't be fetched")
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing docker/scout/scripts/addresses.py and the provided get_last_harvest_times example to understand the available keeper and sett data. Determine where the dashboard would obtain and present transaction, APR, cost, and timing history. Done means a user-friendly dashboard covers the listed keeper and sett metrics with useful visualizations, but the issue does not identify an application entry point or test suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
analytics, data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.