CryptoIcicleAurora -> NEAR
    Updated 2022-08-07
    -- Provide and explore key health metrics, as well as detailed data on at least 1 key project.

    -- Payout 17.123 NEAR
    -- Grand Prize 51.37 NEAR
    -- Payout Network Near
    -- Level Intermediate
    -- Difficulty Hard

    -- SQL Credit https://app.flipsidecrypto.com/velocity/queries/3625b5e6-ceea-4e93-8e48-28fc1897c370
    -- Dashbord: https://app.flipsidecrypto.com/dashboard/near-citizens-fQRyBU

    with bridge_from_aurora_to_near as (
    select
    BLOCK_TIMESTAMP::date as date,
    tx_hash,
    TX_RECEIPT[1]:outcome:executor_id as contract_in_near,
    case
    when contract_in_near = 'wrap.near' then 'NEAR'
    when contract_in_near = 'aurora' then '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -- WETH
    else concat('0x', substring(contract_in_near, 1, CHARINDEX('.', contract_in_near)-1))
    end as token_address,
    TX_RECEIPT[1]:outcome:logs[0] as log,
    substring(log, 1, CHARINDEX(' from aurora to ', log)) as first_part,
    regexp_replace(first_part, '[^0-9]', '') as asset_amount,
    substring(log, CHARINDEX('from aurora to ', log)+15, len(log)) as receiver
    from near.core.fact_transactions n_t
    --
    where tx_signer = 'relay.aurora'
    and tx_receiver = 'aurora'
    and (contract_in_near like '%.factory.bridge.near' -- ERC20-Assets
    or contract_in_near like 'aurora' -- ETH
    or contract_in_near like 'wrap.near' -- NEAR
    )
    and TX_RECEIPT[1]:outcome:logs[0] like 'Transfer % from aurora %'
    -- and receiver = 'mohammadhs.near'
    Run a query to Download Data