kiacryptoOvertime market volume per day
Updated 2022-08-20Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
-- select *
-- from optimism.core.fact_token_transfers
-- where tx_hash = '0x978814d066e7fefdeb5563c83b0e00d6ad5988993ffd3f9dcf3c952ef09d23d5' and
-- origin_from_address = from_address and
-- to_address = '0x170a5714112daeff20e798b6e92e25b86ea603c1' and origin_to_address = '0x170a5714112daeff20e798b6e92e25b86ea603c1'
select block_timestamp::date as date, case
when contract_address = '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9' then 'susd'
when contract_address = '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1' then 'dai' end as currency, sum(raw_amount/1e18) as volume
from optimism.core.fact_token_transfers
where to_address = '0x170a5714112daeff20e798b6e92e25b86ea603c1' and origin_to_address = '0x170a5714112daeff20e798b6e92e25b86ea603c1' and origin_from_address = from_address and
block_timestamp::date between current_date - 14 and current_date - 1 and contract_address in ('0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9', '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1')
group by 1, 2
union all
select block_timestamp::date as date, case
when contract_address = '0x7f5c764cbc14f9669b88837ca1490cca17c31607' then 'usdc'
when contract_address = '0x94b008aa00579c1307b0ef2c499ad98a8ce58e58' then 'usdt' end as currency, sum(raw_amount/1e6) as volume
from optimism.core.fact_token_transfers
where to_address = '0x170a5714112daeff20e798b6e92e25b86ea603c1' and origin_to_address = '0x170a5714112daeff20e798b6e92e25b86ea603c1' and origin_from_address = from_address and
block_timestamp::date between current_date - 14 and current_date - 1 and contract_address in ('0x7f5c764cbc14f9669b88837ca1490cca17c31607', '0x94b008aa00579c1307b0ef2c499ad98a8ce58e58')
group by 1, 2
Run a query to Download Data