Query editor
WITH op AS (SELECT DISTINCT address FROM robinhood.creation_tracesWHERE "from" = 0xcfbd7e12a0f154a45576a73c1e409200068507b9),stock (t, s) AS (VALUES(0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec,'NVDA'),(0x4a0e65a3eccec6dbe60ae065f2e7bb85fae35eea,'SPCX'),(0x117cc2133c37b721f49de2a7a74833232b3b4c0c,'SPY'),(0x1b0e319c6a659f002271b69db8a7df2f911c153e,'GME'),(0xaf3d76f1834a1d425780943c99ea8a608f8a93f9,'AAPL'),(0x322f0929c4625ed5bad873c95208d54e1c003b2d,'TSLA'),(0x2e0847e8910a9732eb3fb1bb4b70a580adad4fe3,'GOOGL'),(0xe93237c50d904957cf27e7b1133b510c669c2e74,'MSFT')),flows AS (SELECT e.contract_address AS tok, e."to" AS h, CAST(e.value AS double) AS rawFROM erc20_robinhood.evt_transfer eJOIN stock st ON st.t = e.contract_addressJOIN op o ON o.address = e."to"UNION ALLSELECT e.contract_address, e."from", -CAST(e.value AS double)FROM erc20_robinhood.evt_transfer eJOIN stock st ON st.t = e.contract_addressJOIN op o ON o.address = e."from")SELECTto_hex(f.h) AS contract, st.s AS symbol,SUM(f.raw)/1e18 AS units,SUM(f.raw)/1e18 * p.price AS usd,COUNT(*) AS legsFROM flows fJOIN stock st ON st.t = f.tokLEFT JOIN prices.latest p ON p.blockchain='robinhood' AND p.contract_address = f.tokGROUP BY 1,2,p.priceHAVING SUM(f.raw) > 0ORDER BY usd DESCLIMIT 25