From 649ad316381927bc2316f807c109e0e54b54c18d Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Fri, 9 Jan 2026 11:23:35 +0700 Subject: [PATCH 1/4] fix: prep for v2 smol subgraphs --- bal_tools/graphql/core/pool_snapshots.gql | 4 ---- bal_tools/models.py | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bal_tools/graphql/core/pool_snapshots.gql b/bal_tools/graphql/core/pool_snapshots.gql index f7bd728..99d2b22 100644 --- a/bal_tools/graphql/core/pool_snapshots.gql +++ b/bal_tools/graphql/core/pool_snapshots.gql @@ -19,9 +19,5 @@ query PoolsSnapshots($first: Int, $skip: Int, $block: Int) { } } timestamp - protocolFee - swapFees - swapVolume - liquidity } } diff --git a/bal_tools/models.py b/bal_tools/models.py index 40793b6..8b901c8 100644 --- a/bal_tools/models.py +++ b/bal_tools/models.py @@ -124,15 +124,15 @@ def validate_symbol(cls, v): class PoolSnapshot(BaseModel): timestamp: int - protocolFee: Decimal - swapFees: Decimal - swapVolume: Decimal - liquidity: Decimal address: str id: str symbol: str totalProtocolFeePaidInBPT: Decimal = Field(default=Decimal(0)) tokens: List[TokenFee] + protocolFee: Optional[Decimal] = Field(default=Decimal(0)) + swapFees: Optional[Decimal] = Field(default=Decimal(0)) + swapVolume: Optional[Decimal] = Field(default=Decimal(0)) + liquidity: Optional[Decimal] = Field(default=Decimal(0)) @field_validator("totalProtocolFeePaidInBPT", mode="before") @classmethod From 27a81e2760dc1cc405ac883630107f3b0b7d4559 Mon Sep 17 00:00:00 2001 From: jalbrekt85 Date: Sun, 18 Jan 2026 19:30:18 -0600 Subject: [PATCH 2/4] adjust mock tests --- tests/mock/mock_data.py | 4 ---- tests/mock/test_mock_subgraph.py | 12 ------------ 2 files changed, 16 deletions(-) diff --git a/tests/mock/mock_data.py b/tests/mock/mock_data.py index a1daefe..a558ed7 100644 --- a/tests/mock/mock_data.py +++ b/tests/mock/mock_data.py @@ -112,10 +112,6 @@ ], }, "timestamp": 1713744000, - "protocolFee": "20729.00526903175861936991501109402", - "swapFees": "42555.1058049324", - "swapVolume": "114566260.594991", - "liquidity": "2036046.63834962216860375518680805", } ] } diff --git a/tests/mock/test_mock_subgraph.py b/tests/mock/test_mock_subgraph.py index a3113e2..fa9e072 100644 --- a/tests/mock/test_mock_subgraph.py +++ b/tests/mock/test_mock_subgraph.py @@ -73,15 +73,3 @@ def test_get_balancer_pool_snapshots(subgraph): assert snapshot.tokens[0].symbol == "DOLA" assert snapshot.tokens[1].symbol == "USDC" assert snapshot.timestamp == 1713744000 - assert pytest.approx(snapshot.protocolFee, rel=Decimal(1e-2)) == Decimal( - "20729.00526903175861936991501109402" - ) - assert pytest.approx(snapshot.swapFees, rel=Decimal(1e-2)) == Decimal( - "42555.1058049324" - ) - assert pytest.approx(snapshot.swapVolume, rel=Decimal(1e-2)) == Decimal( - "114566260.594991" - ) - assert pytest.approx(snapshot.liquidity, rel=Decimal(1e-2)) == Decimal( - "2036046.63834962216860375518680805" - ) From a48349ff4a1e41d644169312ce40aded03b45a8d Mon Sep 17 00:00:00 2001 From: jalbrekt85 Date: Sun, 18 Jan 2026 19:41:08 -0600 Subject: [PATCH 3/4] remove valueUSD from LastJoinExit --- bal_tools/graphql/core/last_join_exit.gql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bal_tools/graphql/core/last_join_exit.gql b/bal_tools/graphql/core/last_join_exit.gql index bfe0315..2349d08 100644 --- a/bal_tools/graphql/core/last_join_exit.gql +++ b/bal_tools/graphql/core/last_join_exit.gql @@ -1,7 +1,6 @@ query LastJoinExit($poolId: String!) { joinExits(first: 1, orderBy: timestamp, orderDirection: desc, where: {pool: $poolId}) { - amounts - valueUSD + amounts id sender timestamp From 5491c18091dfab2ed3d963cb3545cabc7f11a4c8 Mon Sep 17 00:00:00 2001 From: jalbrekt85 Date: Sun, 18 Jan 2026 20:49:29 -0600 Subject: [PATCH 4/4] remove protocolFee_not filter in poolSnapshots query --- bal_tools/graphql/core/pool_snapshots.gql | 1 - 1 file changed, 1 deletion(-) diff --git a/bal_tools/graphql/core/pool_snapshots.gql b/bal_tools/graphql/core/pool_snapshots.gql index 99d2b22..cf7f8f2 100644 --- a/bal_tools/graphql/core/pool_snapshots.gql +++ b/bal_tools/graphql/core/pool_snapshots.gql @@ -5,7 +5,6 @@ query PoolsSnapshots($first: Int, $skip: Int, $block: Int) { orderBy: timestamp orderDirection: desc block: { number: $block } - where: { protocolFee_not: null } ) { pool { address