Query editor
with DEPOSITED as (selectnodeOperatorId, MAX(depositedKeysCount) as "deposited"from lido_ethereum.csmodule_evt_depositedsigningkeyscountchangedgroup bynodeOperatorId), EXITED as (selectnodeOperatorId, MAX(exitedKeysCount) as "exited"from lido_ethereum.csmodule_evt_exitedsigningkeyscountchangedgroup bynodeOperatorId), ACTIVE as (selectDEPOSITED.nodeOperatorId, DEPOSITED.deposited - COALESCE(EXITED.exited, 0) as activefrom DEPOSITEDleft join EXITED on DEPOSITED.nodeOperatorId = EXITED.nodeOperatorId), ICS as (selectnodeOperatorIdfrom lido_ethereum.csaccounting_evt_bondcurvesetwhere curveId = 2), TOTAL_ACTIVE_ICS as (selectcount(ICS.nodeOperatorId) as totalfrom ICSinner join ACTIVE on ICS.nodeOperatorId = ACTIVE.nodeOperatorIdwhere ACTIVE.active > 0), IDVTC as (selectnodeOperatorIdfrom lido_ethereum.csaccounting_evt_bondcurvesetwhere curveId = 3), TOTAL_ACTIVE_IDVTC as (selectcount(IDVTC.nodeOperatorId) as totalfrom IDVTCinner join ACTIVE on IDVTC.nodeOperatorId = ACTIVE.nodeOperatorIdwhere ACTIVE.active > 0), TOTAL_ACTIVE_NOS as (selectcount(ACTIVE.active) as totalfrom ACTIVEwhere ACTIVE.active > 0), ICS_FEE_KEYS as (selectACTIVE.nodeOperatorId, LEAST(ACTIVE.active, 16) as ics_keysfrom ACTIVE