kidaSynapse Volume by Category (ETH)
Updated 2023-01-05Copy Reference Fork
999
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
lp_addresses as (
select distinct
event_inputs:swapAddress::string as lp_address
from ethereum.core.fact_event_logs
where event_name = 'NewSwapPool' and origin_from_address = '0x0af91fa049a7e1894f480bfe5bba20142c6c29a9'
),
native_prices as (
select
date(block_timestamp) as date,
replace(feed_name, ' / USD') as symbol,
median(coalesce(latest_answer_adj, latest_answer_unadj / pow(10,8))) as price --using median cause there will be some nulls / zeroes
from ethereum.chainlink.ez_oracle_feeds
where feed_category = 'Cryptocurrency (USD pairs)'
and feed_name in ('ETH / USD')
group by 1,2
order by 1
),
eth_bridge_txs as (
select
block_timestamp::date as date,
tx_hash,
origin_from_address as bridger,
amount_usd,
'WETH' as category
from ethereum.core.ez_eth_transfers
where eth_to_address in (
'0x2796317b0ff8538f253012862c06787adfb8ceb6', --main bridge
'0x6571d6be3d8460cf5f7d6711cd9961860029d85f', -- zap 1
'0x518b553fe47208389271745155a6abf4a961ef28', -- zap 2
'0xa2569370a9d4841c9a62fc51269110f2eb7e0171' -- zap 3
)
and origin_from_address <> '0x230a1ac45690b9ae1176389434610b9526d2f21b' -- must be by user
),
Run a query to Download Data