CryptoIcicleHop-2.Bridge Volume (Hop Protocol) - Hop Bridges
    Updated 2022-06-20
    -- Payout 75 USDC
    -- Grand Prize 225 USDC
    -- Level Intermediate

    -- Q2. How much volume has Hop bridged to Polygon, Optimism, and Arbitrum compared to those protocols’ native bridges?
    -- What is Hop’s total TVL?
    -- Create an analysis on the Hop’s TVL and how it’s changed over a time period of your choosing.

    with txns as (
    SELECT
    tx_hash as chain_tx,
    F.Value:decoded:inputs:chainId as chain_id,
    case when chain_id = '137' then 'polygon'
    when chain_id = '10' then 'optimism'
    when chain_id = '100' then 'gnosis'
    when chain_id = '42161' then 'arbitrum' end as chain_destination
    from ethereum.core.fact_transactions,
    table(flatten(input => tx_json:receipt:logs)) f
    WHERE to_address IN ('0x3d4cc8a61c7528fd86c55cfe061a78dcba48edd1', -- HOP DAI
    '0x3666f603cc164936c1b87e207f36beba4ac5f18a', -- HOP USDC
    '0x3e4a3a4796d16c0cd582c382691998f7c06420b6', -- HOP USDT
    '0x22b1cbb8d98a01a3b71d034bb899775a76eb1cc2', -- HOP MATIC
    '0xb8901acb165ed027e32754e0ffe830802919727f') -- HOP ETH
    AND chain_id is not null
    ),
    transfer as (
    (
    select
    chain_destination as type,
    block_timestamp,
    tx_hash,
    amount_usd
    from ethereum.core.ez_eth_transfers t join txns t2 on t.tx_hash = t2.chain_tx
    ) union
    (
    select
    Run a query to Download Data