adambalaTop 10 UnProfitable Tokens With Most Lost ETH for trader
    Updated 2022-12-09
    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('0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d')
    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('0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d')
    and price_usd > 0 and price > 0 )

    select
    'https://www.nftscan.com/' || BUYER_address as trader,
    'https://www.nftscan.com/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/' ||t1.tokenid as "token id",
    T2.price || ' - '||T1.price || ' = ' as "Sale PRICE - bought PRICE (ETH)" ,
    --sum (t2.price_usd - t1.price_usd) as USD_Profit
    sum (t2.price - t1.price) as ETH_Profit
    from buytable1 t1 join selltable1 t2 on BUYER_address = seller_address and t1.tokenid = t2.tokenid
    WHERE MINT_date < DATE
    group by 1,2,3
    order by 4 ASC
    limit 10

    Run a query to Download Data