adambaladoodles137
    Updated 2023-04-13
    with buytable1 as (
    select buyer_address, tx_hash, tokenid, price_usd,price
    FROM ethereum.core.ez_nft_sales
    WHERE EVENT_TYPE = 'sale' and CURRENCY_SYMBOL = 'ETH'
    and lower(NFT_ADDRESS)=lower('0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e')
    and price_usd > 0 and price > 0),

    selltable1 as (
    select seller_address, tx_hash, tokenid, price_usd,price
    FROM ethereum.core.ez_nft_sales
    WHERE EVENT_TYPE = 'sale' and CURRENCY_SYMBOL = 'ETH'
    and lower(NFT_ADDRESS)=lower('0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e')
    and price_usd > 0 and price > 0)

    select SUBSTR(buyer_address , 0,3)||'...'||SUBSTR(buyer_address , 39,4) as "name",
    sum (t2.price - t1.price) as "value"
    from buytable1 t1 join selltable1 t2 on buyer_address = seller_address and t1.tokenid = t2.tokenid
    group by 1
    limit 10
    Run a query to Download Data