Query editor
withcreate_position_amount_sum as (selectsum(amount) as created_posfrompyth_solana.staking_call_createPosition),close_position_amount_sum as (selectsum(amount) as closed_posfrompyth_solana.staking_call_closePosition),total_pyth_staked AS (select(created_pos - closed_pos) / 1000000 as staked_pythfromcreate_position_amount_sumcross join close_position_amount_sum),latest_pyth_price AS (SELECTpriceFROMprices.usdWHEREsymbol = 'PYTH'ORDER BYminute DESCLIMIT1)SELECTp.staked_pyth,l.price,p.staked_pyth * l.price AS total_value_in_usdFROMtotal_pyth_staked pCROSS JOIN latest_pyth_price l