Query editor
with latest_txs as (SELECTcollateral_token,debt_token,pool_address,transaction_hash,block_timeFROM (SELECTcollateral_token,debt_token,pool_address,transaction_hash,block_time,ROW_NUMBER() OVER (PARTITION BY pool_address, collateral_token, debt_token ORDER BY block_time DESC) AS rnFROM dune.vesu.result_vesu_v_2_metrics_log_data)WHERE rn = 1), update_context_events as (selectfrom_address as pool,keys[2] AS asset,keys[3] as debt_asset,varbinary_to_uint256(data[15]) AS last_rate_accumulator_collat,varbinary_to_uint256(data[37]) AS last_rate_accumulator_debt,transaction_hash,ROW_NUMBER() OVER (PARTITION BY from_address, keys[2], keys[3], transaction_hash ORDER BY block_time DESC) AS rnfrom starknet.eventswhere keys[1] = 0x00e623beb06d0cfbe7f7877cf06290a77c803ca8fde4b54a68b241607c7cc8ccand block_date >= date('2026-01-01') -- partition column, added 2026-09-09and block_time >= date('2026-01-01')and cardinality(keys) >= 3and cardinality(data) >= 37)select uc.pool, uc.asset, uc.debt_asset, uc.last_rate_accumulator_collat, uc.last_rate_accumulator_debt, uc.transaction_hashfrom update_context_events ucINNER JOIN latest_txs ltON uc.transaction_hash = lt.transaction_hashAND uc.pool = lt.pool_addressAND uc.asset = lt.collateral_tokenAND uc.debt_asset = lt.debt_tokenWHERE uc.rn = 1