RamaharCategory Analysis
    Updated 2025-02-20
    -- Web3 Gaming Event Categorization
    -- This SQL CASE statement categorizes different event types within a Web3 gaming ecosystem.
    -- The categorization is based on the event_name field, which represents various activities in the blockchain-based gaming environment.
    -- Each category is supported by observed transaction (`N_TXNS`) and user (`N_USERS`) data to justify its significance.

    With filtered_events as (select value:"EVENT_NAME" AS event_name
    FROM (
    SELECT
    livequery.live.udf_api('https://flipsidecrypto.xyz/api/v1/queries/a3eb6aac-7e30-4826-aa2a-155e95b897dd/data/latest') as response
    ), lateral FLATTEN (input => response:data))

    select
    CASE
    -- Gaming Activity
    WHEN a.event_name IN ('DailyLogDone', 'Fire', 'RaffleCheckin', 'DailyCheckin', 'StreakUpdated', 'BoughtEnergy', 'AxieEvolved', 'playedGacha', 'batchPlayedGacha') THEN 'Gaming Activity'
    -- Item Trading
    WHEN a.event_name IN ('Mint', 'Trade', 'Burn', 'Purchase', 'Sell', 'Swap', 'TokenCreated', 'Burned') THEN 'Item Trading'
    -- Token (Staking, Rewards)
    WHEN a.event_name IN ('Staking', 'Unstaking', 'RewardsClaimed', 'Claim', 'RewardClaimed', 'Farming', 'Liquidity Provision', 'CoreStaked', 'CoreUnstaked', 'Delegated', 'Staked', 'Unstaked') THEN 'Token (Staking, Rewards)'
    -- Asset Transfer
    WHEN a.event_name IN ('Transfer', 'Deposit', 'Withdraw', 'CCIPSendRequested', 'Withdrawal', 'SafeReceived') THEN 'Asset Transfer'
    -- Social & Guild Interactions
    WHEN a.event_name IN ('GuildJoin', 'GuildCreate', 'FriendRequest', 'LeaderboardUpdate',
    'ReferralUpdated', 'ReferralAdded', 'ReferralRemoved', 'ProfileAdded',
    'ProfileAddressChanged', 'VotedToBless', 'VotedToCurse', 'UnvotedToCurse') THEN 'Social & Guild Interactions'
    -- Quest & Battle Participation
    WHEN a.event_name IN ('BattleStart', 'BattleEnd', 'BattleJoined', 'BattleWon', 'BattleCanceled',
    'BattleNullified', 'BattleInitialized', 'CustomBetJoined', 'CustomPrizeTaken',
    'CustomBetCreated', 'CustomBetCancelled', 'CustomBetClosed', 'CustomBetRefunded',
    'HandleGameResult', 'QuestComplete', 'ArenaEnter') THEN 'Quest & Battle Participation'
    Last run: 28 days ago
    EVENT_CATEGORY
    N_USERS
    N_TXNS
    1
    Gaming Activity4764720114138261
    2
    Asset Transfer113691034838294
    3
    Other61012028496011
    4
    Item Trading5799659049329
    5
    Token (Staking, Rewards)3606673698355
    6
    Marketplace Activity1178023166782
    7
    Social & Guild Interactions55435837
    8
    Burn & Sync Mechanics39098103924
    8
    298B
    31s