Query editor
withcontracts as (SELECT * FROM query_2118328 -- Elephant Money Contracts-- SELECT * FROM query_1909117 -- Elephant Money Contracts),prep as (selectrow_number() over (partition by tokenId order by evt_block_time desc) as seqnum,evt_block_time,wallet,tokenId,bnbAmount,bnbAmountInUSDfrom ((selectevt_block_time,buyer as wallet,tokenId,casewhen evt_block_time > timestamp '2023-08-18 07:28:41' then 1.8 --8-18-23 was the last mint of round 1. anything sold on marketplace would immediatly bump up to 2 BNB right after that.else .9end bnbAmount,casewhen evt_block_time > timestamp '2023-08-18 07:28:41' then 1.8 * (SELECT price FROM prices.usd where blockchain = 'ethereum' and symbol = 'BNB' and date_trunc('minute', minute) = date_trunc('minute', evt_block_time ))else .9 * (SELECT price FROM prices.usd where blockchain = 'ethereum' and symbol = 'BNB' and date_trunc('minute', minute) = date_trunc('minute', evt_block_time ))end bnbAmountInUSDfrom elephant_bnb.ElephantMarketPlace_evt_Purchasedwhere evt_block_number >= 29685039)UNION ALL(selectevt_block_time,to as wallet,tokenId,casewhen tokenid > 10000 then 2when tokenid > 0 then 1end bnbAmount,casewhen tokenid > 10000 then 2*(SELECT price FROM prices.usd where blockchain = 'ethereum' and symbol = 'BNB' and date_trunc('minute', minute) = date_trunc('minute', evt_block_time ))when tokenid > 0 then 1*(SELECT price FROM prices.usd where blockchain = 'ethereum' and symbol = 'BNB' and date_trunc('minute', minute) = date_trunc('minute', evt_block_time ))end bnbAmountInUSDfrom elephant_bnb.ElephantMoneyUnlimitedNFT_evt_Transferwhere evt_block_number >= 29685039and NOT contains((select address from contracts where name = 'ElephantNFTStaking'), "from")and NOT contains((select address from contracts where name = 'ElephantNFTStaking'), to)and NOT contains((select address from contracts where name = 'NFTMarketplace'), to)and NOT contains((select address from contracts where name = 'NFTMarketplace'), "from"))))selectrow_number() over (order by RS desc) as nr,wallet