AMLBotETH stablecoins OTC
    Updated 2024-12-19
    with dex_address as(
    select
    address,
    label
    from ethereum.core.dim_labels
    where label_type='dex'
    ),
    cex_address as(
    select
    address,
    label
    from ethereum.core.dim_labels
    where label_type='cex' and label_subtype = 'hot_wallet'
    --do we filter by hot wallet?
    ),
    raw_tx as(
    select
    block_timestamp::date day,
    tx_hash,
    from_address,
    to_address,
    symbol,
    amount
    from ethereum.core.ez_token_transfers
    where
    block_timestamp::date >= current_date - {{days_back}}
    and
    contract_address in ('0xdac17f958d2ee523a2206206994597c13d831ec7',
    '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
    '0x6b175474e89094c44da98b954eedeac495271d0f',
    '0x853d955acef822db058eb8505911ed77f175b99e')
    and
    origin_function_signature = '0xa9059cbb'
    and (
    -- from_address not in(select address from cex_address)
    -- and
    QueryRunArchived: QueryRun has been archived