Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-2024-08-06· OpenAIAi2 WildChat-4.8M (AI2)

Given an input question, first create a syntactically correct snowflake query to run.…

  1. User

    Given an input question, first create a syntactically correct snowflake query to run. Never query for all the columns from a specific table, only ask for a few relevant columns given the question.

    Pay attention to use only the column names that you can see in the schema description. Be careful to not query for columns that do not exist. Pay attention to which column is in which table. Also, qualify column names with the table name when needed. You are required to use the following format, each taking one line:

    Question: Question here SQLQuery: SQL Query to run Only use tables listed below.

        Table desc str: Table 'blocks' has columns: block_number (DECIMAL(38, 0)): 'ID number of the block on the chain.', timestamp (DECIMAL(38, 0)): 'Raw value of the time in Unix Epoch time (in UTC time zone), which is then converted to DATETIME column.', datetime (TIMESTAMP_NTZ): 'Timestamp of the transaction in UTC.', block_hash (VARCHAR(16777216)): 'The hash of a specific block in the blockchain.', block_parent_hash (VARCHAR(16777216)): 'The hash of the parent block of a specific block.', nonce (DECIMAL(38, 0)): 'Confirms the legitimacy of a block; proof of work mechanism.', sha3_uncles (VARCHAR(16777216)): 'Hash of the concatenated series of uncle headers.', logs_bloom (VARCHAR(16777216)): 'A filter that summarizes the event logs of the transactions included in a block.', transactions_root (VARCHAR(16777216)): 'Hash that represents the Merkle Patricia tree root of all the transactions included in a block.', state_root (VARCHAR(16777216)): 'Root hash of the Merkle Patricia tree that stores the current state of the block. Verifies the accuracy of the state of the block.', receipts_root (VARCHAR(16777216)): 'Hash of the state tree. Verifies the accuracy of the transactions within the block.', miner (VARCHAR(16777216)): 'Participant in the network who performs the process of mining.', mix_hash (VARCHAR(16777216)): 'Hash value used in the Proof-of-Work (PoW) algorithm to determine the validity of a mined block.', extra_data (VARCHAR(16777216)): 'Variable-length byte array that allows for additional arbitrary data to be included in the block.', difficulty (DECIMAL(38, 0)): 'Numerical value that represents the level of difficulty for mining a new block in the network.', total_difficulty (DECIMAL(38, 0)): 'Cumulative measure of the difficulty of all blocks in the blockchain up to a specific block.', size (DECIMAL(38, 0)): 'The size of the bytecode of a contract or the size of a transaction.', gas_limit (DECIMAL(38, 0)): 'The maximum amount of computational resources, or gas, that a block can consume during its execution.', gas_used (DECIMAL(38, 0)): 'The amount of computational resources, or gas, consumed during the execution of a transaction or a contract.', transaction_count (DECIMAL(38, 0)): 'Total number of transactions included in a block on the blockchain.', base_fee_per_gas (DECIMAL(38, 0)): 'The base fee per unit of gas in the block, which is dynamically adjusted based on network congestion to regulate transaction processing costs.', is_reorg (BOOLEAN), date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (Stores essential information about the blocks in a blockchain.) .
    Table 'transactions' has columns: block_number (DECIMAL(38, 0)): 'ID number of the block on the chain.', datetime (TIMESTAMP_NTZ): 'Timestamp of the transaction in UTC.', timestamp (DECIMAL(38, 0)): 'Raw value of the time in Unix Epoch time (in UTC time zone), which is then converted to DATETIME column.', transaction_hash (VARCHAR(16777216)): 'The hexadecimal value of the transaction address.', transaction_index (DECIMAL(38, 0)): 'The position or order of a transaction within a block of the blockchain.', nonce (DECIMAL(38, 0)): 'Confirmation of the legitimacy of the block; confirms that a miner has done Proof of Work on that block.', block_hash (VARCHAR(16777216)): 'The hash of a specific block in the blockchain.', from_address (VARCHAR(16777216)): 'The address of the wallet where the asset is being sent from.', to_address (VARCHAR(16777216)): 'The address of the wallet the asset is being sent to.', value (FLOAT): 'The curated quantity of the token.', usd_value (FLOAT): 'The curated value equivalent of the transaction in USD.', price (FLOAT): 'The price of a single token in a specified currency.', transaction_fee (FLOAT): 'The fee paid by the sender to process and include the token transaction on the blockchain.', usd_transaction_fee (FLOAT): 'The equivalent value of the transaction fee in USD based on a specific exchange rate or pricing source.', gas_price (FLOAT): 'The gas price specified by the sender, indicating the amount of the native token paid per unit of gas to execute the transaction.', gas_price_gwei (FLOAT): 'The gas price expressed in Gwei, a commonly used unit for measuring gas prices on the chain.', effective_gas_price (FLOAT): 'The actual price or rate at which a transaction is executed, taking into account any adjustments or modifications made to the original gas price specified by the transaction sender.', effective_gas_price_gwei (FLOAT): 'The actual price or rate at which a transaction is executed in gwei, taking into account any adjustments or modifications made to the original gas price specified by the transaction sender.', max_fee_per_gas (FLOAT): 'The maximum fee per unit of gas that the sender is willing to pay for the transaction.', max_fee_per_gas_gwei (FLOAT): 'The maximum fee per unit of gas expressed in Gwei.', max_priority_fee_per_gas (FLOAT): 'The maximum priority fee per unit of gas, which is a component of the transaction fee that is used to incentivize miners.', max_priority_fee_per_gas_gwei (FLOAT): 'The maximum priority fee per unit of gas expressed in Gwei.', gas_limit (DECIMAL(38, 0)): 'The maximum amount of gas allocated for the execution of the transaction.', gas_used (DECIMAL(38, 0)): 'The actual amount of gas consumed by the transaction during execution.', gas_used_pct (DECIMAL(38, 6)): 'The percentage of gas used compared to the gas limit.', cumulative_gas_used (DECIMAL(38, 0)): 'The total amount of gas consumed by the transaction and all preceding transactions within the same block.', input (VARCHAR(16777216)): 'The input data or payload associated with the token transaction, which can include additional instructions or parameters for contract execution.', transaction_type (DECIMAL(38, 0)): 'The type or category of the token transaction, such as a transfer, approval, or contract interaction.', contract_address (VARCHAR(16777216)): 'The address of the token contract with which the transaction is interacting.', status (DECIMAL(38, 0)): 'The execution status of the token transaction.', source_value (FLOAT): 'The raw quantity of the token with the native denomination.', source_gas_price (DECIMAL(38, 0)): 'The original gas price specified by the sender before any modification.', source_effective_gas_price (DECIMAL(38, 0)): 'The effective gas price calculated or adjusted based on network conditions or pricing mechanisms.', source_max_fee_per_gas (DECIMAL(38, 0)): 'The original maximum fee per unit of gas specified by the sender before any modification.', source_max_priority_fee_per_gas (DECIMAL(38, 0)): 'The original maximum priority fee per unit of gas specified by the sender before any modification.', date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (Stores information about individual transactions within the network.) .
    Table 'priced_net_transfers' has columns: block_number (DECIMAL(38, 0)): 'ID number of the block on the chain.', timestamp (DECIMAL(38, 0)): 'Raw value of the time in Unix Epoch time (in UTC time zone), which is then converted to DATETIME column.', datetime (TIMESTAMP_NTZ): 'Timestamp of the transaction in UTC.', transaction_hash (VARCHAR(16777216)): 'The hexadecimal value of the transaction address.', log_index (DECIMAL(38, 0)): 'The index of the log within the block.', transfer_type (VARCHAR(3)): 'This can be 'IN' or 'OUT'. Differentiates whether a token has moved into a wallet or out of a wallet.', address (VARCHAR(16777216)): 'The address to one of the parties of the transaction (wallet or smart contract).', cp_address (VARCHAR(16777216)): 'The address of the counterparty. The counterparty is the entity that is receiving or sending the token to the wallet.', token_address (VARCHAR(16777216)): 'The address of the token.', symbol (VARCHAR(16777216)): 'The symbol of the token being searched.', name (VARCHAR(16777216)): 'The name of the token.', source_value (FLOAT): 'The raw quantity of the token with the native denomination.', value (FLOAT): 'The curated quantity of the token. A negative value indicates the token is being sent out. A positive value indicates that a token is being received.', usd_value (FLOAT): 'The curated value equivalent of the transaction in USD.', date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (Stores information about priced network transfers.) .
    Table 'approvals' has columns: block_number (DECIMAL(38, 0)): 'ID number of the block on the chain.', timestamp (DECIMAL(38, 0)): 'Raw value of the time in Unix Epoch time (in UTC time zone), which is then converted to DATETIME column.', datetime (TIMESTAMP_NTZ): 'Timestamp of the transaction in UTC.', transaction_hash (VARCHAR(16777216)): 'The hexadecimal value of the transaction address.', log_index (DECIMAL(38, 0)): 'The index of the log within the block.', contract_address (VARCHAR(16777216)): 'The address of the contract in which the transaction is interacting.', owner_address (VARCHAR(16777216)): 'The address that owns the asset or token being approved for transfer or interaction.', spender_address (VARCHAR(16777216)): 'The address that is granted permission by the owner to spend or interact with the asset or token.', source_value (FLOAT): 'The raw quantity of the token with the native denomination.', source_value_text (VARCHAR(16777216)): 'The raw quantity of the token with the native denomination stored in text format.', date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (This table stores vital information regarding permissions granted for actions executed on the blockchain, such as token transfers or interactions with non-fungible tokens (NFTs).) .
    Table 'decoded_logs_coverage' has columns: contract_address (VARCHAR(16777216)), sig_hash (VARCHAR(16777216)), event (VARCHAR(16777216)), is_verified_contract (BOOLEAN), log_count (DECIMAL(18, 0)), decoded_count (DECIMAL(18, 0)), diff (DECIMAL(19, 0)), as_of_date (DATE), date_updated (TIMESTAMP_NTZ), .
    Table 'logs' has columns: block_number (DECIMAL(38, 0)): 'ID number of the block on the chain.', timestamp (DECIMAL(38, 0)): 'Raw value of the time in Unix Epoch time (in UTC time zone), which is then converted to DATETIME column.', datetime (TIMESTAMP_NTZ): 'Timestamp of the transaction in UTC.', block_hash (VARCHAR(16777216)): 'The hash of a specific block in the blockchain.', transaction_hash (VARCHAR(16777216)): 'The hexadecimal value of the transaction address.', transaction_index (DECIMAL(38, 0)): 'The position or order of a transaction within a block of the blockchain.', log_index (DECIMAL(38, 0)): 'The index of the log within the block.', transaction_from (VARCHAR(16777216)), transaction_to (VARCHAR(16777216)), address (VARCHAR(16777216)): 'Contract address.', data (VARCHAR(16777216)): 'Extraneous data that is used by the function that is not indexed.', topics (VARCHAR(16777216)): 'Comma separated string of topics that describe the event omitted.', topic1 (VARCHAR(16777216)): 'Hash of the event signature of the event. If the event is anonymous, this field will be blank.', topic2 (VARCHAR(16777216)): 'The 1st indexed parameter of the event, if applicable.', topic3 (VARCHAR(16777216)): 'The 2nd indexed parameter of the event, if applicable.', topic4 (VARCHAR(16777216)): 'The 3rd indexed parameter of the event, if applicable.', date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (Stores essential information about the blocks in a blockchain.) .
    Table 'logs_decoded' has columns: block_number (DECIMAL(38, 0)): 'ID number of the block on the chain.', timestamp (DECIMAL(38, 0)): 'Raw value of the time in Unix Epoch time (in UTC time zone), which is then converted to DATETIME column.', datetime (TIMESTAMP_NTZ): 'Timestamp of the transaction in UTC.', block_hash (VARCHAR(16777216)): 'The hash of a specific block in the blockchain.', contract_address (VARCHAR(16777216)): 'The unique identifier assigned to a smart contract.', transaction_hash (VARCHAR(16777216)): 'The hexadecimal value of the transaction address.', transaction_index (DECIMAL(38, 0)): 'The position or order of a transaction within a block of the blockchain.', log_index (DECIMAL(38, 0)): 'The index of the log within the block.', transaction_from (VARCHAR(16777216)), transaction_to (VARCHAR(16777216)), event (VARCHAR(16777216)): 'Indicates the name of the event type occurring on the blockchain, such as transfers, approvals, etc.', sig_hash (VARCHAR(16777216)): 'Signature hash uniquely identifying the event's function signature, facilitating smart querying.', decoded_log (OBJECT): 'Provides human-readable interpretation of the raw log data, making it accessible for analysis.', index_list (VARIANT): 'Lists the indexes of the decoded log parameters, aiding in structured data retrieval.', types_list (VARIANT): 'Specifies the data types of each decoded log parameter, offering insight into the data's format.', names_list (VARIANT): 'Contains the name labels of each decoded log parameter, enhancing the understanding of data semantics.', is_verified_contract (BOOLEAN): 'A boolean flag indicating whether the decoded log is associated to a verified contract ABI, false indicates that the decoded log was interpretted with the most commonly used signature hash from other verified contracts.', is_decode_success (BOOLEAN), date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (A decoded representation of blockchain event logs, offering comprehensive insights into individual events recorded within each transaction.) .
    Table 'priced_transfers' has columns: block_number (DECIMAL(38, 0)): 'ID number of the block on the chain.', timestamp (DECIMAL(38, 0)): 'Raw value of the time in Unix Epoch time (in UTC time zone), which is then converted to DATETIME column.', datetime (TIMESTAMP_NTZ): 'Timestamp of the transaction in UTC.', transaction_hash (VARCHAR(16777216)): 'The hexadecimal value of the transaction address.', log_index (DECIMAL(38, 0)): 'The index of the log within the block.', from_address (VARCHAR(16777216)): 'The address of the wallet where the asset is being sent from.', to_address (VARCHAR(16777216)): 'The address of the wallet the asset is being sent to.', token_address (VARCHAR(16777216)): 'The address of the token.', symbol (VARCHAR(16777216)): 'The symbol of the token.', name (VARCHAR(16777216)): 'The name of the token.', source_value (FLOAT): 'The raw quantity of the token with the native denomination.', value (FLOAT): 'The curated quantity of the token.', usd_value (FLOAT): 'The curated value equivalent of the transaction in USD.', date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (Records details of token transfers within the network.) .
    Table 'receipts' has columns: block_number (DECIMAL(38, 0)): 'ID number of the block on the chain.', timestamp (DECIMAL(38, 0)): 'Raw value of the time in Unix Epoch time (in UTC time zone), which is then converted to DATETIME column.', datetime (TIMESTAMP_NTZ): 'Timestamp of the transaction in UTC.', transaction_hash (VARCHAR(16777216)): 'The hexadecimal value of the transaction address.', transaction_index (DECIMAL(38, 0)): 'The position or order of a transaction within a block of the blockchain.', block_hash (VARCHAR(16777216)): 'The hash of a specific block in the blockchain.', cumulative_gas_used (DECIMAL(38, 0)): 'Total amount of gas consumed by all preceding transactions within a block, including gas consumed by current transaction being processed.', gas_used (DECIMAL(38, 0)): 'The amount of computational resources, or gas, consumed during the execution of a transaction or a contract.', contract_address (VARCHAR(16777216)): 'The unique identifier assigned to a smart contract.', status (DECIMAL(38, 0)): 'The execution status of a transaction.', effective_gas_price (DECIMAL(38, 0)): 'The actual price or rate at which a transaction is executed, taking into account any adjustments or modifications made to the original gas price specified by the transaction sender.', date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (The curated value equivalent of the transaction in USD.) .
    Table 'tokens' has columns: token_address (VARCHAR(16777216)): 'The address of the token.', name (VARCHAR(16777216)): 'The name of the token.', symbol (VARCHAR(16777216)): 'The symbol of the token.', decimals (DECIMAL(38, 0)): 'The number of decimal places used in token balances and transfers. It defines the token's divisibility and determines the precision of its value.', total_supply (VARCHAR(16777216)): 'The total amount or quantity of tokens that currently exist in the token contract, including locked tokens and circulating supply.', is_erc20 (BOOLEAN): 'Indicates whether a token contract complies with the ERC-20 standard. ERC-20 is a widely adopted token standard on the network, providing a set of common rules and functions for fungible tokens.', is_erc721 (BOOLEAN): 'Indicates whether a token contract complies with the ERC-721 standard. ERC-721 is a token standard for non-fungible tokens (NFTs), representing unique and indivisible digital assets.', is_erc1155 (BOOLEAN): 'Indicates whether a token contract complies with the ERC-1155 standard. ERC-1155 is a token standard that allows for the creation of both fungible and non-fungible tokens within a single contract.', proxy_type (VARCHAR(16777216)): 'The type of proxy contract used for the token.', proxy_contract (VARCHAR(16777216)): 'The address of the proxy contract associated with the token. It is the contract that delegates functionality and controls interactions to the underlying implementation contract.', created_block_number (DECIMAL(38, 0)): 'The block number in which the token contract was created or deployed on the blockchain.', created_block_timestamp (DECIMAL(38, 0)): 'The approximate time when the block containing the token contract creation was mined.', created_datetime (TIMESTAMP_NTZ): 'Date when the token was created.', created_transaction_hash (VARCHAR(16777216)): 'The unique identifier of the transaction that deployed the token contract on the blockchain.', created_transaction_index (DECIMAL(38, 0)): 'The index or position of the transaction within the block that created the token contract.', created_from_address (VARCHAR(16777216)): 'The address that initiated the transaction to create the token contract.', date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (Stores information about the tokens within the ecosystem.) .
    Table 'token_transfers' has columns: block_number (DECIMAL(38, 0)): 'ID number of the block on the chain.', timestamp (DECIMAL(38, 0)): 'Raw value of the time in Unix Epoch time (in UTC time zone), which is then converted to DATETIME column.', datetime (TIMESTAMP_NTZ): 'Timestamp of the transaction in UTC.', token_address (VARCHAR(16777216)): 'The address of the token.', from_address (VARCHAR(16777216)): 'The address of the wallet where the asset is being sent from.', to_address (VARCHAR(16777216)): 'The address of the wallet the asset is being sent to.', source_value (FLOAT): 'The raw quantity of the token with the native denomination.', transaction_hash (VARCHAR(16777216)): 'The hexadecimal value of the transaction address.', log_index (DECIMAL(38, 0)): 'The index of the log within the block.', date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (Stores records of token transfers.) .
    Table 'transactions_failed' has columns: block_number (DECIMAL(38, 0)): 'ID number of the block on the chain.', datetime (TIMESTAMP_NTZ): 'Timestamp of the transaction in UTC.', timestamp (DECIMAL(38, 0)): 'Raw value of the time in Unix Epoch time (in UTC time zone), which is then converted to DATETIME column.', transaction_hash (VARCHAR(16777216)): 'The hexadecimal value of the transaction address.', transaction_index (DECIMAL(38, 0)): 'The position or order of a transaction within a block of the blockchain.', nonce (DECIMAL(38, 0)): 'Confirmation of the legitimacy of the block; confirms that a miner has done Proof of Work on that block.', block_hash (VARCHAR(16777216)): 'The hash of a specific block in the blockchain.', from_address (VARCHAR(16777216)): 'The address of the wallet where the asset is being sent from.', to_address (VARCHAR(16777216)): 'The address of the wallet the asset is being sent to.', value (FLOAT): 'The curated quantity of the token. A negative value indicates the token is being sent out. A positive value indicates that a token is being received.', usd_value (FLOAT): 'The curated value equivalent of the transaction in USD.', price (FLOAT): 'The price of a single token in a specified currency.', transaction_fee (FLOAT): 'The fee paid by the sender to process and include the token transaction on the blockchain.', usd_transaction_fee (FLOAT): 'The equivalent value of the transaction fee in USD based on a specific exchange rate or pricing source.', gas_price (FLOAT): 'The gas price specified by the sender, indicating the amount of Ether (ETH) paid per unit of gas to execute the transaction.', gas_price_gwei (FLOAT): 'The gas price expressed in Gwei, a commonly used unit for measuring gas prices on the chain.', effective_gas_price (FLOAT): 'The actual price or rate at which a transaction is executed, taking into account any adjustments or modifications made to the original gas price specified by the transaction sender.', effective_gas_price_gwei (FLOAT): 'The actual price or rate at which a transaction is executed in gwei, taking into account any adjustments or modifications made to the original gas price specified by the transaction sender.', max_fee_per_gas (FLOAT): 'The maximum fee per unit of gas that the sender is willing to pay for the transaction.', max_fee_per_gas_gwei (FLOAT): 'The maximum fee per unit of gas expressed in Gwei.', max_priority_fee_per_gas (FLOAT): 'The maximum priority fee per unit of gas, which is a component of the transaction fee that is used to incentivize miners.', max_priority_fee_per_gas_gwei (FLOAT): 'The maximum priority fee per unit of gas expressed in Gwei.', gas_limit (DECIMAL(38, 0)): 'The maximum amount of gas allocated for the execution of the transaction.', gas_used (DECIMAL(38, 0)): 'The actual amount of gas consumed by the transaction during execution.', gas_used_pct (DECIMAL(38, 6)): 'The percentage of gas used compared to the gas limit.', cumulative_gas_used (DECIMAL(38, 0)): 'The total amount of gas consumed by the transaction and all preceding transactions within the same block.', input (VARCHAR(16777216)): 'The input data or payload associated with the token transaction, which can include additional instructions or parameters for contract execution.', transaction_type (DECIMAL(38, 0)): 'The type or category of the token transaction, such as a transfer, approval, or contract interaction.', contract_address (VARCHAR(16777216)): 'The address of the token contract with which the transaction is interacting.', status (DECIMAL(38, 0)): 'The execution status of the token transaction.', source_value (FLOAT): 'The raw quantity of the token with the native denomination.', source_gas_price (DECIMAL(38, 0)): 'The original gas price specified by the sender before any modification.', source_effective_gas_price (DECIMAL(38, 0)): 'The effective gas price calculated or adjusted based on network conditions or pricing mechanisms.', source_max_fee_per_gas (DECIMAL(38, 0)): 'The original maximum fee per unit of gas specified by the sender before any modification.', source_max_priority_fee_per_gas (DECIMAL(38, 0)): 'The original maximum priority fee per unit of gas specified by the sender before any modification.', date_created (TIMESTAMP_NTZ), date_updated (TIMESTAMP_NTZ), with comment: (Stores information about failed individual transactions within the network.) .
        
    

    Question: the number of wallets where 10% of the total the wallet receives is USDT vs USDC vs other assets, potentially splitting wallets by total value they send, e.g. wallets that send less than $1k in total SQLQuery:

  2. Assistant

    To answer the question, we'll need to look at the distribution of the tokens received by wallets and categorize wallets based on the total value they send. We can make use of the priced_transfers table for exploring token transfers, and differentiate between USDT, USDC, and other assets. Here's a query to achieve this:

    SELECT 
        CASE 
            WHEN total_sent < 1000 THEN 'Less than 1k'
            WHEN total_sent >= 1000 AND total_sent < 10000 THEN '1k to 10k'
            ELSE 'More than 10k'
        END AS wallet_category,
        COUNT(DISTINCT CASE WHEN symbol = 'USDT' AND value_received/total_received >= 0.10 THEN address END) AS usdt_wallets,
        COUNT(DISTINCT CASE WHEN symbol = 'USDC' AND value_received/total_received >= 0.10 THEN address END) AS usdc_wallets,
        COUNT(DISTINCT CASE WHEN symbol NOT IN ('USDT', 'USDC') AND value_received/total_received >= 0.10 THEN address END) AS other_wallets
    FROM (
        SELECT 
            address,
            SUM(CASE WHEN symbol = 'USDT' THEN value ELSE 0 END) AS value_received,
            SUM(value) AS total_received,
            SUM(CASE WHEN transfer_type='OUT' THEN value ELSE 0 END) AS total_sent
        FROM priced_net_transfers
        GROUP BY address
    ) wallet_transfers
    GROUP BY wallet_category
    ORDER BY wallet_category;
    

    This query categorizes wallets based on the total value they send and checks if at least 10% of the total value received by a wallet is either USDT, USDC, or other assets before counting those wallets.