Collection Details
Namespace:
fashaking
Dataset:
Collection:
geter
Owner:
0x68142886f78aac2a5340ca5096ecbd002f8c31af
Transaction:
Timestamp:
Nov.22.2023 11:21:03 AM
Status:
OnChain
Collection Documents
_id | shiqw | View |
---|---|---|
0ca3cc84338e841affb9b828e3b147400541c2cfbb48dfb4a82cab974c4d2be95 | 3535 | View |
0ca3cc84338e841affb9b828e3b147400541c2cfbb48dfb4a82cab974c4d2be94 | vbd | View |
0ca3cc84338e841affb9b828e3b147400541c2cfbb48dfb4a82cab974c4d2be93 | df | View |
0ca3cc84338e841affb9b828e3b147400541c2cfbb48dfb4a82cab974c4d2be91 | --Error: Query is too long for wand tools.
--Try shortening query to try again.
--Error: Query is too long for wand tools.
--Try shortening query to try again.
-- select *
-- from query_2465489
-- order by rank_id
-- limit 10000
with user_summary as (
select user_address,
count(*) as transaction_count,
min(block_time) as initial_block_time,
max(block_time) as last_block_time,
date_diff('day', min(block_time), now()) as lz_age_days,
count(distinct source_chain_id) as active_source_chain_count,
count(distinct destination_chain_id) as active_destination_chain_count,
count(distinct transaction_contract) as active_transaction_contract_count,
count(distinct date_trunc('day', block_time)) as active_days_count,
count(distinct date_trunc('week', block_time)) as active_weeks_count,
count(distinct date_trunc('month', block_time)) as active_months_count,
-- coalesce(sum(amount_usd / power(10, p.decimals) * p.price), 0) as amount_usd
coalesce(sum(amount_usd), 0) as amount_usd
from layerzero.send
group by 1
),
user_summary_with_rank as (
select *,
(
active_source_chain_count -- Count of used source chains
+ if(active_destination_chain_count >= 2, 1, 0) -- Conducted transactions to 2 destination chains
+ if(active_destination_chain_count >= 5, 1, 0) -- Conducted transactions to 5 destination chains
+ if(active_destination_chain_count >= 10, 1, 0) -- Conducted transactions to 10 destination chains
+ if(active_months_count >= 2, 1, 0) -- Conducted transactions during 2 distinct months
+ if(active_months_count >= 6 , 1, 0) -- Conducted transactions during 6 distinct months
+ if(active_months_count >= 9, 1, 0) -- Conducted transactions during 9 distinct months
+ if(active_months_count >= 12, 1, 0) -- Conducted transactions during 12 distinct months
+ if(active_weeks_count >= 10, 1, 0) -- Conducted transactions during 10 distinct weeks
+ if(active_weeks_count >= 20, 1, 0) -- Conducted transactions during 20 distinct weeks
+ if(active_weeks_count >= 50, 1, 0) -- Conducted transactions during 50 distinct weeks
+ if(active_weeks_count >= 100, 1, 0) -- Conducted transactions during 100 distinct weeks
+ if(active_days_count >= 50, 1, 0) -- Conducted transactions during 50 distinct days
+ if(active_days_count >= 100, 1, 0) -- Conducted transactions during 100 distinct days
+ if(active_days_count >= 200, 1, 0) -- Conducted transactions during 200 distinct days
+ if(active_days_count >= 500, 1, 0) -- Conducted transactions during 500 distinct days
+ if(lz_age_days >= 100, 1, 0) -- Started using Layer Zero before 100 days
+ if(lz_age_days >= 200, 1, 0) -- Started using Layer Zero before 200 days
+ if(lz_age_days >= 500, 1, 0) -- Started using Layer Zero before 500 days
+ if(transaction_count >= 5, 1, 0) -- Conducted more than 5 transactions
+ if(transaction_count >= 10, 1, 0) -- Conducted more than 10 transactions
+ if(transaction_count >= 25, 1, 0) -- Conducted more than 25 transactions
+ if(transaction_count >= 50, 1, 0) -- Conducted more than 50 transactions
+ if(transaction_count >= 100, 1, 0) -- Conducted more than 100 transactions
+ if(active_transaction_contract_count >= 5, 1, 0) -- Interacted more than 5 contracts on source chain
+ if(active_transaction_contract_count >= 10, 1, 0) -- Interacted more than 10 contracts on source chain
+ if(active_transaction_contract_count >= 25, 1, 0) -- Interacted more than 25 contracts on source chain
+ if(active_transaction_contract_count >= 50, 1, 0) -- Interacted more than 100 contracts on source chain
+ if(active_transaction_contract_count >= 100, 1, 0) -- Interacted more than 100 contracts on source chain
+ if(amount_usd > 0, 1, 0) -- Bridged funds through Layer Zero
+ if(amount_usd > 1000, 1, 0) -- Bridged more than $1,000 of assets through Layer Zero
+ if(amount_usd > 10000, 1, 0) -- Bridged more than $10,000 of assets through Layer Zero
+ if(amount_usd > 50000, 1, 0) -- Bridged more than $50,000 of assets through Layer Zero
+ if(amount_usd > 250000, 1, 0) -- Bridged more than $250,000 of assets through Layer Zero
+ if(amount_usd > 500000, 1, 0) -- Bridged more than $500,000 of assets through Layer Zero
+ if(amount_usd > 1000000, 1, 0) -- Bridged more than $1,000,000 of assets through Layer Zero
) as rank_score
from user_summary
),
missing_source_chains AS (
SELECT
user_address,
ARRAY_AGG(DISTINCT missing_source_chain_name) AS source_chains_missing,
COUNT(DISTINCT missing_source_chain_name) AS No_of_chains_missing
FROM
(
SELECT
s1.user_address,
s2.source_chain_name AS missing_source_chain_name
FROM
(
SELECT DISTINCT
user_address
FROM
layerzero.send
) AS s1
CROSS JOIN (
SELECT DISTINCT
source_chain_name
FROM
layerzero.send
WHERE
source_chain_name IS NOT NULL
) AS s2
LEFT JOIN
layerzero.send AS s3 ON s1.user_address = s3.user_address
AND s2.source_chain_name = s3.source_chain_name
WHERE
s3.source_chain_name IS NULL
) AS subquery
GROUP BY
user_address
)
SELECT
row_number() OVER (ORDER BY rank_score DESC, amount_usd DESC, transaction_count DESC) AS rk,
user_summary_with_rank.user_address AS ua,
missing_source_chains.source_chains_missing,
missing_source_chains.No_of_chains_missing
FROM
user_summary_with_rank
JOIN missing_source_chains ON user_summary_with_rank.user_address = missing_source_chains.user_address
ORDER BY
rank_score DESC,
amount_usd DESC,
transaction_count DESC
LIMIT 890000 | View |