Query editor
WITH price AS (SELECT price, w1_changeFROM (SELECT day, price, (price / LAG(price, 7) OVER (ORDER BY day) - 1) * 100 AS w1_changeFROM query_3239637) aWHERE day = DATE(NOW())),supply AS (SELECT total_supplyFROM query_3199137WHERE day = DATE(NOW())),tps AS (SELECT SUM(successful_transactions) / 86400 AS tpsFROM solana.blocksWHERE time >= NOW() - INTERVAL '24' HOUR),staked AS (SELECT staked_ratio, stakedFROM dune."21co".result_solana_stakingWHERE day = (SELECT MAX(day) FROM dune."21co".result_solana_staking)),validators AS (SELECTCOUNT(DISTINCT account_keys[2]) AS validatorsFROM solana.vote_transactionsWHERE block_time >= NOW() - INTERVAL '24' HOURAND error IS NULL),non_staked AS (SELECTtotal_supply - staked AS non_staked_amount,(total_supply - staked) / total_supply AS non_staked_ratioFROM staked, supply)SELECTprice.price,price.w1_change,supply.total_supply / 1000000 AS total_supply_m,supply.total_supply * price.price / 1000000000 AS fdv_b,tps.tps,staked.staked / 1000000 AS staked,staked.staked_ratio * 100 AS staking_ratio_percent,validators.validators-- You can add the following lines if you decide to include non-staked amounts in the final output:-- , non_staked.non_staked_amount / 1000000 AS non_staked_m,-- non_staked.non_staked_ratio * 100 AS non_staked_ratio_percentFROM supply, price, tps, staked, validators-- If you include non-staked in the final output, add non_staked to the FROM clause as well:-- , non_staked