Query editor
with buy as (selectbuyer as address,-- token_id,min(block_time) as buy_time,sum(amount_usd) as buy_amountfrom nft.tradeswhere blockchain = 'polygon' and nft_contract_address = 0xa54999a6C1380164eccd4727f5E7a5bfe2470D44group by 1), sell as (selectseller as address,-- token_id,max(block_time) as sell_time,sum(amount_usd) as sell_amountfrom nft.tradeswhere blockchain = 'polygon' and nft_contract_address = 0xa54999a6C1380164eccd4727f5E7a5bfe2470D44group by 1)select * from (select b.address, sell_amount - buy_amount as profit, date(sell_time) - date(buy_time) as hodl_periodfrom buy bjoin sell s on b.address = s.address -- and b.token_id = s.token_id)order by profit desclimit 50