Skip to content

Commit

Permalink
bid q
Browse files Browse the repository at this point in the history
  • Loading branch information
leecchh committed Dec 2, 2024
1 parent 10a95cb commit 4a289bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/sui-deepbook-indexer/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,20 @@ async fn get_level2_ticks_from_mid(
let ask_parsed_quantities: Vec<u64> = bcs::from_bytes(&ask_quantities).unwrap();

let mut result = HashMap::new();
// Insert bid parsed prices
result.insert(
"bid_parsed_prices".to_string(),
Value::Array(
bid_parsed_prices
.into_iter()
.map(|quantity| {
let factor = 10u64.pow((9 - *base_decimals + *quote_decimals).try_into().unwrap());
Value::from(quantity as f64 / factor as f64)
})
.collect(),
),
);

// Insert bid parsed quantities
result.insert(
"bid_parsed_quantities".to_string(),
Expand Down

0 comments on commit 4a289bc

Please sign in to comment.