Skip to content

Commit

Permalink
Update ICX transfers queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Spl3en committed Apr 25, 2019
1 parent 2e78386 commit 1ca85fc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
16 changes: 15 additions & 1 deletion sql/scripts/transactions_count_per_day.sql
Original file line number Diff line number Diff line change
@@ -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))
20 changes: 20 additions & 0 deletions sql/scripts/transactions_count_per_day_big_icx_transfer.sql
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit 1ca85fc

Please sign in to comment.