Skip to content

Commit

Permalink
DeepBook Indexer: update net balances query (#20037)
Browse files Browse the repository at this point in the history
## Description 

Describe the changes or additions included in this PR.
Update the DeepBook indexer API.

## Test plan 

How did you test the new or updated feature?
Local testing end to end.

---

## 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): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
0xaslan authored Oct 25, 2024
1 parent 773fd58 commit c4826d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/sui-deepbook-indexer/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ async fn get_net_deposits(
) -> Result<Json<HashMap<String, i64>>, DeepBookError> {
let connection = &mut state.pool.get().await?;
let mut query =
"SELECT asset, SUM(amount)::bigint AS amount, deposit FROM balances WHERE timestamp < to_timestamp("
"SELECT asset, SUM(amount)::bigint AS amount, deposit FROM balances WHERE checkpoint_timestamp_ms < "
.to_string();
query.push_str(&timestamp);
query.push_str(") AND asset in (");
query.push_str("000 AND asset in (");
for asset in asset_ids.split(",") {
if asset.starts_with("0x") {
let len = asset.len();
Expand Down

0 comments on commit c4826d0

Please sign in to comment.