Sandeshxmetric distributed
    Updated 2023-02-16
    -- amount_usd -> amount itself

    with xmetrics_out AS

    (
    select
    block_timestamp,
    tx_hash,
    raw_amount/pow(10,18) as amount_usd,
    from_address,
    to_address
    from
    polygon.core.fact_token_transfers
    where contract_address=lower('0x15848C9672e99be386807b9101f83A16EB017bb5')
    and to_address!='0x4b8923746a1d9943bbd408f477572762801efe4d'
    and from_address='0x0000000000000000000000000000000000000000'
    -- and origin_from_address='0xa727c953ffe3e461573736fde77d20cfdce9fca3'
    )
    select
    sum(amount_usd) as amount_disbursed,
    count(distinct to_address) as number_of_users_paid,
    amount_disbursed/number_of_users_paid as avg_amount_per_user
    from xmetrics_out
    Run a query to Download Data