From b0f8b1255867a35f7674b49ec4d23a08aa028a51 Mon Sep 17 00:00:00 2001 From: Tony Lee Date: Tue, 3 Dec 2024 13:45:45 -0500 Subject: [PATCH] Switch Deepbook Indexer timestamp (#20495) ## Description Switch Deepbook Indexer timestamp from on chain timestamp to checkpoint timestamp ## Test plan Tested locally --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [x] Indexer: Deepbook Indexer - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-deepbook-indexer/src/server.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/sui-deepbook-indexer/src/server.rs b/crates/sui-deepbook-indexer/src/server.rs index 8e7cc411d24f6..9c3131a4bc44f 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,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::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)