Skip to content

Commit

Permalink
Switch Deepbook Indexer timestamp (#20495)
Browse files Browse the repository at this point in the history
## 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:
  • Loading branch information
leecchh authored Dec 3, 2024
1 parent d24ec4a commit b0f8b12
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/sui-deepbook-indexer/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b0f8b12

Please sign in to comment.