Query editor
WITHmarkets AS (SELECT*FROMquery_4086047),arbitrumOpenInterestIncrements AS (SELECTevt_block_time AS block_time,'Arbitrum' AS blockchain,'Increase' AS type,id,IF(isLong, 'Long', 'Short') AS direction,amount,evt_tx_hash AS tx_hashFROMunidex_v4_arbitrum.SettingsManager_evt_IncreaseOpenInterest),arbitrumOpenInterestDecrements AS (SELECTevt_block_time AS block_time,'Arbitrum' AS blockchain,'Decrease' AS type,id,IF(isLong, 'Long', 'Short') AS direction,amount,evt_tx_hash AS tx_hashFROMunidex_v4_arbitrum.SettingsManager_evt_DecreaseOpenInterest),allOpenInterestChanges AS (SELECT * FROM arbitrumOpenInterestIncrementsUNION ALLSELECT * FROM arbitrumOpenInterestDecrements)SELECTblock_time,blockchain,type,direction,market,marketType,id,(amount / 1e30) * IF(type = 'Increase', 1, -1) AS amount,tx_hashFROMallOpenInterestChangesLEFT JOIN markets ON id = marketIdORDER BYblock_time DESC