drone-mostafaUntitled Query
Updated 2022-05-27
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
›
⌄
with dai as (SELECT
to_varchar(EVENT_INPUTS:pool) as pool, case when pool = '102' then 'Fuse18'
when pool = '100' then 'Fuse6' when pool = '101' then 'Fuse7' END as fuse_pool,
sum(EVENT_INPUTS:"amount"/pow(10,18)) as amount,
case when TRUE then 'DAI' end as vault
from flipside_prod_db.ethereum_core.fact_event_logs
where contract_address = '0xafd2aade64e6ea690173f6de59fc09f5c9190d74'
and EVENT_NAME = 'PoolAllocation' and TX_STATUS='SUCCESS'
and pool not in (1,2) GROUP by fuse_pool, pool),
usdc as (SELECT to_varchar(EVENT_INPUTS:pool) as pool,
case when pool = '101' then 'Fuse7'
when pool = '108' then 'Fuse18'
when pool = '109' then 'Fuse6'
when pool = '103' then 'Fuse14'
when pool = '104' then 'Fuse15'
when pool = '102' then 'Fuse13'
when pool = '106' then 'Fuse11'
when pool = '100' then 'Fuse4' END as fuse_pool,
sum(EVENT_INPUTS:"amount"/pow(10,6)) as amount,
case when TRUE then 'USDC' end as vault
from flipside_prod_db.ethereum_core.fact_event_logs
where contract_address = '0x66f4856f1bbd1eb09e1c8d9d646f5a3a193da569'
and EVENT_NAME = 'PoolAllocation' and TX_STATUS='SUCCESS'
and pool not in (1,2,3) GROUP by fuse_pool, pool)
select * from dai UNION select * from usdc
Run a query to Download Data