Can I use sqlite to read database of Counterparty directly?

Yes, with sqlite3 CLI.

Note that this bypasses some protocol checks, for example it does not ensure that the DB is up-to-date.


Select top 10 holders of all Counterparty-issued assets:

SELECT COUNT(*) AS address, asset FROM balances GROUP BY asset HAVING count(*) > 100

Select number of transactions of particular asset (XXXX) in the past week:

SELECT * FROM order_matches INNER JOIN blocks ON order_matches.block_index = blocks.block_index WHERE asset='XXXX' AND block_time > 'timestamp_7_days_ago'