zakkisyedBSC Marketplace event explorer
    Updated 2023-08-06
    with transaction_table as (

    SELECT
    block_timestamp AS date,
    from_address,
    to_address,
    ft.tx_hash,
    CASE
    WHEN t1.tx_hash IS NOT NULL THEN 'token_transfer'
    WHEN t2.tx_hash IS NOT NULL THEN 'native_transfer'
    WHEN t3.tx_hash IS NOT NULL THEN 'nft_transfer'
    WHEN t4.tx_hash IS NOT NULL THEN 'nft_sale'
    ELSE 'dapp-transaction'
    END AS category,
    gas_price AS gas_fee,
    tx_fee AS tx_fee_in_bnb,
    ((LENGTH(input_data)-2) / 2) + 148 AS data_size_bytes,
    status
    FROM bsc.core.fact_transactions ft
    --token transfers
    LEFT JOIN (
    SELECT DISTINCT tx_hash
    FROM bsc.core.fact_token_transfers
    WHERE block_timestamp > '2023-07-30'
    ) t1 ON ft.tx_hash = t1.tx_hash
    --native transfers
    LEFT JOIN (
    SELECT DISTINCT tx_hash
    FROM bsc.core.ez_bnb_transfers
    WHERE block_timestamp > '2023-07-30'
    ) t2 ON ft.tx_hash = t2.tx_hash
    --nft transfers
    LEFT JOIN (
    SELECT DISTINCT fdel.tx_hash
    FROM bsc.core.fact_decoded_event_logs fdel
    WHERE (decoded_log:tokenId IS NOT NULL OR decoded_log:nftId IS NOT NULL)
    Run a query to Download Data