Query editor
with eth_transfers_arbitrum as (selectsum(value /1e18) as value,sum(value /1e18 * price) as value_usdfrom arbitrum.traces tleft join query_3203428 b --all bucketson b.address = t."from" and b.network = 'arbitrum'join prices.usd_latest pon p.contract_address = 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeewhere to = 0x63464916388dab4f2e80551250335490c4518d37 and( "from" = 0x86890e30ce9e1e13db5560bbeb435c55567af1cd -- PositionManageror "from" = 0xbe3de856eb22bf6efa03dd55e65df22ba212e6db -- SwapManageror "from" = 0xC024DE24f34eEc431D41340DA5A18d67eE46BA79 -- SwapManager v2or "from" = 0xc08ffbba8c5f42beb7e6dd29142cc61855a3076b -- TraderBalanceVaultor b.address is not null) --buckets),eth_transfers_ethereum as (selectsum(value /1e18) as value,sum(value /1e18 * price) as value_usdfrom ethereum.traces tleft join query_3203428 b --all bucketson b.address = t."from" and b.network = 'ethereum'join prices.usd_latest pon p.contract_address = 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeewhere to = 0x893047ea492659418501e3b5868abe75468e2eb6 and( "from" = 0x99d63fea4b3ef6ca77941df3c5740dad1586f0b8 -- PositionManageror "from" = 0xa6d76535e265357187653d4aad9b362404d42ea8 -- SwapManageror "from" = 0xb980d7b0f4a05572de635e8916a222f05fc64552 -- SwapManager v2or "from" = 0x156e2fc8e1906507412beeeb6640bf999a1ea76b -- TraderBalanceVaultor b.address is not null) --buckets),pol_transfers_polygon as (selectsum(value /1e18) as value,sum(value /1e18 * price) as value_usdfrom polygon.traces tleft join query_3203428 b --all bucketson b.address = t."from" and b.network = 'polygon'join prices.usd_latest pon p.contract_address = 0x455e53cbb86018ac2b8092fdcd39d8444affc3f6 and p.symbol = 'POL'where to = 0x3c0d3f52e9aa1c9645a05452f45c064a0f9569bf and( "from" = 0x02bcaa4633e466d151b34112608f60a82a4f6035 -- PositionManageror "from" = 0x0aadc2eae6963ed983d85cbf088b0c294f4c26ff -- SwapManageror "from" = 0xa0069a14df3ecd19a38c509757ebc2c2aaa44992 -- SwapManager v2or "from" = 0x140d437ac247d8d8fc43534f8f4e6c555b257a9e -- SwapManager v3or "from" = 0x0801896c67cf024606bcc92bd788d6eb077cc74f -- TraderBalanceVaultor b.address is not null) --buckets),bucket_asset_transfers_ethereum as (selectsum(value /POW(10, pt.decimals)) as value,sum(value /POW(10, pt.decimals) * price) as value_usdfrom erc20_ethereum.evt_transfer tleft join query_3203428 b --all bucketson b.address = t."from" and b.borrowed_asset_address = t.contract_address and b.network = 'ethereum'left join query_4049840 pt