m3jiDeposit Volume
    Updated 2024-12-09
    with result as (
    SELECT
    block_timestamp,
    tx_hash,
    origin_from_address,
    amount_usd,
    row_number() over (
    partition by amount_usd
    ORDER BY
    block_timestamp
    ) as rank
    FROM
    (
    SELECT
    block_timestamp,
    tx_hash,
    origin_from_address,
    amount_usd
    FROM
    gnosis.defi.ez_lending_deposits
    WHERE
    1 = 1
    AND platform ilike '%spark%'
    AND amount_usd IS NOT NULL
    AND origin_from_address NOT IN(
    SELECT
    address
    FROM
    gnosis.core.dim_contracts
    )
    )
    ),
    volume as (
    SELECT
    date_trunc('d', block_timestamp) as "Date",
    sum(amount_usd) AS "Volume (USD)",