MoDeFiwc r8 1 - swaps over time
    Updated 2022-12-13
    --------------------------------------------------------------------Ethereum--------------------------------------------------------------------
    with ethereum_dexs as (
    select ADDRESS, LABEL as PROJECT_NAME from ethereum.core.dim_labels where LABEL_TYPE='dex' and LABEL_SUBTYPE in ('general_contract','swap_contract')
    and PROJECT_NAME not in ('idex','kybernetwork','opyn','dexe network','dex.ag','hegic','idle finance','luaswap','airswap','loopring','hakka finance')
    union
    select $1 AS ADDRESS,
    $2 as PROJECT_NAME
    FROM
    (VALUES
    ('0x7a250d5630b4cf539739df2c5dacb4c659f2488d','uniswap'),
    ('0x1111111254fb6c44bac0bed2854e76f90643097d','1inch'),
    ('0x1111111254eeb25477b68fb85ed929f73a960582','1inch'),
    ('0x111111125434b319222cdbf8c261674adb56f3ae','1inch'),
    ('0x03f7724180aa6b939894b5ca4314783b0b36b329','shibaswap'),
    ('0x53e0e51b5ed9202110d7ecd637a4581db8b9879f','dooar'),
    ('0xdef171fe48cf0115b1d80b88dc8eab59176fee57','paraswap'),
    ('0x76f4eed9fe41262669d0250b2a97db79712ad855','odos'),
    ('0xba12222222228d8ba445958a75a0704d566bf2c8','balancer'),
    ('0x25553828f22bdd19a20e4f12f052903cb474a335','uniswap'),
    ('0x03f34be1bf910116595db1b11e9d1b2ca5d59659','tokenlon'),
    ('0x617dee16b86534a5d792a4d7a62fb491b544111e','kyberswap'),
    ('0xdf1a1b60f2d438842916c0adc43748768353ec25','kyberswap'),
    ('0x00555513acf282b42882420e5e5ba87b44d8fa6e','kyberswap'),
    ('0xf6a94dfd0e6ea9ddfdffe4762ad4236576136613','hashflow'),
    ('0x55b916ce078ea594c10a874ba67ecc3d62e29822','curve fi'))),

    ethereum_txs as (
    select BLOCK_TIMESTAMP, TX_HASH, ORIGIN_FUNCTION_SIGNATURE, ORIGIN_FROM_ADDRESS, ORIGIN_TO_ADDRESS, CONTRACT_ADDRESS , FROM_ADDRESS, TO_ADDRESS, RAW_AMOUNT
    from ethereum.core.fact_token_transfers
    where BLOCK_TIMESTAMP::date>=CURRENT_DATE-{{Days_Before}}
    union all
    select BLOCK_TIMESTAMP, TX_HASH, ORIGIN_FUNCTION_SIGNATURE, ORIGIN_FROM_ADDRESS, ORIGIN_TO_ADDRESS, '' as CONTRACT_ADDRESS , ETH_FROM_ADDRESS as FROM_ADDRESS, ETH_TO_ADDRESS as TO_ADDRESS, AMOUNT as RAW_AMOUNT
    from ethereum.core.ez_eth_transfers
    where BLOCK_TIMESTAMP::date>=CURRENT_DATE-{{Days_Before}}),
    ethereum_contracts as (
    Run a query to Download Data