jackguy2023-09-20 12:03 PM copy
Updated 2024-01-13
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
›
⌄
-- forked from 2023-09-20 12:03 PM @ https://flipsidecrypto.xyz/edit/queries/a13697c4-bfb3-493b-a4c3-85e3337af7e4
with tab1 as (
SELECT
date(block_timestamp) as day,
count(DISTINCT tx_hash) as events,
sum(AMOUNT_USD) as volume_usd
FROM polygon.core.ez_token_transfers
WHERE (from_address in (lower('0xCEd763C2Ff8d5B726b8a5D480c17C24B6686837F'), lower('0x86e2ab83ac9d91c618a3258653063beba0ff9461'))
OR to_address in (lower('0xCEd763C2Ff8d5B726b8a5D480c17C24B6686837F'), lower('0x86e2ab83ac9d91c618a3258653063beba0ff9461'))
)
GROUP BY 1
UNION ALL
SELECT
date(block_timestamp) as day,
count(DISTINCT tx_hash) as events,
sum(CASE when symbol LIKE 'DAI' then amount When symbol LIKE 'ECO' then 0.02 * amount else AMOUNT_USD end) as volume_usd
FROM optimism.core.ez_token_transfers
WHERE (from_address in (lower('0x1aBe03DC4706aE47c4F2ae04EEBe5c8607c74e17'), lower('0xc430C74f02670823bB231DeD2c6bFd4e8C54F970'))
OR to_address in (lower('0x1aBe03DC4706aE47c4F2ae04EEBe5c8607c74e17'), lower('0xc430C74f02670823bB231DeD2c6bFd4e8C54F970'))
)
GROUP BY 1
UNION ALL
SELECT
date(block_timestamp) as day,
count(DISTINCT tx_hash) as events,
sum(AMOUNT_USD) as volume_usd
FROM arbitrum.core.ez_token_transfers
WHERE (from_address in (lower('0x9B0817fA08b46670B92300B58AA1f4AB155701ea'), lower('0x831D561607516Dfb11D06393FFE8336f84d625BD'))
OR to_address in (lower('0x9B0817fA08b46670B92300B58AA1f4AB155701ea'), lower('0x831D561607516Dfb11D06393FFE8336f84d625BD'))
)
GROUP BY 1
QueryRunArchived: QueryRun has been archived