shreexCumulative Fees Collected USD and WETH
Updated 2022-08-01
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
›
⌄
SELECT
date_trunc('day',block_timestamp) as date ,
sum(raw_amount/pow(10,18)) as fees_weth,
fees_weth*avg(price) as fees_usd,
avg(raw_amount/pow(10,18)) as avg_fee_earned,
(100*fees_weth/2.5) as sales_volume_in_weth,
sales_volume_in_weth*avg(price) as sales_volume_usd,
sum(fees_usd) over (order by date) as cumulative_fees_collected_usd,
sum(fees_weth) over (order by date) as cumulative_fees_collected_weth
from polygon.core.fact_token_transfers left join ethereum.core.fact_hourly_token_prices on date_trunc('hour',block_timestamp)=date_trunc('hour',hour) WHERE to_address='0x8de9c5a032463c561423387a9648c5c7bcc5bc90'
AND token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' and contract_address='0x7ceb23fd6bc0add59e62ac25578270cff1b9f619'
GROUP BY date
ORDER BY date
Run a query to Download Data