Query editor
with bb as (select block_time, id, signer,-- explode(pre_token_balances), -- , '45ruCyfdRkWpRNGEqWzjCiXRHkZs8WXCLQ67Pnpye7Hp'),-- explode(post_token_balances) --, '45ruCyfdRkWpRNGEqWzjCiXRHkZs8WXCLQ67Pnpye7Hp')-- balance_after - balance_before as balance_change,-- t1.address1 as address, -- the wallet's account for this token-- t1.token1 as token, -- fee token-- t1.owner1 as owner --address, token, balance_before-- t1.*, t2.*from solana.transactionscross join unnest(pre_token_balances) as t1 (address, token, owner, balance_before)where block_time > now() - interval '30' day-- and id in ('2u2v23NuGue2GjAccTVQuMBL64fGoim8gkycbgTcFUwxne7WYPYqguDb4bvQF2GPUYNuZTRsNstD69rxULaoTkvb',-- '4CDpmJTvSGCwzGV6xRFam8KrboGc8ePm4ofTECdXtJtAEy5Qxa5wuL3BKUWFz3xvY4Ryy7eMcceqKyNpt2w4hyFD',-- '2Xy4g7RHc34wdzdgwPmzRjek35LPDUGoVNXd16PQcuDkjCt3Hi8JVxEhQb71sjPAp9ZwqNSWnTUC6f1fjQxoMPbQ')-- = 'qFSEExze6tUKsfjds8H8tmq5JQrqQfR3KtyGMrnDcuNriJVPB4mqp5ntyYcimZ87uFUxS6csQQ4XYQkSSb4tAab'and owner = '45ruCyfdRkWpRNGEqWzjCiXRHkZs8WXCLQ67Pnpye7Hp' -- jupyter platform fee 0.85% for phantomand error is null), ba as (select block_time, id, signer,-- explode(pre_token_balances), -- , '45ruCyfdRkWpRNGEqWzjCiXRHkZs8WXCLQ67Pnpye7Hp'),-- explode(post_token_balances) --, '45ruCyfdRkWpRNGEqWzjCiXRHkZs8WXCLQ67Pnpye7Hp')-- balance_after - balance_before as balance_change,-- t1.address1 as address, -- the wallet's account for this token-- t1.token1 as token, -- fee token-- t1.owner1 as owner --address, token, balance_after-- t1.*, t2.*from solana.transactionscross join unnest(post_token_balances) as t1 (address, token, owner, balance_after)where block_time > now() - interval '30' day-- and id in ('2u2v23NuGue2GjAccTVQuMBL64fGoim8gkycbgTcFUwxne7WYPYqguDb4bvQF2GPUYNuZTRsNstD69rxULaoTkvb',-- '4CDpmJTvSGCwzGV6xRFam8KrboGc8ePm4ofTECdXtJtAEy5Qxa5wuL3BKUWFz3xvY4Ryy7eMcceqKyNpt2w4hyFD',-- '2Xy4g7RHc34wdzdgwPmzRjek35LPDUGoVNXd16PQcuDkjCt3Hi8JVxEhQb71sjPAp9ZwqNSWnTUC6f1fjQxoMPbQ')-- = 'qFSEExze6tUKsfjds8H8tmq5JQrqQfR3KtyGMrnDcuNriJVPB4mqp5ntyYcimZ87uFUxS6csQQ4XYQkSSb4tAab'and owner = '45ruCyfdRkWpRNGEqWzjCiXRHkZs8WXCLQ67Pnpye7Hp' -- jupyter platform fee 0.85% for phantomand error is null), fees as (select bb.block_time,bb.id,bb.signer,bb.address,bb.token,balance_after - balance_before as balance_changefrom bbjoin ba on bb.id = ba.id and bb.token = ba.token and bb.address = ba.addresswhere balance_after >= balance_before -- filter out the refer4 -- https://solscan.io/tx/4vLZJcorFdEQaaK9QV7Mq7GGpVpibkCr4RvSAQjvACKS4AVn49kBNmRxcBmx3vzsxi6JEGyvaC79nhnprXcBgTHg), price_hour as (select hour, token, avg(token_price) as pricefrom (select date_trunc('hour', block_time) as hour,token_bought_mint_address as token,amount_usd / token_bought_amount as token_pricefrom dex_solana.tradeswhere block_time > now() - interval '30' dayand token_bought_mint_address in (select distinct token from fees)and amount_usd > 0and token_bought_amount > 0-- and tx_id in ('2u2v23NuGue2GjAccTVQuMBL64fGoim8gkycbgTcFUwxne7WYPYqguDb4bvQF2GPUYNuZTRsNstD69rxULaoTkvb',