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 diff --git a/bal_tools/graphql/core/pool_snapshots.gql b/bal_tools/graphql/core/pool_snapshots.gql index f7bd728..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 @@ -19,9 +18,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 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" - )