kasadeghTop First Destinations
Updated 2022-07-31
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 bridged_transaction_info as (
select
block_timestamp, block_id, tx_id, 'mint' as type, to_address as wallet_address, to_address,to_address_name, to_label, contract_address, symbol , amount , amount_usd
from flipside_prod_db.polygon.udm_events
where
origin_address = '0x0000000000000000000000000000000000000000' and from_address = '0x0000000000000000000000000000000000000000'
and event_type = 'erc20_transfer'
and event_id is not null
and amount > 0 and amount is not null
and symbol is not null
and tx_id !='0x883d6feefe71a23ec3114c960f3d22fb18f91948a968880cc78cc17d378a2078'
)
, transfers_transactions as (
select
block_timestamp, block_id, tx_id, 'transfer' as type, from_address as wallet_address, to_address, to_address_name, to_label, contract_address, symbol, amount, amount_usd
from flipside_prod_db.polygon.udm_events
where from_address in (select wallet_address from bridged_transaction_info)
and event_id is not null
and symbol is not null
)
, All_transactions as (
select * from bridged_transaction_info union ALL SELECT * from transfers_transactions
)
, bridged_transactions_with_next_tranasctions as (
select
*
, lead(contract_address, 1) over (partition by wallet_address order by block_id) as next_contract_address
, lead(symbol, 1) over (partition by wallet_address order by block_id) as next_symbol
, lead(amount, 1) over (partition by wallet_address order by block_id) as next_amount
, lead(amount_usd, 1) over (partition by wallet_address order by block_id) as next_amount_usd
, lead(to_address, 1) over (partition by wallet_address order by block_id) as next_to_address
, lead(to_address_name, 1) over (partition by wallet_address order by block_id) as next_to_address_name
Run a query to Download Data