hesamFlow of Optimism Bridge Query
Updated 2022-11-07
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 Optimism_bridges as (
select
CASE
When origin_to_address = lower('0x25ace71c97b33cc4729cf772ae268934f7ab5fa1') Then 'Optimism → Ethereum'
When origin_to_address = lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1') Then 'Ethereum → Optimism'
End as Flow,
origin_from_address,
block_timestamp,
amount_usd,
tx_hash
from
ethereum.core.ez_eth_transfers
where
origin_to_address in (lower('0x25ace71c97b33cc4729cf772ae268934f7ab5fa1'),lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1'))
and block_timestamp >= '2022-07-01'
and block_timestamp < '2022-08-01'
UNION ALL
select
CASE
When origin_to_address = lower('0x25ace71c97b33cc4729cf772ae268934f7ab5fa1') Then 'Optimism → Ethereum'
When origin_to_address = lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1') Then 'Ethereum → Optimism'
End as Flow,
origin_from_address,
block_timestamp,
amount_usd,
tx_hash
from
ethereum.core.ez_token_transfers
where
origin_to_address in (lower('0x25ace71c97b33cc4729cf772ae268934f7ab5fa1'),lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1'))
and block_timestamp >= '2022-07-01'
and block_timestamp < '2022-08-01'
)
select
Flow,
sum (amount_usd) as "Volume ($USD)",