Updated 2023-03-07
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 t1 as
(select
TX_HASH as ss,
date_trunc(day,BLOCK_TIMESTAMP) as date,
-------------------------- USer
ORIGIN_FROM_ADDRESS as user ,
CONTRACT_ADDRESS as vv,
--amount0In
ORIGIN_TO_ADDRESS as platform,
--------------- token in
case
when EVENT_INPUTS['fromToken'] is not null then EVENT_INPUTS['fromToken']
when EVENT_INPUTS['inputToken'] is not null then EVENT_INPUTS['inputToken']
when EVENT_INPUTS['tokenA'] is not null then EVENT_INPUTS['tokenA']
end
as token_in ,
--------------- amount in
case when EVENT_INPUTS['amount0'] is not null then (EVENT_INPUTS['amount0'])
when EVENT_INPUTS['inputAmount'] is not null then (EVENT_INPUTS['inputAmount'])
when EVENT_INPUTS['inputValue'] is not null then (EVENT_INPUTS['inputValue'])
when EVENT_INPUTS['amountIn'] is not null then (EVENT_INPUTS['amountIn'])
when EVENT_INPUTS['amount'] is not null then (EVENT_INPUTS['amount']) --
when EVENT_INPUTS['amount0In'] is not null and EVENT_INPUTS['amount0In']!='0' then (EVENT_INPUTS['amount0In'] )
when EVENT_INPUTS['amount0In'] is not null and EVENT_INPUTS['amount0In']='0' then (EVENT_INPUTS['amount1In'] )
end
as amount_inn,
--------------- token out
case when EVENT_INPUTS['toToken'] is not null then EVENT_INPUTS['toToken']
Run a query to Download Data