m3jiDaily Sushi Revenue
Updated 2024-09-28
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 prices AS (
select
trunc(hour, 'hour') as hour,
avg(price) as price
from
crosschain.price.ez_prices_hourly
where
symbol = 'ETH'
group by
1
),
sushiswap AS (
SELECT
trunc(d.block_timestamp, 'hour') as hour,
d.tx_hash,
d.amount_in_usd,
d.amount_out_usd,
(d.amount_in_usd + d.amount_out_usd) as tx_vol
from
ethereum.defi.ez_dex_swaps d
join ethereum.core.fact_transactions t on t.tx_hash = d.tx_hash
where
platform like 'sushi%'
and tx_vol is not null
and tx_vol is not null
AND amount_out_usd IS NOT NULL
AND amount_in_usd IS NOT NULL
ORDER BY
1 DESC
),
revenue AS (
SELECT
tx.hour,
tx.tx_vol AS "Volume USD",
"Volume USD" * 0.003 AS "Sushi Total Charge for Swaps",
"Volume USD" * 0.0025 AS "Sushi LP Rewards",
QueryRunArchived: QueryRun has been archived