Query editor
with merge as (select call_tx_hash as "hash tx" ,(CASE WHEN "cTokenCollateral" = 0xc11b1268c1a384e55c48c2391d8d480264a3a7f4 then 'WBTC'WHEN "cTokenCollateral" = 0xb3319f5d18bc0d84dd1b4825dcde5d5f7266d407 then 'ZRX'WHEN "cTokenCollateral" = 0x35a18000230da775cac24873d00ff85bccded550 then 'UNI'WHEN "cTokenCollateral" = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643 then 'DAI'WHEN "cTokenCollateral" = 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5 then 'ETH'WHEN "cTokenCollateral" = 0x70e36f6bf80a52b3b46b3af8e106cc0ed743e8e4 then 'COMP'WHEN "cTokenCollateral" = 0x6c8c6b02e7b2be14d4fa6022dfd6d75921d90e4e then 'BAT'WHEN "cTokenCollateral" = 0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9 then 'USDT'WHEN "cTokenCollateral" = 0x39aa39c021dfbae8fac545936693ac917d5e7563 then 'USDC'END) as "Repaid",(CASE WHEN contract_address = 0xc11b1268c1a384e55c48c2391d8d480264a3a7f4 then 'WBTC'WHEN contract_address = 0xb3319f5d18bc0d84dd1b4825dcde5d5f7266d407 then 'ZRX'WHEN "contract_address" = 0x35a18000230da775cac24873d00ff85bccded550 then 'UNI'WHEN "contract_address" = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643 then 'DAI'WHEN "contract_address" = 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5 then 'ETH'WHEN "contract_address" = 0x70e36f6bf80a52b3b46b3af8e106cc0ed743e8e4 then 'COMP'WHEN "contract_address" = 0x6c8c6b02e7b2be14d4fa6022dfd6d75921d90e4e then 'BAT'WHEN "contract_address" = 0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9 then 'USDT'WHEN "contract_address" = 0x39aa39c021dfbae8fac545936693ac917d5e7563 then 'USDC'END) as "Liquidated",(CASE WHEN "contract_address" = 0xc11b1268c1a384e55c48c2391d8d480264a3a7f4 then "repayAmount"/10e7 * (SELECT price from prices.usd where symbol ='WBTC' order by minute desc limit 1)WHEN "contract_address" = 0xb3319f5d18bc0d84dd1b4825dcde5d5f7266d407 then "repayAmount"/10e17 * (SELECT price from prices.usd where symbol ='ZRX' order by minute desc limit 1)WHEN "contract_address" = 0x35a18000230da775cac24873d00ff85bccded550 then "repayAmount"/10e17 * (SELECT price from prices.usd where symbol ='UNI' order by minute desc limit 1)WHEN "contract_address" = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643 then "repayAmount"/10e17 * (SELECT price from prices.usd where symbol ='DAI' order by minute desc limit 1)WHEN "contract_address" = 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5 then "repayAmount"/10e11 * (SELECT price from prices.usd where symbol ='WETH' order by minute desc limit 1)WHEN "contract_address" = 0x70e36f6bf80a52b3b46b3af8e106cc0ed743e8e4 then "repayAmount"/10e17 * (SELECT price from prices.usd where symbol ='COMP' order by minute desc limit 1)WHEN "contract_address" = 0x6c8c6b02e7b2be14d4fa6022dfd6d75921d90e4e then "repayAmount"/10e17 * (SELECT price from prices.usd where symbol ='BAT' order by minute desc limit 1)WHEN "contract_address" = 0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9 then "repayAmount"/10e5 * (SELECT price from prices.usd where symbol ='USDT' order by minute desc limit 1)WHEN "contract_address" = 0x39aa39c021dfbae8fac545936693ac917d5e7563 then "repayAmount"/10e5 * (SELECT price from prices.usd where symbol ='USDC' order by minute desc limit 1)END) as "Amount ($)",gas_price/10e8 as "gas_price (gwei)",call_block_time,(CASE WHEN call_success = true then 'true' ELSE 'false' END) AS "success"from compound_v2_ethereum.cErc20_call_liquidateBorrow bJOIN ethereum.transactions t on b.call_tx_hash = t.hashUNIONselect call_tx_hash as "hash tx" ,(CASE WHEN "cTokenCollateral" = 0xc11b1268c1a384e55c48c2391d8d480264a3a7f4 then 'WBTC'WHEN "cTokenCollateral" = 0xb3319f5d18bc0d84dd1b4825dcde5d5f7266d407 then 'ZRX'WHEN "cTokenCollateral" = 0x35a18000230da775cac24873d00ff85bccded550 then 'UNI'WHEN "cTokenCollateral" = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643 then 'DAI'WHEN "cTokenCollateral" = 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5 then 'ETH'WHEN "cTokenCollateral" = 0x70e36f6bf80a52b3b46b3af8e106cc0ed743e8e4 then 'COMP'WHEN "cTokenCollateral" = 0x6c8c6b02e7b2be14d4fa6022dfd6d75921d90e4e then 'BAT'WHEN "cTokenCollateral" = 0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9 then 'USDT'WHEN "cTokenCollateral" = 0x39aa39c021dfbae8fac545936693ac917d5e7563 then 'USDC'END) as "Repaid",(CASE WHEN contract_address = 0xc11b1268c1a384e55c48c2391d8d480264a3a7f4 then 'WBTC'WHEN contract_address = 0xb3319f5d18bc0d84dd1b4825dcde5d5f7266d407 then 'ZRX'WHEN "contract_address" = 0x35a18000230da775cac24873d00ff85bccded550 then 'UNI'WHEN "contract_address" = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643 then 'DAI'WHEN "contract_address" = 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5 then 'ETH'WHEN "contract_address" = 0x70e36f6bf80a52b3b46b3af8e106cc0ed743e8e4 then 'COMP'