diff --git a/sql/scripts/transactions_count_per_day.sql b/sql/scripts/transactions_count_per_day.sql index 63f66a9..e1997c7 100644 --- a/sql/scripts/transactions_count_per_day.sql +++ b/sql/scripts/transactions_count_per_day.sql @@ -1,6 +1,20 @@ SELECT DATE(FROM_UNIXTIME(block.timestamp DIV 1000000)), - COUNT(DISTINCT id) totalCount + COUNT(DISTINCT all_transactions.txid) + COUNT(DISTINCT all_transactions.itxid) FROM iconation.block +LEFT JOIN + ( + SELECT + transaction.id as txid, + internal_transaction.id as itxid, + transaction.block as blockid + FROM + transaction + LEFT JOIN + internal_transaction + ON + internal_transaction.transaction = iconation.transaction.id + ) as all_transactions + ON all_transactions.blockid = iconation.block.id GROUP BY DATE(FROM_UNIXTIME(block.timestamp DIV 1000000)) \ No newline at end of file diff --git a/sql/scripts/transactions_count_per_day_big_icx_transfer.sql b/sql/scripts/transactions_count_per_day_big_icx_transfer.sql new file mode 100644 index 0000000..0a64b7d --- /dev/null +++ b/sql/scripts/transactions_count_per_day_big_icx_transfer.sql @@ -0,0 +1,20 @@ +SELECT + DATE(FROM_UNIXTIME(block.timestamp DIV 1000000)), + COUNT(DISTINCT all_transactions.txid) + COUNT(DISTINCT all_transactions.itxid) +FROM + iconation.block + LEFT JOIN + (SELECT + transaction.id AS txid, + internal_transaction.id AS itxid, + internal_transaction.amount AS itxamount, + transaction.amount AS txamount, + transaction.block AS blockid + FROM + transaction + LEFT JOIN internal_transaction ON internal_transaction.transaction = iconation.transaction.id + AND internal_transaction.token_type = 0) AS all_transactions ON all_transactions.blockid = iconation.block.id + WHERE + -- Filter > 1000 ICX Transfers + all_transactions.itxamount > 1000000000000000000000 or all_transactions.txamount > 1000000000000000000000 +GROUP BY DATE(FROM_UNIXTIME(block.timestamp DIV 1000000)) \ No newline at end of file