Skip to content

Commit

Permalink
fix: check total protocol fee for gyro pools
Browse files Browse the repository at this point in the history
  • Loading branch information
gosuto-inzasheru committed Sep 25, 2024
1 parent ca9b91a commit c631c12
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions bal_tools/graphql/core/liquid_pools_protocol_yield_fee.gql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ query LiquidPoolsProtocolYieldFee {
pools(
first: 1000
where: {
# pool should have at least one rate provider that is not address(0)
and: [
{
priceRateProviders_: {
Expand All @@ -10,15 +11,35 @@ query LiquidPoolsProtocolYieldFee {
}
{
or: [
{ protocolYieldFeeCache_gt: 0 }
{
# regular pools; need to have a yield fee
and: [
{ protocolYieldFeeCache_gt: 0 }
{ poolType_not_contains_nocase: "Gyro" }
]
}
{
# metastable pools dont have the yield fee attribute;
# check swap fee and pool type version instead
and: [
{ swapFee_gt: 0 }
{ poolType_contains: "MetaStable" }
{ poolTypeVersion: 1 }
]
}
{ poolType_contains_nocase: "Gyro" }
{
# gyro pools have a unreliable yield fee;
# check total earned fees instead (either in usd or bpt)
and: [
{ poolType_contains_nocase: "Gyro" }
{
or: [
{ totalProtocolFee_gt: 0 }
{ totalProtocolFeePaidInBPT_gt: 0 }
]
}
]
}
]
}
]
Expand Down

0 comments on commit c631c12

Please sign in to comment.