AMLBotPolygon stablecoins OTC
    Updated 2024-12-19
    with dex_address as(
    select
    address,
    project_name
    from polygon.core.dim_labels
    where label_type='dex'
    ),
    cex_address as(
    select
    address,
    project_name
    from polygon.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 polygon.core.ez_token_transfers
    where
    block_timestamp::date >= current_date - {{days_back}}
    and
    contract_address in ('0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
    '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
    '0x45c32fa6df82ead1e2ef74d17b76547eddfaff89',
    '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063')
    and
    origin_function_signature = '0xa9059cbb'
    and (
    -- from_address not in(select address from cex_address)
    -- and
    QueryRunArchived: QueryRun has been archived