Query editor
/* ---------------------------------------------------------------------------Deepstate (deepstate.sh) — fill-level base tableChain : Robinhood Chain (id 4663)DeepstateV1: 0x6cf19308c22fc82ea620fa0b3e94948d20f27b96 (CLOB, live 2026-08-15 07:24 UTC)STATE vault: 0xbfb7b3ff3d498a559b946b836d26f0e168f273d5 (protocol fee sink)NVDA (18dp): 0xd0601ce157db5bdc3162bbac2a2c8af5320d9eecUSDG (6dp): 0x5fc5360d0400a0fd4f2af552add042d716f1d168VOLUME METHODThe protocol fee is exactly 10 bps of gross taker notional and is always paidin the token the taker RECEIVES, straight to the STATE vault. Verified onindividual fills: net/fee = 999.000 on both sides. Sogross notional = 1000 x protocol feeA taker SELL pays that fee in USDG -> notional is already in USDG.A taker BUY pays that fee in NVDA -> converted at the hour's median impliedprice, taken from the book's own USDG/NVDA leg ratio.Preferred over summing ERC-20 legs (resting and cancelling orders also movetokens through the book) and over the *SubtreeMatched events (they fire ononly ~2% of fills; single-order matches emit AskMatched/BidMatched, whichcarry no amounts).ARBITRAGE FLAGSet when the same transaction also swaps on another venue for the pair.Uniswap v2/v3/v4 are matched on their Swap topic0. EKUBO CANNOT BE: EkuboCore writes swaps as a topic-less log0 to save gas, so it is matched oncontract + `topic0 IS NULL` + the 116-byte record length instead. Ekubo Coreis mis-registered in Dune's decoding registry as uniswap_v4/PoolManager (oneof ~2,703 over-matched addresses on this chain), which is why no decodedekubo_v3_robinhood tables exist -- see spellbook PR #9925.--------------------------------------------------------------------------- */WITH sel AS (SELECTbytearray_substring(keccak(to_utf8('fillWithIntegratorFee((address,address,uint256,bytes32,bool,bool,bool),(address,uint16))')), 1, 4) AS fill_integrator,bytearray_substring(keccak(to_utf8('fillRouteWithIntegratorFee((address,address,uint256,bytes32,bool,bool,bool)[],(address,uint16))')), 1, 4) AS route_integrator),fill_tx AS (SELECTtx_hash,min(block_time) AS block_time,count(*) AS match_eventsFROM robinhood.logsWHERE block_date >= DATE '2026-08-15'AND contract_address = 0x6cf19308c22fc82ea620fa0b3e94948d20f27b96AND topic0 IN (0xf75162201654e78313e5b7d92f42188c6ef4e53683c3c1c848103550f68016d2, -- AskMatched0x45d797337480d9dbb22bbc1915cf652d85208c1f85e844ed969b7e79c555cf32, -- BidMatched0x3237fd582c53d9acd9c6fbe490e967407f8745c175e4c0d213b752e22d272e90, -- AsksMatched0xde1d135207c8e2baca24cdffe2803ba09113bf4032d1906ad27e9c3736f229d7 -- BidsMatched)GROUP BY 1),xfer AS ( -- NVDA / USDG ERC-20 transfers inside fill transactionsSELECTl.tx_hash,l.contract_address AS token,bytearray_substring(l.topic1, 13, 20) AS src,bytearray_substring(l.topic2, 13, 20) AS dst,