charliemarketplacetop 10 in categories defi
    Updated 1 hour ago
    -- forked from top 10 in categories dapp excludes wallets @ https://flipsidecrypto.xyz/studio/queries/dec43f74-25e7-4f63-bfbb-8bc8c2f2cf26
    -- forked from top 10 in categories gaming @ https://flipsidecrypto.xyz/studio/queries/76d996f7-8b65-41de-b608-bad269a9160a

    with near_projects as (
    select ADDRESS,
    initcap(PROJECT_NAME) as PROJECT_NAME,
    initcap(LABEL_TYPE) as LABEL_TYPE
    from near.core.dim_address_labels
    -- where LABEL_TYPE in ('dapp', 'games', 'defi', 'bridge', 'nft')
    where LABEL_TYPE in ('defi')
    and PROJECT_NAME is not null
    ),

    projects_events as (
    select
    BLOCK_TIMESTAMP,
    TX_HASH,
    SIGNER_ID,
    RECEIVER_ID,
    PROJECT_NAME,
    ADDRESS,
    LABEL_TYPE,
    DEPOSIT/1e24 as Volume
    from near.core.fact_actions_events_function_call
    inner join near_projects
    on RECEIVER_ID=ADDRESS
    where RECEIPT_SUCCEEDED=true
    and block_timestamp >= '2024-11-01'
    ),

    monthly_metrics as (
    select
    date_trunc('month', block_timestamp) as month_ordering,
    INITCAP(TO_VARCHAR(date_trunc('month', block_timestamp), 'mon. yyyy')) as month_,
    project_name,
    label_type as project_category,
    Last run: about 1 hour agoAuto-refreshes every 12 hours
    MONTH_ORDERING
    MONTH_
    PROJECT_CATEGORY
    PROJECT_NAME
    CATEGORY_RANK
    # Tx
    # Unique Signers
    Direct $NEAR Volume (if applicable)
    1
    2025-02-01 00:00:00.000Feb. 2025DefiRef Finance1325946745152596
    2
    2025-02-01 00:00:00.000Feb. 2025DefiUsdc29373372041762
    3
    2025-02-01 00:00:00.000Feb. 2025DefiProximity359354374530
    4
    2025-02-01 00:00:00.000Feb. 2025DefiMeteor44024611443190895
    5
    2025-02-01 00:00:00.000Feb. 2025DefiBlackdragon51061821251746
    6
    2025-02-01 00:00:00.000Feb. 2025DefiDd69738911082
    7
    2025-02-01 00:00:00.000Feb. 2025DefiBurrow7833179598304
    8
    2025-02-01 00:00:00.000Feb. 2025DefiLonk8741149362
    9
    2025-02-01 00:00:00.000Feb. 2025DefiSpin97256270
    10
    2025-02-01 00:00:00.000Feb. 2025DefiKat10713047533
    10
    727B
    19s