PlaywoIBC Transaction Breakdown
    Updated 2023-08-26
    WITH timeframe AS (
    SELECT date_day AS date
    FROM crosschain.core.dim_dates
    WHERE date_day >= CURRENT_DATE - 14 AND date_day <= CURRENT_DATE
    ),
    single_action_txs AS (
    SELECT tx_id, max(attribute_value) AS action
    FROM evmos.core.fact_msg_attributes
    WHERE msg_type = 'message'
    AND attribute_key = 'action'
    GROUP BY tx_id
    HAVING count(*) = 1
    ),
    single_action_types AS (
    SELECT $1 AS type, $2 AS category
    FROM (VALUES
    ('/cosmos.gov.v1beta1.MsgVote', 'Governance Votes'),
    ('/cosmos.gov.v1.MsgVote', 'Governance Votes'),
    ('/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', 'Staking'),
    ('/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation', 'Staking'),
    ('/cosmos.staking.v1beta1.MsgBeginRedelegate', 'Staking'),
    ('/cosmos.staking.v1beta1.MsgUndelegate', 'Staking'),
    ('/ethermint.evm.v1.MsgEthereumTx', 'EVM Transaction'),
    ('/cosmos.staking.v1beta1.MsgDelegate', 'Staking'),
    ('/cosmos.bank.v1beta1.MsgSend', 'Transfers'),
    ('/ibc.core.client.v1.MsgUpdateClient', 'IBC Relaying'),
    ('/ibc.core.channel.v1.MsgAcknowledgement', 'IBC Relaying'),
    ('/ibc.core.channel.v1.MsgRecvPacket', 'IBC Relaying'),
    ('/ibc.applications.transfer.v1.MsgTransfer', 'IBC Transfers'),
    ('/evmos.erc20.v1.MsgConvertERC20', 'Internal Bridge'),
    ('/cosmos.authz.v1beta1.MsgGrant', 'AuthZ'),
    ('/cosmos.authz.v1beta1.MsgRevoke', 'AuthZ')
    )
    ),
    tx_categories AS (
    SELECT tx_id, max(category) AS category
    Run a query to Download Data