adriaparcerisasSunloan payments 3: all
    Updated 2024-01-30
    with
    eth_data as (
    select
    'ETH' as symbol,
    amount,
    amount_usd,
    block_timestamp,
    tx_hash
    from ethereum.core.ez_eth_transfers
    where origin_to_address = lower('0xEF0B56692F78A44CF4034b07F80204757c31Bcc9')
    and eth_from_address='0xef0b56692f78a44cf4034b07f80204757c31bcc9'

    UNION
    select
    symbol,
    amount,
    amount_usd,
    block_timestamp,
    tx_hash
    from ethereum.core.ez_token_transfers
    where origin_to_address = lower('0xEF0B56692F78A44CF4034b07F80204757c31Bcc9')
    and from_address = lower('0xEF0B56692F78A44CF4034b07F80204757c31Bcc9')
    ),
    eth as (
    SELECT
    count(distinct tx_hash) as "# of payments",
    sum(amount_usd) as "Volume amount (USD)"
    from eth_data where amount_usd is not NULL
    and amount<1e9
    and block_timestamp >=current_date-INTERVAL '{{number_of_months}} MONTHS'
    ),

    poly_data as (
    select
    'MATIC' as symbol,
    amount,
    Last run: about 1 year agoAuto-refreshes every 3 hours
    CHAIN
    # of payments
    Volume amount (USD)
    1
    Ethereum2647213032509.75
    2
    Polygon73721092303.3079779
    3
    Arbitrum924102846.32
    4
    Avalanche89245981.12
    5
    Optimism842246.01
    5
    143B
    181s