freemartianAptos Core - [bridge] all bridge activity
Updated 2023-12-07
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
›
⌄
-- SELECT split(payload_function, '::')[2] from aptos.core.fact_transactions
-- GROUP BY 1
select
block_timestamp,
tx_hash
, version
, split(payload_function, '::')[2] ::string as function
, case
when function = 'send_coin_from' then 'send'
else 'receive'
end as action
, payload :type_arguments[0] ::string as token_address
, dim_tokens.symbol
, case
when function = 'lz_receive'
then livequery.utils.udf_hex_to_int(right(payload :arguments[2], 16))
when function = 'send_coin_from'
then payload :arguments[2]
when function = 'claim_coin'
then ifnull(events[0] :data :amount, events[1] :data :amount)
else 0
end / pow(10, zeroifnull(dim_tokens.decimals)) as amount
, amount * price as amount_usd
, case
when function = 'lz_receive'
then concat('0x', substr(payload :arguments[2], 69, 64))
when function = 'send_coin_from'
then sender
when function = 'claim_coin'
then sender
else '0x00'
end as user_address
, 'LayerZero' as label_bridge
Run a query to Download Data