hessTop Platforms
    Updated 2024-10-15
    with base as (select block_timestamp::date as day,
    tx_hash,
    receiver,
    source_chain_name,
    PLATFORM,
    a.token_address,
    name,
    amount_unadj,
    amount_unadj/pow(10,decimals) as amount_adj
    from aptos.defi.fact_bridge_activity a join aptos.core.dim_tokens b on a.token_address = b.token_address
    where direction = 'inbound'
    and DESTINATION_CHAIN_NAME = 'Aptos')
    ,
    users as ( select date(a.block_timestamp) as date,
    a.tx_hash,
    a.sender,
    case when b.PAYLOAD_FUNCTION = '0x7de3fea83cd5ca0e1def27c3f3803af619882db51f34abf30dd04ad12ee6af31::tapos::play' then 'Tapos'
    when b.PAYLOAD_FUNCTION ilike '%0x8d2d7bcde13b2513617df3f98cdd5d0e4b9f714c6308b9204fe18ad900d92609%' then 'Chingari' else event_address end as event
    from aptos.core.fact_transactions a join aptos.core.fact_events b on a.tx_hash = b.tx_hash
    where a.success = 'TRUE'
    and b.SUCCESS = 'TRUE'
    and a.tx_type = 'user_transaction'
    and b.tx_type = 'user_transaction')
    ,
    bridged as ( select date,
    a.tx_hash,
    sender,
    event
    from users a join base b on a.sender = b.receiver
    where a.date >= b.day
    and a.tx_hash != b.tx_hash)
    ,
    project as (select date,
    case when event = '0x17f1e926a81639e9557f4e4934df93452945ec30bc962e11351db59eb0d78c33' then 'amnis finance'
    when event = '0x5ae6789dd2fec1a9ec9cccfb3acaf12e93d432f0a3a42c92fe1a9d490b7bbc06' then 'merkle'
    when event = '0x17f1e926a81639e9557f4e4934df93452945ec30bc962e11351db59eb0d78c33' then 'VibrantX'
    QueryRunArchived: QueryRun has been archived