Query editor
with cached_tx as(select block_time,bytearray_to_uint256(topic1) as pid,bytearray_to_uint256(bytearray_substring(data, 1, 32)) as lastRewardTimestamp,bytearray_to_uint256(bytearray_substring(data, 33, 32)) as supply,bytearray_to_uint256(bytearray_substring(data, 65, 32)) as accPerSharefrom ethereum.logs where topic0= 0xc75b283f14d0a806c63b93a3659ed39c43a20bf0fff8030465e93d79e91ca40fand contract_address=0xeca9d81a4dc7119a40481cff4e7e24dd0aaf56bdorder by block_time),adj_cached_tx as (SELECTal.block_time,al.pid,al.lastRewardTimestamp,al.supply,al.accPerShare,ROW_NUMBER() OVER (PARTITION BY al.pid ORDER BY al.block_time DESC) AS rnkFROMcached_tx al),pid_list as (select *from adj_cached_txwhere rnk=1),timeSpan as (selectbytearray_to_uint256(bytearray_substring(data, 1, 32)) as primeAmount,bytearray_to_uint256(bytearray_substring(data, 33, 32)) as startTimestamp,bytearray_to_uint256(bytearray_substring(data, 65, 32)) as endTimestampfrom ethereum.logswhere topic0=0x72bb6e826d1a04bd8fa5fdde85546e3b9eb8e95d8500eec20f4c0124edcb422band contract_address=0xeca9d81a4dc7119a40481cff4e7e24dd0aaf56bdorder by block_time desclimit 1),alloc_list as (selectblock_time,bytearray_to_uint256(topic1) as pid,bytearray_to_uint256(bytearray_substring(data, 1, 32)) asAllocPoint,bytearray_to_uint256(bytearray_substring(data, 33, 32)) as totalAllocPointfrom ethereum.logswhere topic0=0xc12a6201c487829aaa17c8698145154b8fb8c84945e43430f08a08b385ffa8e3and "tx_to"=0xECa9D81a4dC7119A40481CFF4e7E24DD0aaF56bDorder by 1 desc),adj_alloc_list AS (SELECTal.block_time,al.pid,al.asAllocPoint,ql.Parasets,ROW_NUMBER() OVER (PARTITION BY al.pid ORDER BY al.block_time DESC) AS rnkFROMalloc_list alLEFT JOIN