Query editor
withmine as (select * from (values(0x0ca3178bb0e4a1fdb07a1af972a408db7de549ef),(0xa30d8420e6d58645f21f846c303bd6a0adcb1e37)) t(addr)),inch as (select avg(price) as p from prices.usd where blockchain='ethereum'and contract_address=0x111111111117dc0aa78b770fa6a738034120c302 and minute >= now() - interval '1' day),ethnative as (select avg(price) as p from prices.usd where blockchain='ethereum'and contract_address=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 and minute >= now() - interval '1' day),eth_sym_px as ( -- ethereum symbol->price, proxy for RH tokens with no local priceselect upper(e.symbol) as sym, avg(p.price) as pricefrom tokens.erc20 e join prices.usd p on p.blockchain='ethereum' and p.contract_address=e.contract_addresswhere e.blockchain='ethereum' and p.minute >= now() - interval '1' day group by 1),rh_tok as (select contract_address, max(symbol) as symbol, max(decimals) as decimals from tokens.erc20 where blockchain='robinhood' group by 1),rh_px as (select t.contract_address, coalesce(t.decimals,18) as decimals,case when upper(t.symbol)='1INCH' then (select p from inch)when upper(t.symbol) in ('USDG','USDC','USDT','DAI','USDS') then 1.0else esp.price end as pricefrom rh_tok t left join eth_sym_px esp on esp.sym = upper(t.symbol)),-- CAPITAL + POSITIONS from the multichain aquarouter table (chain='robinhood')snap as (select d from unnest(sequence(date '2026-08-17', current_date - interval '1' day, interval '1' day)) as t(d)),docks as (select strategyHash as sh, min(evt_block_time) as docked_atfrom oneinch_multichain.aquarouter_evt_docked where chain='robinhood' group by 1),flows as (select maker, strategyHash as sh, token, evt_block_time as ts, cast(amount as int256) as amtfrom oneinch_multichain.aquarouter_evt_pushed where chain='robinhood' and maker in (select addr from mine)union allselect maker, strategyHash, token, evt_block_time, -cast(amount as int256)from oneinch_multichain.aquarouter_evt_pulled where chain='robinhood' and maker in (select addr from mine)),bal as (select s.d, f.maker, f.sh, f.token, sum(f.amt) as bal_rawfrom snap s join flows f on f.ts < s.d + interval '1' dayleft join docks dk on dk.sh = f.shwhere dk.docked_at is null or dk.docked_at >= s.d + interval '1' daygroup by 1,2,3,4 having sum(f.amt) > 0),dedup as (select d, maker, token, max(bal_raw) as dedup_raw from bal group by 1,2,3),leg_usd as (select dd.d, dd.maker, cast(dd.dedup_raw as double)/power(10, coalesce(x.decimals,18)) * x.price as usdfrom dedup dd left join rh_px x on x.contract_address = dd.token),backed as (select maker, avg(backed_usd) as avg_capital_usd from (select d, maker, sum(usd) as backed_usd from leg_usd where usd is not null and usd < 10000000 group by 1,2) z group by 1),positions as (select maker, count(distinct sh) as positions from flows group by 1),-- VOLUME + INCENTIVE from raw-log Swapped (fills table is ethereum-only)erc as (select contract_address, max(symbol) as symbol from tokens.erc20 where blockchain='robinhood' group by 1),raw as (select block_time, bytearray_substring(data,45,20) as maker,bytearray_substring(data,109,20) as token_in, bytearray_substring(data,141,20) as token_out,cast(bytearray_to_uint256(bytearray_substring(data,161,32)) as double) as amount_in,cast(bytearray_to_uint256(bytearray_substring(data,193,32)) as double) as amount_outfrom robinhood.logswhere topic0 = 0x54bc5c027d15d7aa8ae083f994ab4411d2f223291672ecd3a344f3d92dcaf8b2and contract_address = 0x111111338c5091e8440b67b168bae16a668ac0deand block_time >= date '2026-08-17'),fc as (select r.maker, date(r.block_time) as day,(case when ti.symbol='1INCH' then r.amount_in/1e18 else r.amount_out/1e18 end)*(select p from inch) as usd,case when upper(case when ti.symbol='1INCH' then to2.symbol else ti.symbol end)in ('NVDA','TSLA','AAPL','SPY','META','AMZN') then 'RWA' else 'DeFi' end as categoryfrom raw r left join erc ti on ti.contract_address=r.token_in left join erc to2 on to2.contract_address=r.token_outwhere '1INCH' in (ti.symbol, to2.symbol)),