TheLaughingMantests - listing sales (single)
    Updated 2025-02-14
    -- forked from tests - offer sales @ https://flipsidecrypto.xyz/studio/queries/dc7f86ec-73c6-49a2-a7d4-6e0c3ae30b58

    with listing_sales as (
    SELECT
    logs.block_timestamp
    , logs.tx_hash
    , buyer
    , seller
    , symbol
    , amount
    , amount_usd
    , collection
    , nft_contract
    , token_id
    , quantity
    from ronin.core.fact_event_logs logs
    LEFT JOIN (
    SELECT
    tx_hash
    , from_address as buyer
    , 'RON' as symbol
    , amount
    , amount_usd
    from ronin.core.ez_native_transfers
    WHERE 1=1
    AND trace_index = 0
    AND to_address = '0x3b3adf1422f84254b7fbb0e7ca62bd0865133fe3' --Market Gateway Proxy

    UNION ALL
    --incase other erc20 not native
    SELECT
    tx_hash
    , from_address as buyer
    , symbol
    , amount
    , amount_usd
    QueryRunArchived: QueryRun has been archived