Sandeshnekodex swaps
Updated 2024-08-23
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 trades_decodes_table as (
with optimism_trades as (
select
tx_hash,
block_timestamp,
regexp_substr_all(SUBSTR(input, 11), '.{64}') AS segmented,
concat('0x', substr(segmented [4], -40)) as user,
utils.udf_hex_to_int(substr(segmented [6], -40)) as from_chainID,
utils.udf_hex_to_int(substr(segmented [18], -40)) as to_chainID,
concat('0x', substr(segmented [12], -40)) as from_token,
concat('0x', substr(segmented [13], -40)) as from_token_value,
utils.udf_hex_to_int(from_token_value) as from_token_value_int,
concat('0x', substr(segmented [14], -40)) as to_token,
concat('0x', substr(segmented [15], -40)) as to_token_value,
utils.udf_hex_to_int(to_token_value) as to_token_value_int
from
optimism.core.fact_traces
where
1 = 1
and block_number >= '121593991' -- jun 19 2024
and identifier = 'CALL_ORIGIN'
and to_address = '0x6cca65f0bc3140019a81a1619aa75a6925c2601e'
and TX_STATUS = 'SUCCESS'
),
ethereum_trades as (
select
tx_hash,
block_timestamp,
regexp_substr_all(SUBSTR(input, 11), '.{64}') AS segmented,
concat('0x', substr(segmented [4], -40)) as user,
utils.udf_hex_to_int(substr(segmented [6], -40)) as from_chainID,
utils.udf_hex_to_int(substr(segmented [18], -40)) as to_chainID,
concat('0x', substr(segmented [12], -40)) as from_token,
concat('0x', substr(segmented [13], -40)) as from_token_value,
utils.udf_hex_to_int(from_token_value) as from_token_value_int,
concat('0x', substr(segmented [14], -40)) as to_token,
QueryRunArchived: QueryRun has been archived