0xHaM-dIn Total by Platform
    Updated 6 days ago
    -- forked from Ronin Bridge data @ https://flipsidecrypto.xyz/Sandesh/q/s0t77Lcxz60S/ronin-bridge-stats

    WITH eth_to_ronin_native as (
    select
    'ethereum'::VARCHAR as blockchain
    , 'axie infinity: ronin bridge v2'::VARCHAR as platform
    , edl.block_number::INT as block_number
    , edl.block_timestamp::TIMESTAMP as block_timestamp
    , edl.tx_hash::VARCHAR as tx_hash
    , 'ethereum'::VARCHAR as source_chain
    , 'ronin'::VARCHAR as destination_chain
    , edl.origin_to_address::VARCHAR as bridge_address
    , edl.origin_from_address::VARCHAR as source_address
    , edl.decoded_log['receipt']['ronin']['addr']::VARCHAR as destination_address
    , 'inbound'::VARCHAR as direction
    , edl.decoded_log['receipt']['mainchain']['tokenAddr']::VARCHAR as token_address
    , coalesce(pr.symbol,dc.symbol)::VARCHAR as token_symbol
    , edl.decoded_log['receipt']['info']['quantity']::DOUBLE as amount_unadj
    , (edl.decoded_log['receipt']['info']['quantity']/pow(10,pr.decimals))::DOUBLE as amount
    , (edl.decoded_log['receipt']['info']['quantity']/pow(10,pr.decimals))*pr.price::DOUBLE as amount_usd
    , current_timestamp() as inserted_timestamp
    , current_timestamp() as modified_timestamp
    -- , row_number() over (order by edl.block_timestamp asc, edl.tx_hash asc) as ez_bridge_activity_id
    from ethereum.core.ez_decoded_event_logs edl
    left join crosschain.price.ez_prices_hourly pr
    on (date_trunc('hour',edl.block_timestamp)=pr.hour and edl.decoded_log['receipt']['mainchain']['tokenAddr']=pr.token_address)
    left join ethereum.core.dim_contracts dc
    on (edl.decoded_log['receipt']['mainchain']['tokenAddr']=dc.address)
    where 1=1
    and edl.block_timestamp >= '2025-01-01'
    and edl.topics[0]=lower('0xd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b')
    and pr.blockchain='ethereum'
    )
    , ronin_to_ethereum_native_bridge as
    (
    with bridge_data as
    Last run: 6 days ago
    PLATFORM
    NUMBER_OF_BRIDGE_TRANSACTIONS
    NUMBER_OF_BRIDGERS
    TOTAL_VOLUME
    1
    chainlink1082475350914.525580062
    2
    axie infinity: ronin bridge v299875203126230601.967967
    2
    103B
    177s