From 27eb4a13cc7d737278a776c3fb8cd3335b2b97cf Mon Sep 17 00:00:00 2001 From: 0o-de-lally <1364012+0o-de-lally@users.noreply.github.com> Date: Sun, 1 Dec 2024 21:21:12 -0500 Subject: [PATCH] renames --- src/analytics/enrich_rms.rs | 4 ++-- src/load_exchange_orders.rs | 2 +- tests/test_enrich_exchange.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/analytics/enrich_rms.rs b/src/analytics/enrich_rms.rs index b4c75a0..123fe6b 100644 --- a/src/analytics/enrich_rms.rs +++ b/src/analytics/enrich_rms.rs @@ -15,7 +15,7 @@ fn calculate_rms(data: &[f64]) -> f64 { } /// enrich swap struct with RMS data -pub fn process_swaps(swaps: &mut [ExchangeOrder]) { +pub fn include_rms_stats(swaps: &mut [ExchangeOrder]) { swaps.sort_by_key(|swap| swap.filled_at); let mut window_1hour: VecDeque = VecDeque::new(); @@ -249,7 +249,7 @@ fn test_rms_pipeline() { }, ]; - process_swaps(&mut swaps); + include_rms_stats(&mut swaps); let s0 = swaps.first().unwrap(); assert!(s0.rms_hour == 0.0); diff --git a/src/load_exchange_orders.rs b/src/load_exchange_orders.rs index a882f38..7aedde2 100644 --- a/src/load_exchange_orders.rs +++ b/src/load_exchange_orders.rs @@ -85,7 +85,7 @@ pub async fn impl_batch_tx_insert(pool: &Graph, batch_txs: &[ExchangeOrder]) -> pub async fn load_from_json(path: &Path, pool: &Graph, batch_size: usize) -> Result<(u64, u64)> { let mut orders = extract_exchange_orders::read_orders_from_file(path)?; // add RMS stats to each order - enrich_rms::process_swaps(&mut orders); + enrich_rms::include_rms_stats(&mut orders); // find likely shill bids enrich_rms::process_sell_order_shill(&mut orders); enrich_rms::process_buy_order_shill(&mut orders); diff --git a/tests/test_enrich_exchange.rs b/tests/test_enrich_exchange.rs index 3d74e06..5fffcf4 100644 --- a/tests/test_enrich_exchange.rs +++ b/tests/test_enrich_exchange.rs @@ -28,7 +28,7 @@ fn test_enrich_rms() { let mut orders = extract_exchange_orders::read_orders_from_file(buf).unwrap(); assert!(orders.len() == 25450); - enrich_rms::process_swaps(&mut orders); + enrich_rms::include_rms_stats(&mut orders); let count_above_100_pct = orders.iter().fold(0, |mut acc, el| { if el.price_vs_rms_24hour > 2.0 {