From c3a466fab8c23faa70ca6436962d31ce43b3e28c Mon Sep 17 00:00:00 2001 From: Tony Lee Date: Tue, 3 Dec 2024 13:09:10 -0500 Subject: [PATCH 1/2] timestamp switch --- crates/sui-deepbook-indexer/src/server.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/sui-deepbook-indexer/src/server.rs b/crates/sui-deepbook-indexer/src/server.rs index 8e7cc411d24f6..0b06f090274cf 100644 --- a/crates/sui-deepbook-indexer/src/server.rs +++ b/crates/sui-deepbook-indexer/src/server.rs @@ -132,7 +132,7 @@ async fn get_historical_volume( let results: Vec<(String, i64)> = schema::order_fills::table .select((schema::order_fills::pool_id, column_to_query)) .filter(schema::order_fills::pool_id.eq_any(pool_ids_list)) - .filter(schema::order_fills::onchain_timestamp.between(start_time, end_time)) + .filter(schema::order_fills::checkpoint_timestamp_ms.between(start_time, end_time)) .load(connection) .await?; @@ -189,7 +189,7 @@ async fn get_historical_volume_by_balance_manager_id( column_to_query, )) .filter(schema::order_fills::pool_id.eq_any(&pool_ids_list)) - .filter(schema::order_fills::onchain_timestamp.between(start_time, end_time)) + .filter(schema::order_fills::checkpoint_timestamp_ms.between(start_time, end_time)) .filter( schema::order_fills::maker_balance_manager_id .eq(&balance_manager_id) @@ -278,7 +278,7 @@ async fn get_historical_volume_by_balance_manager_id_with_interval( column_to_query, )) .filter(schema::order_fills::pool_id.eq_any(&pool_ids_list)) - .filter(schema::order_fills::onchain_timestamp.between(current_start, current_end)) + .filter(schema::order_fills::checkpoint_timestamp_ms.between(current_start, current_end)) .filter( schema::order_fills::maker_balance_manager_id .eq(&balance_manager_id) From 66e7e2afe1e6cdb5dfc57e5355c4d9cd1eb92eea Mon Sep 17 00:00:00 2001 From: Tony Lee Date: Tue, 3 Dec 2024 13:13:05 -0500 Subject: [PATCH 2/2] cargo fmt --- crates/sui-deepbook-indexer/src/server.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/sui-deepbook-indexer/src/server.rs b/crates/sui-deepbook-indexer/src/server.rs index 0b06f090274cf..9c3131a4bc44f 100644 --- a/crates/sui-deepbook-indexer/src/server.rs +++ b/crates/sui-deepbook-indexer/src/server.rs @@ -278,7 +278,9 @@ async fn get_historical_volume_by_balance_manager_id_with_interval( column_to_query, )) .filter(schema::order_fills::pool_id.eq_any(&pool_ids_list)) - .filter(schema::order_fills::checkpoint_timestamp_ms.between(current_start, current_end)) + .filter( + schema::order_fills::checkpoint_timestamp_ms.between(current_start, current_end), + ) .filter( schema::order_fills::maker_balance_manager_id .eq(&balance_manager_id)