From 70eff434c6941764bd6cb5dc8b51cf9d665bb3c0 Mon Sep 17 00:00:00 2001 From: s-n-park <146785798+s-n-park@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:53:36 -0700 Subject: [PATCH] Update big-query.md (#1815) Clarify bigquery example for unique accounts --- docs/bos/queryapi/big-query.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/bos/queryapi/big-query.md b/docs/bos/queryapi/big-query.md index 8422e9b9166..78b379111cf 100644 --- a/docs/bos/queryapi/big-query.md +++ b/docs/bos/queryapi/big-query.md @@ -32,12 +32,13 @@ The [NEAR Public Lakehouse repository](https://github.com/near/near-public-lakeh ### Example Queries -- _How many unique users do I have for my smart contract per day?_ +- _How many unique signers and accounts have interacted with my smart contract per day?_ ```sql SELECT ra.block_date collected_for_day, - COUNT(DISTINCT t.signer_account_id) as total + COUNT(DISTINCT t.signer_account_id) as total_signers, + COUNT(DISTINCT ra.receipt_predecessor_account_id) as total_accounts FROM `bigquery-public-data.crypto_near_mainnet_us.receipt_actions` ra JOIN `bigquery-public-data.crypto_near_mainnet_us.receipt_origin_transaction` ro ON ro.receipt_id = ra.receipt_id JOIN `bigquery-public-data.crypto_near_mainnet_us.transactions` t ON ro.originated_from_transaction_hash = t.transaction_hash