datavortexwhat categories are trading
    Updated 8 days ago
    WITH SwapData AS (
    SELECT
    tx_hash,
    origin_from_address AS trader,
    block_timestamp
    FROM
    ink.core.ez_decoded_event_logs
    WHERE
    event_name = 'Swap'
    AND origin_to_address = '0xa8c1c38ff57428e5c3a34e0899be5cb385476507'
    AND block_timestamp IS NOT NULL
    AND tx_succeeded = TRUE
    ),
    token_transfers AS (
    SELECT
    tx_hash,
    symbol,
    amount_usd
    FROM
    ink.core.ez_token_transfers
    ),
    transfers_with_index AS (
    SELECT
    tx_hash,
    symbol,
    amount_usd,
    ROW_NUMBER() OVER (
    PARTITION BY tx_hash
    ORDER BY
    LOWER(symbol) ASC
    ) AS symbol_index
    FROM
    token_transfers
    ),
    amounts_with_index AS (
    SELECT