SELECT block_timestamp,
case when to_address = lower('0x3ea91f461abaa7bdb59aa667ef4778ae1102e67b') then raw_amount/1e6
when from_address = lower('0x3ea91f461abaa7bdb59aa667ef4778ae1102e67b') then -raw_amount/1e6
end as net_flow
from arbitrum.core.fact_token_transfers
where (to_address = lower('0x3ea91f461abaa7bdb59aa667ef4778ae1102e67b')
or from_address = lower('0x3ea91f461abaa7bdb59aa667ef4778ae1102e67b'))
and contract_address = lower('0xB85C6FBF780eB913dC34aA0B6F74D1e6A15c356f')
order by block_timestamp desc