kidaSynapse Bridge Volume (AVAX)
Updated 2023-01-05
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 avalanche.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 ('AVAX / USD')
group by 1,2
order by 1
),
avalanche_bridge_txs as (
select
block_timestamp::date as date,
tx_hash,
origin_from_address as bridger,
amount_usd
from avalanche.core.ez_avax_transfers
where eth_to_address in (
'0xc05e61d0e7a63d27546389b7ad62fdff5a91aace', --main bridge
'0x997108791d5e7c0ce2a9a4aac89427c68e345173', -- zap
'0x0ef812f4c68dc84c22a4821ef30ba2ffab9c2f3a' -- zap 1
)
and origin_from_address <> '0x230a1ac45690b9ae1176389434610b9526d2f21b' -- must be by user
),
token_bridges as (
select
Run a query to Download Data