adambalaTop 10 UnProfitable Tokens With Most Lost USD for trader..
    Updated 2023-04-13
    with buytable1 as (
    select (BLOCK_TIMESTAMP) AS MINT_DATE ,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 (BLOCK_TIMESTAMP) AS DATE ,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
    T2.price_usd || ' - '||T1.price_usd || ' = ' as "Sale PRICE - bought PRICE (USD)" ,
    --sum (t2.price_usd - t1.price_usd) as USD_Profit
    sum (t2.price_usd - t1.price_usd) as ETH_Profit ,t1.tokenid ,
    'https://www.nftscan.com/' || BUYER_address as trader,
    'https://www.nftscan.com/0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e/' ||t1.tokenid as "token id"
    from buytable1 t1 join selltable1 t2 on BUYER_address = seller_address and t1.tokenid = t2.tokenid
    WHERE MINT_date < DATE
    group by 1,3,4,5
    order by 2 Asc
    limit 10

    Run a query to Download Data