itspauloalmeida[1124] CoW protocol copy
    Updated 2024-12-03
    -- forked from sam / [1124] CoW protocol @ https://flipsidecrypto.xyz/sam/q/7aQo48yJoYq_/1124-cow-protocol

    with eth_orders as (

    select
    block_timestamp,
    event_index,
    tx_hash,
    decoded_log:order:buyAmount::int as buy_amount,
    decoded_log:order:buyToken::string as buy_token,
    decoded_log:order:sellAmount::int as sell_amount,
    decoded_log:order:sellToken::string as sell_token,
    decoded_log:order:feeAmount::int as fee,
    decoded_log:order:receiver::string as swapper,
    decoded_log:order:partiallyFillable as is_partial


    from ethereum.core.ez_decoded_event_logs
    where tx_hash = '0x543fb1944b1c5b4fe76977f14d2803ce016ad2082c7bcc7a699de3396578cc4e'
    and block_timestamp::date >= '2024-11-11'
    and event_name = 'OrderPlacement'
    and contract_address = '0x40a50cf069e992aa4536211b23f286ef88752187'
    ),

    eth_orderhash as (
    select
    tx_hash,
    trace_index,
    output
    from ethereum.core.fact_traces
    where tx_hash = '0x543fb1944b1c5b4fe76977f14d2803ce016ad2082c7bcc7a699de3396578cc4e'
    and block_timestamp::date >= '2024-11-11'
    and to_address = '0x40a50cf069e992aa4536211b23f286ef88752187'
    and left(input, 10) = '0x322bba21'
    ),

    Last run: 2 months ago
    SELL_SYMBOL_NEW || ' => ' || BUY_SYMBOL
    TXS
    VOLUME_USD
    1
    LDO => USDT2062565052.38648154
    2
    SHRUB => USDC48827006.963100738
    3
    INF => TITANX251449626.311580422
    4
    PORTAL => unknown100134762.592868195
    5
    STONKS => unknown94230677.597102357
    6
    CBETH => unknown582168014.18455353
    7
    TITANX => MORPH5165411.400283739
    8
    WETH => SAFE172293234.877936137
    9
    DAI => USDS3318058139.9341734
    10
    FRXETH => FXS214293.587950987
    11
    ANDY => USDT20188349.488647973
    12
    BBTC => CBBTC5575299.71020587
    13
    WTAO => unknown922934067.98688571
    14
    USDS => USDC229143512239.160858
    15
    SAITAMA => unknown1632622.601790051
    16
    APUFF => RNDR1100.776990228
    17
    DOG => FI117501.181237899
    18
    WETH => EZETH9237713695.1376411
    19
    LUSH => USDC2740281.078505919
    20
    MUMU => WETH24431.759034043
    ...
    11737
    400KB
    9s