Sbhn_NPTop 10 Destinations of Each Month After Bridging via Standard Bridge Over Time
    Updated 2022-10-23
    --credit : alik110
    with standardbridge as (
    select block_timestamp,
    tx_hash,
    origin_from_address,
    'ETH' as symbol,
    amount_usd
    from ethereum.core.ez_eth_transfers
    where eth_to_address = '0x99c9fc46f92e8a1c0dec1b1747d010903e884be1'
    union ALL
    select block_timestamp,
    tx_hash,
    origin_from_address,
    symbol,
    amount_usd
    from ethereum.core.ez_token_transfers
    where to_address = '0x99c9fc46f92e8a1c0dec1b1747d010903e884be1'),

    table1 as (
    select t1.block_timestamp,
    t1.tx_hash,
    t1.origin_from_address,
    t1.origin_to_address
    from optimism.core.fact_event_logs t1 join standardbridge t2 on t1.origin_from_address = t2.origin_from_address and t1.block_timestamp > t2.block_timestamp),

    table2 as (
    select date_trunc(month,block_timestamp) as date,
    origin_to_address,
    case when origin_to_address = '0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9' or origin_to_address = '0x9c12939390052919af3155f41bf4160fd3666a6f' then 'Velodrome Router'
    when origin_to_address = '0xc30141b657f4216252dc59af2e7cdb9d8792e1b0' then 'Socket Registry'
    when origin_to_address = '0x74a002d13f5f8af7f9a971f006b9a46c9b31dabd' then 'Rabbithole'
    when origin_to_address = '0x2e42f214467f647fe687fd9a2bf3baddfa737465' then 'Galxe SpaceStation'
    when origin_to_address = '0x1111111254760f7ab3f16433eea9304126dcd199' then '1Inch DEX Router'
    when origin_to_address = '0xdef1abe32c034e558cdd535791643c58a13acc10' then '0x DEX Proxy'
    when origin_to_address = '0x8add31bc901214a37f3bb676cb90ad62b24fd9a5' then 'Pika Protocol Position Manager'
    when origin_to_address = '0x2f05e799c61b600c65238a9df060caba63db8e78' then 'Galxe Stargator NFTs'
    Run a query to Download Data