From 7e7e640754e38791a3763f5b7bbf6955504697ce Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Wed, 11 Feb 2026 03:02:20 -0500 Subject: [PATCH 1/6] fix: use dedicate blocks subgraph for base --- bal_tools/subgraph.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bal_tools/subgraph.py b/bal_tools/subgraph.py index 5f2b8ba..7b0cfc4 100644 --- a/bal_tools/subgraph.py +++ b/bal_tools/subgraph.py @@ -63,6 +63,10 @@ def url_dict_from_df(df): "avalanche": f"{AURA_SUBGRAPH_URI}/aura-finance-avalanche/v0.0.1/", "plasma": None, } +BLOCKS_SUBGRAPHS_BY_CHAIN = { + "base": "GU5jJMiEHpomqddtbsXC3Avj3EweLHk6up1pvy2TCQQZ", +} + VAULT_V3_SUBGRAPHS_BY_CHAIN, VAULT_V3_SUBGRAPHS_BY_CHAIN_DEV = url_dict_from_df( vault_df ) @@ -108,6 +112,12 @@ def get_subgraph_url(self, subgraph="core") -> str: return SNAPSHOT_URL if subgraph == "aura": return AURA_SUBGRAPHS_BY_CHAIN.get(self.chain, None) + if subgraph == "blocks": + subgraph_id = BLOCKS_SUBGRAPHS_BY_CHAIN.get(self.chain) + if subgraph_id: + graph_api_key = os.getenv("GRAPH_API_KEY") + if graph_api_key: + return f"https://gateway.thegraph.com/api/{graph_api_key}/subgraphs/id/{subgraph_id}" url = self.get_subgraph_url_from_backend_config(subgraph) if url: return url From 34f36fab3f8cf9c4cb83fd781d5767b4f8a94551 Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Wed, 11 Feb 2026 03:41:27 -0500 Subject: [PATCH 2/6] fix: support core pools for monad and xlayer --- bal_tools/pools_gauges.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bal_tools/pools_gauges.py b/bal_tools/pools_gauges.py index b39a4c3..3cc4a1d 100644 --- a/bal_tools/pools_gauges.py +++ b/bal_tools/pools_gauges.py @@ -305,6 +305,8 @@ def build_core_pools( "hyperevm": {}, "optimism": {}, "plasma": {}, + "monad": {}, + "xlayer": {}, } # summarise extended core pools dict into core_pools dict From dcc9303bdf32df9281e07ba3d4d5562a3d73d2ea Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Wed, 11 Feb 2026 04:26:00 -0500 Subject: [PATCH 3/6] fix: zkevm ded --- tests/test_subgraph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_subgraph.py b/tests/test_subgraph.py index 6c21261..c29b6fb 100644 --- a/tests/test_subgraph.py +++ b/tests/test_subgraph.py @@ -195,7 +195,7 @@ def test_get_first_block_after_utc_timestamp_with_etherscan( if not os.getenv("ETHERSCAN_API_KEY"): pytest.skip("ETHERSCAN_API_KEY not set") - if chain not in chains_prod or chain in ["fantom", "sonic", "mode"]: + if chain not in chains_prod or chain in ["fantom", "sonic", "mode", "zkevm"]: pytest.skip(f"Skipping {chain}") test_timestamp = int((datetime.now() - timedelta(days=1)).timestamp()) From 1cb76ceceeffa634cf48eb57049f86a0885f9ff0 Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Wed, 11 Feb 2026 04:37:25 -0500 Subject: [PATCH 4/6] fix: monad and xlayer are v3 only --- tests/test_subgraph.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_subgraph.py b/tests/test_subgraph.py index c29b6fb..de77b1d 100644 --- a/tests/test_subgraph.py +++ b/tests/test_subgraph.py @@ -116,7 +116,11 @@ def test_find_all_subgraph_urls( pytest.skip( f"No {subgraph_type} subgraph exists on {subgraph_all_chains.chain}" ) - if subgraph_all_chains.chain == "hyperevm" and subgraph_type in [ + if subgraph_all_chains.chain in [ + "hyperevm", + "monad", + "xlayer", + ] and subgraph_type in [ "core", "gauges", "blocks", From 398a7bcdce0f72e3c4ca94378233f48ceed4ca42 Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Wed, 11 Feb 2026 04:49:39 -0500 Subject: [PATCH 5/6] perf: build core pools for all prod chains --- bal_tools/pools_gauges.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/bal_tools/pools_gauges.py b/bal_tools/pools_gauges.py index 3cc4a1d..ecec28e 100644 --- a/bal_tools/pools_gauges.py +++ b/bal_tools/pools_gauges.py @@ -1,7 +1,7 @@ from typing import Dict, List, Union import json import requests -from .utils import to_checksum_address, flatten_nested_dict +from .utils import to_checksum_address, flatten_nested_dict, chain_names_prod from gql.transport.exceptions import TransportQueryError from bal_tools.safe_tx_builder import ZERO_ADDRESS @@ -292,22 +292,7 @@ def build_core_pools( if debug: return core_pools_extended - core_pools = { - "mainnet": {}, - "polygon": {}, - "arbitrum": {}, - "gnosis": {}, - "zkevm": {}, - "avalanche": {}, - "base": {}, - "mode": {}, - "fraxtal": {}, - "hyperevm": {}, - "optimism": {}, - "plasma": {}, - "monad": {}, - "xlayer": {}, - } + core_pools = {chain: {} for chain in chain_names_prod()} # summarise extended core pools dict into core_pools dict for pool in core_pools_extended: From 0de96bba7025cb5779f1d55d14aa17f1008f3d5b Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Wed, 11 Feb 2026 04:50:16 -0500 Subject: [PATCH 6/6] fix: some chains have no dev url fallback --- tests/test_subgraph.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_subgraph.py b/tests/test_subgraph.py index de77b1d..437a7a1 100644 --- a/tests/test_subgraph.py +++ b/tests/test_subgraph.py @@ -145,8 +145,12 @@ def test_find_all_subgraph_urls( url = subgraph_all_chains.get_subgraph_url(subgraph_type) - assert url is not None - assert url is not "" + if have_thegraph_key: + assert url is not None + assert url is not "" + else: + # some chains only have gateway URLs requiring a key; None is expected + assert url is None or url != "" if not have_thegraph_key: subgraph_all_chains.set_silence_warnings(False)