SalehFlash Bounty: GMX Protocol Overview-compare
Updated 2022-09-18
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 lst_price as (
select
hour::date as day
,case
when symbol='UNI' then 18
else decimals
end decimals
,symbol
,avg(price) as price_usd
from ethereum.core.fact_hourly_token_prices
group by 1,2,3
)
,lst_swaps as (
select
block_timestamp
,tx_hash
,ORIGIN_FROM_ADDRESS as trader
-----------------------------------Swap From---------------------------------------------------------
,case
when event_inputs:inputToken='0xf97f4df75117a78c1a5a0dbb814af92458539fb4' then 'LINK'
when event_inputs:inputToken='0xfa7f8980b0f1e64a2062791cc3b0871572f1f7f0' then 'UNI'
when event_inputs:inputToken='0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f' then 'WBTC'
when event_inputs:inputToken='0x82af49447d8a07e3bd95bd0d56f35241523fbab1' then 'WETH'
else upper(split((select min(ADDRESS_NAME) from arbitrum.core.dim_labels where address=event_inputs:inputToken ),' ')[2])
end as swap_from_name
-----------------------------------Swap To---------------------------------------------------------
,case
when event_inputs:outputToken='0xf97f4df75117a78c1a5a0dbb814af92458539fb4' then 'LINK'
when event_inputs:outputToken='0xfa7f8980b0f1e64a2062791cc3b0871572f1f7f0' then 'UNI'
when event_inputs:outputToken='0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f' then 'WBTC'
when event_inputs:outputToken='0x82af49447d8a07e3bd95bd0d56f35241523fbab1' then 'WETH'
else upper(split((select min(ADDRESS_NAME) from arbitrum.core.dim_labels where address=event_inputs:outputToken ),' ')[2])
end as swap_to_name
---------------------------------------------------------------------------------------------------
,event_inputs:inputValue as swap_from_raw
,event_inputs:outputValue as swap_to_raw
Run a query to Download Data