Afonso_Diazby platform
    Updated 6 days ago
    with

    main as (
    select
    distinct iff(direction = 'inbound', destination_address, source_address) as user
    from near.defi.ez_bridge_activity
    where platform = 'rainbow'
    and receipt_succeeded = 1
    and block_timestamp between '{{ start_date }}' and '{{ end_date }}'
    ),

    txns as (
    select
    tx_hash,
    block_timestamp,
    nft_address,
    platform_name,
    seller_address,
    buyer_address,
    price_usd
    from near.nft.ez_nft_sales
    where buyer_address in (select user from main)
    and block_timestamp >= '2024-01-01'
    )

    select
    platform_name,
    count(distinct tx_hash) as transactions,
    count(distinct buyer_address) as users,
    sum(price_usd) as volume_usd,
    avg(price_usd) as average_amount_usd,
    max(price_usd) as max_amount_usd
    from txns
    group by 1


    Last run: 6 days ago
    PLATFORM_NAME
    TRANSACTIONS
    USERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    MAX_AMOUNT_USD
    1
    Paras169432855154.29577799832.5586161621785.6
    2
    Mitte7448263110020.0331913649.4967659211118.951131198
    3
    Apollo42110.097560.097560.09756
    4
    FewAndFar2672628.9226526111.23471219131.972640195
    5
    TradePort102530839825.65033146538.854293006721.358999245
    6
    Mintbase6681369908.95204321114.833760544602.186294322
    6
    348B
    106s