MoDeFipolygon Bridger Destinations 2
    Updated 2022-08-01
    with bridges as (
    select BLOCK_TIMESTAMP, EVENT_INPUTS:to as address, EVENT_INPUTS:shares as raw_amount, raw_amount/1e18 as amount, tx_hash, CONTRACT_ADDRESS, ADDRESS_NAME
    from polygon.core.fact_event_logs a
    left join polygon.core.dim_labels b
    on b.ADDRESS=a.CONTRACT_ADDRESS
    where EVENT_NAME='Deposit' and ORIGIN_FUNCTION_SIGNATURE='0x'
    and ORIGIN_FROM_ADDRESS='0x0000000000000000000000000000000000000000'
    and raw_amount is not null
    and tx_hash='0x6c8a716faf7d524f3b28b48ce757db60856c5d9a809f8c8b0d9f1ce6846b9234'
    union all
    select distinct BLOCK_TIMESTAMP, EVENT_INPUTS:to as address, EVENT_INPUTS:value as raw_amount,
    case
    when ADDRESS_NAME ilike 'hop protocol: usd%' then raw_amount/1e6
    when ADDRESS_NAME ilike '%wbtc%' then raw_amount/1e8
    when CONTRACT_ADDRESS= '0x726e4838241609207e05d8d306d76b5e1679e576' then raw_amount/1e6
    else raw_amount/1e18
    end as amount
    ,tx_hash, CONTRACT_ADDRESS,
    case
    when ADDRESS_NAME ilike 'hop protocol: eth%' then 'ETH'
    when ADDRESS_NAME ilike 'hop protocol: usdt%' then 'USDT'
    when ADDRESS_NAME ilike 'hop protocol: usdc%' then 'USDC'
    when ADDRESS_NAME ilike 'hop protocol: wbtc%' then 'WBTC'
    when ADDRESS_NAME ilike 'hop protocol: dai%' then 'DAI'
    when ADDRESS_NAME ilike 'hop protocol: matic%' then 'MATIC'
    when CONTRACT_ADDRESS= '0xbbba073c31bf03b8acf7c28ef0738decf3695683' then 'SAND'
    when CONTRACT_ADDRESS= '0x726e4838241609207e05d8d306d76b5e1679e576' then 'VETRO'
    when CONTRACT_ADDRESS= '0xf972ec38ce03266a835606ff768362fd5e94574b' then 'REDDIES'
    when CONTRACT_ADDRESS= '0x57194feaca970a4e98a19c365fe144fb54f657db' then 'UFO'
    when CONTRACT_ADDRESS= '0xadac33f543267c4d59a8c299cf804c303bc3e4ac' then 'MIMO'
    when CONTRACT_ADDRESS= '0x9ff62d1fc52a907b6dcba8077c2ddca6e6a9d3e1' then 'FORT'
    when CONTRACT_ADDRESS= '0xa1c57f48f0deb89f569dfbe6e2b7f46d33606fd4' then 'MANA'
    when CONTRACT_ADDRESS= '0x37876b9828e3b8413cd8d736672dd1c27cde8220' then 'SKY'
    when CONTRACT_ADDRESS= '0xac2a6706285b91143eaded25d946ff17a60a6512' then 'GACXP'
    Run a query to Download Data