Skip to content

Commit

Permalink
Merge pull request #29 from BeanstalkFarms/fix/sk/misc
Browse files Browse the repository at this point in the history
Fix/sk/misc
  • Loading branch information
soilking authored Oct 11, 2024
2 parents bd9c090 + 82cf7ef commit ae6b36d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
23 changes: 0 additions & 23 deletions src/data_access/subgraphs/beanstalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# subgraph. Will probably need to be increased someday. Would be better to find it
# programmatically, but regularly checking the subgraph creates an inefficiency and I am tired
# of compensating for subgraph implementation problems here.
# SeeBeanstalkGraphClient.get_num_silo_assets().
MAX_ASSET_SNAPSHOTS_PER_SEASON = 10

class BeanstalkGraphClient(object):
Expand Down Expand Up @@ -208,28 +207,6 @@ def seasons_stats(
# Return list of SeasonStats class instances
return [SeasonStats(result, i) for i in range(num_seasons)]

def get_num_silo_assets(self):
"""
The Beanstalk graph silo entities contain a lot of irrelevant 'assets'. This function will
return the number of assets we are actually interested in, deduced programmatically from
the subgraph.
NOTE(funderberker): UNTESTED
"""
query_str = """
silo(id: "{BEANSTALK_ADDR.lower()}") {
assets(first: 100, where: {depositedAmount_gt: "0"}) {
token
depositedAmount
}
}
"""

# Create gql query and execute.
result = execute(self._client, query_str)

# Return number of assets matching filters.
return len(result["silo"]["assets"])

# NOTE(funderberker): Hour to season conversion is imperfect. Unsure why.
# Perhaps due to paused hours. Or subgraph data is different than expectations.
Expand Down
2 changes: 1 addition & 1 deletion src/monitors/preview/eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _monitor_method(self):
self.wait_for_next_cycle()
gas_base_fee = get_gas_base_fee(Chain.ARB)
eth_price = self.eth_price()
self.name_function(f"{holiday_emoji()}{round_num(gas_base_fee, 1)} Gwei")
self.name_function(f"{holiday_emoji()}{round_num(gas_base_fee, 3)} Gwei")
self.status_function(f"ETH: ${round_num(eth_price)}")

def eth_price(self):
Expand Down
5 changes: 5 additions & 0 deletions src/monitors/seasons.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ def season_summary_string(self, last_season_stats, current_season_stats, short_s
ret_string += f"\n🏦 {round_num(current_silo_bdv, 0)} BDV in Silo"

# Gets current and previous season seeds for each asset
"""
TODO: Disabled this entire section until a fix for season block can be implemented
This is preferable so the seasons can log in the meantime
season_block = self.beanstalk_client.get_season_block()
parallelized = []
for asset_changes in silo_assets_changes:
Expand Down Expand Up @@ -203,6 +207,7 @@ def season_summary_string(self, last_season_stats, current_season_stats, short_s
# ret_string += f' — {token_symbol} ({round_num(bean_to_float(current_bdv)/current_silo_bdv*100, 1)}% of Silo)'
ret_string += f"\n\t📊 Totals: {round_num_auto(bean_to_float(current_bdv), sig_fig_min=2, abbreviate=True)} BDV, {round_num(seeds_now, 3)} Seeds, {round_num(bean_to_float(current_bdv)/current_silo_bdv*100, 1)}% of Silo"
"""

# Field.
ret_string += f"\n\n**Field**"
Expand Down

0 comments on commit ae6b36d

Please sign in to comment.