adriaparcerisasnear memedotcooking
    Updated 2025-05-12
    WITH base_data AS (
    SELECT
    trunc(block_timestamp, 'day') AS trade_date,
    tx_hash,
    trader,
    token_in_contract,
    symbol_in,
    token_out_contract,
    symbol_out,
    amount_in,
    amount_out,
    amount_in_usd,
    amount_out_usd,
    pool_id
    FROM near.defi.ez_dex_swaps
    ),

    pricing_data AS (
    SELECT
    trunc(b.block_timestamp, 'day') AS price_date,
    b.token_in_contract,
    b.token_out_contract,
    -- Price of token_in in terms of wNEAR (amount_out / amount_in when wNEAR is output)
    AVG(CASE
    WHEN b.symbol_out = 'wNEAR' AND b.amount_in > 0 AND b.amount_out > 0
    THEN b.amount_out / b.amount_in
    ELSE NULL
    END) AS price_in_terms_of_wnear,
    -- Price of token_out in terms of wNEAR (amount_in / amount_out when wNEAR is input)
    AVG(CASE
    WHEN b.symbol_in = 'wNEAR' AND b.amount_in > 0 AND b.amount_out > 0
    THEN b.amount_in / b.amount_out
    ELSE NULL
    END) AS price_out_in_terms_of_wnear
    FROM near.defi.ez_dex_swaps b
    Last run: 21 days ago
    TRADE_DATE
    SWAPS
    TOTAL_SWAPS
    TRADED_VOLUME_USD
    TOTAL_TRADED_VOLUME_USD
    AVG_TRADE_VOLUME
    MAX_TRADE_VOLUME
    MEDIAN_TRADE_VOLUME
    1
    2025-05-11 00:00:00.000880359337104424.38005787239918312.1244339118.6640682488298.012154037110.432940961
    2
    2025-05-10 00:00:00.000131235845789762.54504614939813887.74437668.4165739681027.37611069339.1573349
    3
    2025-05-09 00:00:00.0001667357145206391.80300885239724125.1993299123.8103197412966.12125011848.855615805
    4
    2025-05-08 00:00:00.00078035547890981.41994646839517733.396321116.6428460851490.24652715798.80114547
    5
    2025-05-07 00:00:00.00093435469897845.35150426539426751.9763745104.7594769853419.59509564530.314078187
    6
    2025-05-06 00:00:00.00057635376476353.37471484639328906.6248703132.5579422131438.385578958162.676255835
    7
    2025-05-05 00:00:00.0001165353188100463.13933130639252553.250155486.2344543624164.65693692623.388019223
    8
    2025-05-04 00:00:00.00087135202353530.10162112539152090.110824161.458210816790.3676563389.399107236
    9
    2025-05-03 00:00:00.00083035115251028.20781120139098560.00920361.479768447672.71080571610.655639975
    10
    2025-05-02 00:00:00.00064435032258224.20416732439047531.801391890.4102549182217.699923997.605065475
    11
    2025-05-01 00:00:00.000139634967863478.0223371738989307.597224545.471362706677.28358788219.777233975
    12
    2025-04-30 00:00:00.00060934828252980.25829379438925829.574887386.9954980191491.67674193211.942450924
    13
    2025-04-29 00:00:00.00066934767358263.96077324838872849.316593587.0911222322560.0727233514.39419859
    14
    2025-04-28 00:00:00.00057834700442086.87882338138814585.355820372.8146692451137.693612154.057473339
    15
    2025-04-27 00:00:00.00062134642643241.55573593838772498.476996969.63213484465.2794101764.007307748
    16
    2025-04-26 00:00:00.00062734580541991.35677464138729256.92126166.9718608851654.2319866896.290940847
    17
    2025-04-25 00:00:00.00067634517859516.77593158538687265.564486388.0425679464277.0911472278.164248454
    18
    2025-04-24 00:00:00.00057034450236751.76412073438627748.788554764.476779159253.0295766096.492577408
    19
    2025-04-23 00:00:00.00062534393238061.69286531638590997.02443460.898708585530.9893722175.405609523
    20
    2025-04-22 00:00:00.00071234330740154.86059227538552935.331568756.3972761133260.8748513813.914546912
    ...
    244
    27KB
    1116s