mamad-5XN3k3Your Wallet Rank (L0 Aptos Bridge)
    Updated 2025-01-14
    with pricet as (
    select
    hour::date as p_date,
    symbol,
    avg(price) as usd_price
    from crosschain.price.ez_prices_hourly
    where blockchain = 'ethereum'
    group by 1 ,2
    )

    select *
    from(
    select
    distinct user,
    sum(amount_usd) as "Total USD Volume",
    count(distinct tx) as "Total TXs",
    rank() over(order by "Total USD Volume" desc) as "Volume Rank",
    rank() over(order by "Total TXs" desc) as "TX Rank"
    from(
    select
    distinct receiver as user,
    tx_hash as tx,
    (amount_unadj/pow(10, decimals))*usd_price as amount_usd
    from aptos.defi.fact_bridge_activity a
    join aptos.core.dim_tokens b using(token_address)
    join pricet c on block_timestamp::date = p_date::date and lower(b.symbol) = lower(c.symbol)
    where platform = 'layerzero'
    --and block_timestamp::date >= '2024-01-01'
    and receiver != sender

    UNION

    select
    distinct sender as user,
    tx_hash as tx,
    (amount_unadj/pow(10, decimals))*usd_price as amount_usd
    Last run: about 2 months ago
    USER
    Total USD Volume
    Total TXs
    Volume Rank
    TX Rank
    1
    0xf39b6604cc1274bcc93e651f333c0bb0aadfdff7ae65d17deb155db2399c008b345.5215460291464194360658
    1
    102B
    25s