Avalanche AnalysisAvalanche Top 10k Summary Table
    Updated 2024-12-11
    WITH res AS (
    SELECT
    livequery.live.udf_api(
    'GET',
    'https://science.flipsidecrypto.xyz/googlesheets/readsheet',
    { 'Content-Type': 'application/json' },
    {
    'sheets_id' : '1ImKFBA5KOThPtAgc3Dc2aksZmHzS-QoJ80yHoWYePPs',
    'tab_name' : 'top_10K'
    }
    ) as result
    from DUAL
    ),
    top_10k as (
    select
    value:"address" as user_address,
    value:"chill_score" as chill_score,
    value:"flipside_score" as flipside_score,
    value:"overall_ratio_score" as overall_ratio_score
    from res,
    LATERAL FLATTEN(input => parse_json(result):data) t
    ),
    ranked_events AS (
    SELECT
    c.block_timestamp,
    c.tx_hash,
    c.event_index,
    c.contract_address,
    c.event_name,
    c.decoded_log,
    c.full_decoded_log,
    d.label_type,
    a.from_address,
    ROW_NUMBER() OVER (PARTITION BY c.tx_hash ORDER BY c.event_index ASC) as rn
    FROM avalanche.core.fact_decoded_event_logs c
    JOIN avalanche.core.fact_transactions a ON a.tx_hash = c.tx_hash
    QueryRunArchived: QueryRun has been archived