Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only run for prod chains and raise on errors #401

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 10 additions & 21 deletions gen_pools_and_gauges.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,31 +108,20 @@ def main():

with open("extras/chains.json", "r") as f:
chains = json.load(f)
for chain in chains["CHAIN_IDS_BY_NAME"]:
print(chain)
if chain == "fantom":
# not a balancer native chain
continue
for chain in chains["BALANCER_PRODUCTION_CHAINS"]:
print(f"Generating pools and gauges for {chain}...")
gauge_info = BalPoolsGauges(chain)
# pools
# TODO: consider moving to query object??
try:
result = process_query_swap_enabled_pools(query_swap_enabled_pools(chain))
if result:
pools[chain] = result
except Exception as e:
print(f"Error using core subgraph for {chain}, skipping: {e}")
pools[chain] = {}
result = process_query_swap_enabled_pools(query_swap_enabled_pools(chain))
if result:
pools[chain] = result
# gauges
try:
result = process_query_preferential_gauges(
gauge_info.query_preferential_gauges()
)
if result:
gauges[chain] = result
except Exception as e:
print(f"Error using gauge subgraph for {chain}, skipping: {e}")
gauges[chain] = {}
result = process_query_preferential_gauges(
gauge_info.query_preferential_gauges()
)
if result:
gauges[chain] = result
# cache mainnet BalPoolsGauges
if chain == "mainnet":
gauge_info_mainnet = gauge_info
Expand Down