Query editor
with locked_table as (SELECT in_counts.contract_address, in_counts.total_in - COALESCE(out_counts.total_out, 0) as lockedFROM (SELECT contract_address, COUNT(token_id) as total_inFROM nft.transfersWHERE (to = 0xDCFDf445676420b1b381AF0B4211fdbBf5d66c78 or to = 0x2604B9deF76F9Cbdc3Df0acdf4Cb45723b0E76e0)AND block_date >= timestamp '2024-01-02 00:00'AND blockchain = 'arbitrum'GROUP BY contract_address) as in_countsLEFT JOIN (SELECT contract_address, COUNT(token_id) as total_outFROM nft.transfersWHERE ("from" = 0xDCFDf445676420b1b381AF0B4211fdbBf5d66c78 or "from" = 0x2604B9deF76F9Cbdc3Df0acdf4Cb45723b0E76e0)AND block_date >= timestamp '2024-01-02 00:00'AND blockchain = 'arbitrum'GROUP BY contract_address) as out_countsON in_counts.contract_address = out_counts.contract_address)select sum(locked_table.locked) from locked_table