Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions bal_tools/graphql/core/last_join_exit.gql
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
query LastJoinExit($poolId: String!) {
joinExits(first: 1, orderBy: timestamp, orderDirection: desc, where: {pool: $poolId}) {
amounts
valueUSD
amounts
id
sender
timestamp
Expand Down
5 changes: 0 additions & 5 deletions bal_tools/graphql/core/pool_snapshots.gql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,9 +18,5 @@ query PoolsSnapshots($first: Int, $skip: Int, $block: Int) {
}
}
timestamp
protocolFee
swapFees
swapVolume
liquidity
}
}
8 changes: 4 additions & 4 deletions bal_tools/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions tests/mock/mock_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@
],
},
"timestamp": 1713744000,
"protocolFee": "20729.00526903175861936991501109402",
"swapFees": "42555.1058049324",
"swapVolume": "114566260.594991",
"liquidity": "2036046.63834962216860375518680805",
}
]
}
Expand Down
12 changes: 0 additions & 12 deletions tests/mock/test_mock_subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)