Skip to content

Commit

Permalink
renames
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Dec 2, 2024
1 parent cd0df6d commit 27eb4a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/analytics/enrich_rms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ExchangeOrder> = VecDeque::new();
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/load_exchange_orders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_enrich_exchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 27eb4a1

Please sign in to comment.