From 75af13a4f9b90b9fee28f0eedc40ea02f884fbf5 Mon Sep 17 00:00:00 2001 From: Lucas Meier Date: Mon, 18 Nov 2024 11:49:26 -0800 Subject: [PATCH] bug: pindexer: dex-explorer: add columns to the correct table --- crates/bin/pindexer/src/dex_ex/mod.rs | 2 +- crates/bin/pindexer/src/dex_ex/schema.sql | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bin/pindexer/src/dex_ex/mod.rs b/crates/bin/pindexer/src/dex_ex/mod.rs index 0c968f0d0d..d430ef7150 100644 --- a/crates/bin/pindexer/src/dex_ex/mod.rs +++ b/crates/bin/pindexer/src/dex_ex/mod.rs @@ -443,7 +443,7 @@ mod summary { SELECT COALESCE(SUM(direct_volume), 0.0) AS direct_volume_over_window, COALESCE(SUM(swap_volume), 0.0) AS swap_volume_over_window, - COALESCE(SUM(trades), 0.0) AS trades_over_window + COALESCE(SUM(trades), 0.0) AS trades_over_window, COALESCE(MIN(price), 0.0) AS low, COALESCE(MAX(price), 0.0) AS high FROM snapshots diff --git a/crates/bin/pindexer/src/dex_ex/schema.sql b/crates/bin/pindexer/src/dex_ex/schema.sql index 0c1dbe4c54..6de17b2be2 100644 --- a/crates/bin/pindexer/src/dex_ex/schema.sql +++ b/crates/bin/pindexer/src/dex_ex/schema.sql @@ -34,8 +34,6 @@ CREATE TABLE IF NOT EXISTS dex_ex_pairs_block_snapshot ( asset_start BYTEA NOT NULL, asset_end BYTEA NOT NULL, price FLOAT8 NOT NULL, - low FLOAT8 NOT NULL, - high FLOAT8 NOT NULL, liquidity FLOAT8 NOT NULL, direct_volume FLOAT8 NOT NULL, swap_volume FLOAT8 NOT NULL, @@ -51,6 +49,8 @@ CREATE TABLE IF NOT EXISTS dex_ex_pairs_summary ( the_window TEXT NOT NULL, price FLOAT8 NOT NULL, price_then FLOAT8 NOT NULL, + low FLOAT8 NOT NULL, + high FLOAT8 NOT NULL, liquidity FLOAT8 NOT NULL, liquidity_then FLOAT8 NOT NULL, direct_volume_over_window FLOAT8 NOT NULL,