diff --git a/deprecated-dune-v1-abstractions/ethereum/balancer/view_vebal_balances.sql b/deprecated-dune-v1-abstractions/ethereum/balancer/view_vebal_balances.sql index ccacfdee735..6c6192c6844 100644 --- a/deprecated-dune-v1-abstractions/ethereum/balancer/view_vebal_balances.sql +++ b/deprecated-dune-v1-abstractions/ethereum/balancer/view_vebal_balances.sql @@ -97,9 +97,13 @@ SELECT b.provider, bpt_balance, lock_period, - COALESCE((bpt_balance * - (lock_period / (365*86400)) * - ((unlocked_at - (FLOOR(EXTRACT(EPOCH FROM b.day))+86400)) / lock_period)), 0) AS vebal + GREATEST( + COALESCE((bpt_balance * + (lock_period / (365*86400)) * + ((unlocked_at - (FLOOR(EXTRACT(EPOCH FROM b.day))+86400)) / lock_period)), 0) , + + 0 + ) AS vebal FROM running_balances b LEFT JOIN locks_info l ON l.provider = b.provider