Skip to content

Commit

Permalink
feat: add exporters for iearn and ironbank
Browse files Browse the repository at this point in the history
  • Loading branch information
banteg committed Feb 22, 2021
1 parent 27d8414 commit d9f4cbc
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions scripts/yearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,32 @@ def exporter_v2():
strat_gauge.labels(vault.name, strat, param).set(value)


def exporter_iearn():
earn_gauge = Gauge("iearn", "", ["vault", "param"])
start_http_server(8802)
earns = iearn.load_iearn()
for block in chain.new_blocks():
secho(f"{block.number}", fg="green")
output = iearn.describe_iearn(earns)
for name, data in output.items():
for param, value in data.items():
earn_gauge.labels(name, param).set(value)


def exporter_ironbank():
ironbank_gauge = Gauge("ironbank", "", ["vault", "param"])
start_http_server(8803)
markets = ironbank.load_ironbank()
for block in chain.new_blocks():
secho(f"{block.number}", fg="green")
output = ironbank.describe_ironbank(markets)
for name, data in output.items():
for param, value in data.items():
if value is None:
continue
ironbank_gauge.labels(name, param).set(value)


def develop_experimental():
for vault in vaults_v2.get_experimental_vaults():
print(vault)
Expand Down

0 comments on commit d9f4cbc

Please sign in to comment.