SocioAnalyticarevenue
Updated 2024-01-01
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with
q1 as (
SELECT
CASE when protocol ilike '%GMX%' then 'GMX'
when protocol ilike '%Joe%' then 'Trader Joe'
when protocol ilike '%VaporDex%' then 'VaporDex'
when protocol ilike '%Uniswap%' then 'Uniswap'
when protocol ilike '%SushiSwap%' then 'SushiSwap'
when protocol ilike '%KyberSwap%' then 'KyberSwap'
when protocol ilike '%Balancer V2%' then 'Balancer'
when protocol ilike '%AAVE%' then 'AAVE'
when protocol ilike '%Chainlink%' then 'Chainlink'
else protocol end as platform,
sum(revenue) as "Q1 2023"
FROM external.defillama.fact_protocol_fees_revenue
WHERE date BETWEEN '2023-01-01' AND '2023-04-01'
AND chain = 'avalanche' AND protocol != 'Avalanche' AND protocol != 'avalanche'
GROUP by 1
)
,
q2 as (
SELECT
CASE when protocol ilike '%GMX%' then 'GMX'
when protocol ilike '%Joe%' then 'Trader Joe'
when protocol ilike '%VaporDex%' then 'VaporDex'
when protocol ilike '%Uniswap%' then 'Uniswap'
when protocol ilike '%SushiSwap%' then 'SushiSwap'
when protocol ilike '%KyberSwap%' then 'KyberSwap'
when protocol ilike '%Balancer V2%' then 'Balancer'
when protocol ilike '%AAVE%' then 'AAVE'
when protocol ilike '%Chainlink%' then 'Chainlink'
else protocol end as platform,
sum(revenue) as "Q2 2023"
FROM external.defillama.fact_protocol_fees_revenue
WHERE date BETWEEN '2023-04-01' AND '2023-07-01'
AND chain = 'avalanche' AND protocol != 'Avalanche' AND protocol != 'avalanche'
QueryRunArchived: QueryRun has been archived