Query editor
with iv_trans as (select to as address,evt_block_time as block_time,value/power(10,6) as amount,evt_tx_hash as tx_hashfrom erc20_ethereum.evt_Transfer awhere contract_address = 0xd9b2cb2fbad204fc548787ef56b918c845fcce40 -- Pre-iUSDTand evt_block_date >= date '2025-10-01'union allselect "from" as address,evt_block_time as block_time,-value/power(10,6) as amount,evt_tx_hash as tx_hashfrom erc20_ethereum.evt_Transfer awhere contract_address = 0xd9b2cb2fbad204fc548787ef56b918c845fcce40 -- Pre-iUSDTand evt_block_date >= date '2025-10-01'),iv_angel_usdc as (select to as address,evt_block_time as block_time,value/power(10,6) as amount,evt_tx_hash as tx_hashfrom erc20_ethereum.evt_Transfer awhere contract_address = 0xfb48aAf5c2D5F1722C6A7910115811e7C094C9B3 -- Pre-iUSDTand "from" = 0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae -- Angle Protocol: Distributorand evt_block_date >= date '2025-10-01'),holder_iusdt as (select address,sum(amount) as amountfrom iv_trans awhere address <> 0x0000000000000000000000000000000000000000group by 1),holder_angelusdt as (select address,sum(amount) as amountfrom iv_angel_usdc awhere address <> 0x0000000000000000000000000000000000000000group by 1)select a.*,b.amount as angel_amount,a.amount - b.amount as actual,sum(a.amount - b.amount) over () as tot_actual,500000000 - sum(a.amount - b.amount) over () as reminderfrom holder_iusdt aleft join holder_angelusdt b on b.address = a.addressorder by 2 desc