Yousefi_1994GMX Trading - Top traders by number of trade
Updated 2022-09-20
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 all_gmx_trading as (
select
tx_hash,
block_timestamp,
case concat('0x', substring(data, 155, 40))
when '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' then 'USDC'
when '0x82af49447d8a07e3bd95bd0d56f35241523fbab1' then 'WETH'
when '0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f' then 'WBTC'
when '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1' then 'DAI'
when '0x17fc002b466eec40dae837fc4be5c67993ddbd6f' then 'FRAX'
when '0xf97f4df75117a78c1a5a0dbb814af92458539fb4' then 'LINK'
when '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9' then 'USDT'
when '0xfa7f8980b0f1e64a2062791cc3b0871572f1f7f0' then 'UNI'
when '0xfea7a6a0b346362bf88a9e4a88416b77a57d6c2a' then 'MIM'
end as collateral_token,
case concat('0x', substring(data, 219, 40))
when '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' then 'USDC'
when '0x82af49447d8a07e3bd95bd0d56f35241523fbab1' then 'WETH'
when '0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f' then 'WBTC'
when '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1' then 'DAI'
when '0x17fc002b466eec40dae837fc4be5c67993ddbd6f' then 'FRAX'
when '0xf97f4df75117a78c1a5a0dbb814af92458539fb4' then 'LINK'
when '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9' then 'USDT'
when '0xfa7f8980b0f1e64a2062791cc3b0871572f1f7f0' then 'UNI'
when '0xfea7a6a0b346362bf88a9e4a88416b77a57d6c2a' then 'MIM'
end as index_token,
concat('0x', substring(data, 27 + 64 * 1, 40)) as address,
case
when ethereum.public.udf_hex_to_int(substring(data, 3 + 64 * 6, 64))::float = 1 then 'Long'
else 'Short'
end as trade_type,
ethereum.public.udf_hex_to_int(substring(data, 3 + 64 * 5, 64))::float/1e30 as volume,
ethereum.public.udf_hex_to_int(substring(data, 3 + 64 * 8, 64))::float/1e30 as fee
from arbitrum.core.fact_event_logs
where (topics[0] = '0x2fe68525253654c21998f35787a8d0f361905ef647c854092430ab65f2f15022' or topics[0] = '0x93d75d64d1f84fc6f430a64fc578bdd4c1e090e90ea2d51773e626d19de56d30')
and contract_address = '0x489ee077994b6658eafa855c308275ead8097c4a'
Run a query to Download Data