MLDZMNmev2
    Updated 2024-05-21
    avalanche.defi.ez_dex_swaps
    with transfer_list as(
    select
    tx_id,
    tx_to,
    tx_from,
    mint,
    amount,
    index

    from solana.core.fact_transfers
    where block_timestamp > current_date() - interval '{{days}} days'
    ),

    asc_ordered_transfers as(
    select
    tx_id,
    tx_to,
    tx_from,
    mint,
    amount,
    floor(index) as index_test,
    row_number() over (partition BY tx_id ORDER BY FLOOR(index) asc,
    (index - floor(index)) * power(10, len(cast(index as varchar)) - len(cast(floor(index) as varchar))) asc) AS row_number

    from transfer_list

    ),

    desc_ordered_transfers as(
    select
    tx_id,
    tx_to,
    tx_from,
    mint,
    amount,
    QueryRunArchived: QueryRun has been archived