diff --git a/parser/src/datasets/price/mod.rs b/parser/src/datasets/price/mod.rs index 3cb556fdb..5a146d396 100644 --- a/parser/src/datasets/price/mod.rs +++ b/parser/src/datasets/price/mod.rs @@ -530,7 +530,8 @@ How to fix this: previous_timestamp: Option, ) -> color_eyre::Result { if self.binance_har.is_none() { - self.binance_har.replace(Binance::read_har_file()?); + self.binance_har + .replace(Binance::read_har_file().unwrap_or_default()); } Self::find_height_ohlc( diff --git a/parser/src/price/binance.rs b/parser/src/price/binance.rs index 4dbfe6297..77b44fbf7 100644 --- a/parser/src/price/binance.rs +++ b/parser/src/price/binance.rs @@ -122,7 +122,7 @@ impl Binance { // [timestamp, open, high, low, close, volume, ...] let array = value.as_array().unwrap(); - let timestamp = array.first().unwrap().as_u64().unwrap() as u32; + let timestamp = (array.first().unwrap().as_u64().unwrap() / 1000) as u32; let get_f32 = |index: usize| { array @@ -169,9 +169,8 @@ impl Binance { // [timestamp, open, high, low, close, volume, ...] let array = value.as_array().unwrap(); - let date = Date::from_timestamp( - array.first().unwrap().as_u64().unwrap() as u32 / 1000, - ); + let date = + Date::from_timestamp(array.first().unwrap().as_u64().unwrap() as u32); let get_f32 = |index: usize| { array