Query editor
select sum(profit) from(select a.amount+b.amount as total_predict_amount, a.amount as up_predict,b.amount as down_predict, a.roundid, b.roundid, c.amount as claim_amount ,c.amount-(a.amount+b.amount) as profitfrom(select topic0, sum(cast(bytearray_to_int256(data) as double)/1000000000000000000) as amount,bytearray_to_int256(topic2) as roundidfrom nexter_finance_arbitrum.ARBBalancerVault_call_performPrediction as arbp1join arbitrum.logs on call_tx_hash=tx_hashwhere arbp1.contract_address = from_hex('0x7e4bc90d84922a370a8040aee4637d787b2879c8')and topic0=from_hex('0x0bab430d5cfc26b856f9867d7019c5af92e6fb9f0eef60afadab9f0d53ff1fd3')group by topic0, bytearray_to_int256(topic2)) aJOIN(select topic0, sum(cast(bytearray_to_int256(data) as double)/1000000000000000000) as amount,bytearray_to_int256(topic2) as roundidfrom nexter_finance_arbitrum.ARBBalancerVault_call_performPrediction as arbp2join arbitrum.logs on call_tx_hash=tx_hashwhere arbp2.contract_address = from_hex('0x7e4bc90d84922a370a8040aee4637d787b2879c8')and topic0=from_hex('0x546f54506a25044de11c4fb0c44fbd0137d87d7e08dfd800944453931428a5ea')group by topic0, bytearray_to_int256(topic2)) bON a.roundid = b.roundidJOIN(select call_tx_hash, topic0, sum(cast(bytearray_to_int256(data) as double)/1000000000000000000) as amount,bytearray_to_int256(topic2) as roundidfrom nexter_finance_arbitrum.ARBBalancerVault_call_performPrediction as arbp2join arbitrum.logs on call_tx_hash=tx_hashwhere arbp2.contract_address = from_hex('0x7e4bc90d84922a370a8040aee4637d787b2879c8')and topic0=from_hex('0x34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf7')group by call_tx_hash, topic0, bytearray_to_int256(topic2)) cON c.roundid = b.roundidorder by a.roundid desc)