Sample Queries

Sample queries to use with Sort

Get latest transactions

select
  *
from
  ethereum.transaction
where
  to_address = '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'
order by
  block_id desc

Get latest contract logs/events

select
  event
from
  ethereum.transaction t,
  ethereum.transaction_log l
where
  t.id = l.transaction_id
  and t.to_address = '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'
order by
  t.block_id desc

Most popular contract functions

select
  function,
  count(*) as count
from
  ethereum.transaction t
where
  t.to = '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'
group by
  function
order by
  count desc

Latest indexed polygon block number

select block_number
from polygon.block
order by block_number desc
limit 1