Skip to content

Commit

Permalink
Update balancer_protocol_fee_macro.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
viniabussafi authored Jul 19, 2024
1 parent f08661b commit 8e25806
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ WITH pool_labels AS (
approx_percentile(median_price, 0.5) AS price,
sum(sample_size) AS sample_size
FROM {{ source('dex', 'prices') }}
WHERE blockchain = '{{blockchain}}'
GROUP BY 1, 2
HAVING sum(sample_size) > 3
),
Expand Down Expand Up @@ -67,7 +68,7 @@ WITH pool_labels AS (
SUM(protocol_liquidity_usd / supply) AS price
FROM {{ ref(base_spells_namespace + '_liquidity') }} l
LEFT JOIN {{ ref(base_spells_namespace + '_bpt_supply') }} s ON s.token_address = l.pool_address
AND l.blockchain = s.blockchain AND s.day = l.day AND s.supply > 0
AND l.blockchain = s.blockchain AND s.day = l.day AND s.supply > 1e-4
WHERE l.blockchain = '{{blockchain}}'
AND l.version = '{{version}}'
GROUP BY 1, 2, 3
Expand Down

0 comments on commit 8e25806

Please sign in to comment.