Updated 2022-08-24Copy 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with x as (
SELECT
to_address,
count(DISTINCT tx_hash) as bets,
sum(RAW_AMOUNT / pow(10, 18) ) as volume_in
FROM
optimism.core.fact_token_transfers
WHERE
from_address LIKE lower(
'0x170a5714112daEfF20E798B6e92e25B86Ea603C1'
)
and contract_address = '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9'
and block_timestamp >= current_date - 14
GROUP BY
1
),
y as (
SELECT
from_address as users,
sum(
RAW_AMOUNT / pow(10, 18)
) as volume_out
FROM
optimism.core.fact_token_transfers
WHERE
to_address LIKE lower(
'0x170a5714112daEfF20E798B6e92e25B86Ea603C1'
)
and contract_address = '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9'
and block_timestamp >= current_date - 14
GROUP BY
1
),
xy as (
SELECT
users,
Run a query to Download Data