FrodoTrisolaris - Liquidity
Updated 2024-03-12
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 base as (select
date(BLOCK_TIMESTAMP) as date,
TX_HASH,
FROM_ADDRESS as provider,
case
when ORIGIN_FUNCTION_SIGNATURE in ('0xe8e33700','0xf305d719') then 'Adding Liquidity'
when ORIGIN_FUNCTION_SIGNATURE in ('0x2195995c','0xded9382a','0xbaa2abde','0x02751cec','0xaf2979eb','0x5b0d5984') then 'Removing Liquidity'
end as liquidity_type,
case
when ORIGIN_FUNCTION_SIGNATURE in ('0xe8e33700','0x2195995c','0xbaa2abde') then concat('0x' , substr(input_data, (64*0)+35,40))
when ORIGIN_FUNCTION_SIGNATURE in ('0xf305d719','0xded9382a','0x02751cec','0xaf2979eb','0x5b0d5984') then '0xc9bdeed33cd01541e1eed10f90519d2c06fe3feb'
end as First_token,
case
when ORIGIN_FUNCTION_SIGNATURE in ('0xe8e33700') then ethereum.public.udf_hex_to_int (substr(INPUT_DATA,((64*2)+11),64))
when ORIGIN_FUNCTION_SIGNATURE in ('0x2195995c','0xaf2979eb') then (ethereum.public.udf_hex_to_int (substr(INPUT_DATA,((64*2)+11),64)))
when ORIGIN_FUNCTION_SIGNATURE in ('0xf305d719') then (value * pow(10,18))
when ORIGIN_FUNCTION_SIGNATURE in ('0xded9382a','0xbaa2abde','0x02751cec','0x5b0d5984') then (ethereum.public.udf_hex_to_int (substr(INPUT_DATA,((64*3)+11),64)))
end as First_token_Amount,
case
when ORIGIN_FUNCTION_SIGNATURE in ('0xe8e33700','0x2195995c','0xbaa2abde') then concat('0x' , substr(input_data, (64*1)+35,40))
when ORIGIN_FUNCTION_SIGNATURE in ('0xf305d719','0xded9382a','0x02751cec','0xaf2979eb','0x5b0d5984') then concat('0x' , substr(input_data, (64*0)+35,40))
end as Second_token,
case
when ORIGIN_FUNCTION_SIGNATURE in ('0xe8e33700') then ethereum.public.udf_hex_to_int (substr(INPUT_DATA,((64*3)+11),64))
when ORIGIN_FUNCTION_SIGNATURE in ('0x2195995c') then (ethereum.public.udf_hex_to_int (substr(INPUT_DATA,((64*3)+11),64)))
when ORIGIN_FUNCTION_SIGNATURE in ('0xf305d719','0xaf2979eb') then (ethereum.public.udf_hex_to_int (substr(INPUT_DATA,((64*1)+11),64)))
when ORIGIN_FUNCTION_SIGNATURE in ('0xded9382a','0x02751cec','0x5b0d5984') then (ethereum.public.udf_hex_to_int (substr(INPUT_DATA,((64*2)+11),64)))
when ORIGIN_FUNCTION_SIGNATURE in ('0xbaa2abde') then (ethereum.public.udf_hex_to_int (substr(INPUT_DATA,((64*4)+11),64)))
end as Second_token_Amount,
TX_FEE,
GAS_PRICE,
GAS_LIMIT,
STATUS
from aurora.core.fact_transactions
where to_address = lower('0x2CB45Edb4517d5947aFdE3BEAbF95A582506858B')
and ORIGIN_FUNCTION_SIGNATURE in ('0xe8e33700','0xf305d719','0x2195995c',
QueryRunArchived: QueryRun has been archived