CryptoIcicleSolana-103.Going Down The Wormhole - Ethereum User Actions
    Updated 2022-10-04
    -- Payout 3.621 SOL
    -- Grand Prize 10.86 SOL
    -- Payout Network Solana
    -- Level Advanced
    -- Difficulty Elite

    -- Q103. Create a dashboard that can refresh daily with metrics that provide a detailed picture of Wormhole activity
    -- both from Ethereum to Solana and from Solana to Ethereum.
    -- How are tokens being bridged from chain to chain and which actions seem to be popular among users of Wormhole?
    -- What actions seem to influence bridging behavior?
    -- What are users doing before and after bridging?
    -- Do users seem to think that bridging is safe or more risky relative to transfers to centralized exchanges?
    with erc20_txns as (
    select
    c.symbol,
    token_amount_raw/pow(10,c.decimals) as token_amount,
    t.*
    from (
    select
    regexp_substr_all(SUBSTR(input_data, len(origin_function_signature) + 1, len(input_data)), '.{64}') AS segmented_data,
    lower(concat('0x',ltrim((segmented_data[0]),'0'))) as token_address,
    ethereum.public.udf_hex_to_int(segmented_data[1]) as token_amount_raw,
    ethereum.public.udf_hex_to_int(segmented_data[2]) as chain_id,
    *
    from ethereum.core.fact_transactions
    where 1=1
    and to_address = lower('0x3ee18B2214AFF97000D974cf647E7C347E8fa585')
    and origin_function_signature = '0x0f5287b0' -- Transfer Tokens
    and chain_id = 1 -- Solana
    and block_timestamp >= CURRENT_DATE - {{n_days}}
    ) t
    join ethereum.core.dim_contracts c on t.token_address = c.address
    ),
    eth_txns as (
    Run a query to Download Data