Sandeshxmetric distributed copy
    Updated 2023-02-16
    -- forked from 4db2e21d-dcfc-47da-8ce5-c4843eea4df3

    -- 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 amount_usd < 2000
    )
    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