Query editor
WITHcapacity_query AS (SELECTcall_block_time,DATE_TRUNC ('week', call_block_time) AS formatted_date,_from,_to,CAST(_value AS INT256) / 1e18 AS balance,_partition,call_tx_hash,output_0,_data,contract_address,CASEWHEN output_0 = 0xcccccccc2862b8cb21caedb8706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Gemini'WHEN output_0 = 0xccccccccd6bbe6bf0c2471ba706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'SPEDN'WHEN output_0 = 0xcccccccc7a0208a97d8ac263706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Lightning'WHEN output_0 = 0xcccccccc01ef57163c6d4d34706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Polygon'WHEN output_0 = 0xcccccccc9e74da6b6cf54fc8706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Bitcoin'WHEN output_0 = 0xcccccccc5504c217e344479d706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Tezos'WHEN output_0 = 0xccccccccac3507679b14453a706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Celo'WHEN output_0 = 0xcccccccc186b8f18e6ee4b42706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Litecoin'WHEN output_0 = 0xcccccccc327b7f0c08214931706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Ethereum'WHEN output_0 = 0xcccccccc3110fc85041345c2706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Bitcoin Cash'WHEN output_0 = 0xcccccccc17e127f74077433c706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Cardano'WHEN output_0 = 0xcccccccc81dbde757c384900706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Dogecoin'WHEN output_0 = 0xcccccccc22315143f82c475f706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Solana'WHEN output_0 = 0xcccccccc5eb25f6982e04b21706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Zcash'WHEN output_0 = 0xcccccccc807d297dbf73441c706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Zashi'WHEN output_0 = 0xcccccccca4560ce3f67c4c16706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Nighthawk'WHEN output_0 = 0xcccccccc3ff751f2e7c64f16706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Base'END AS "pool"FROMamp_ethereum.Amp_call_transferByPartitionWHEREcall_success = trueAND _to = 0x706d7f8b3445d8dfc790c524e3990ef014e7c578 /*staking to capacity from wallet*/AND _from <> 0x706d7f8b3445d8dfc790c524e3990ef014e7c578UNION ALLSELECTcall_block_time,DATE_TRUNC ('week', call_block_time) AS formatted_date,_from,_to,- (CAST(_value AS INT256) / 1e18) AS balance,_partition,call_tx_hash,output_0,_data,contract_address,CASEWHEN _partition = 0xcccccccc2862b8cb21caedb8706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Gemini'WHEN _partition = 0xccccccccd6bbe6bf0c2471ba706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'SPEDN'WHEN _partition = 0xcccccccc7a0208a97d8ac263706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Lightning'WHEN _partition = 0xcccccccc01ef57163c6d4d34706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Polygon'WHEN _partition = 0xcccccccc9e74da6b6cf54fc8706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Bitcoin'WHEN _partition = 0xcccccccc5504c217e344479d706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Tezos'WHEN _partition = 0xccccccccac3507679b14453a706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Celo'WHEN _partition = 0xcccccccc186b8f18e6ee4b42706d7f8b3445d8dfc790c524e3990ef014e7c578 THEN 'Litecoin'