diff --git a/Cargo.lock b/Cargo.lock index 3246fda..72de21f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2731,7 +2731,7 @@ dependencies = [ [[package]] name = "pyth-agent" -version = "2.4.4" +version = "2.4.5" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 0b30856..524a648 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyth-agent" -version = "2.4.4" +version = "2.4.5" edition = "2021" [[bin]] diff --git a/src/agent/solana/exporter.rs b/src/agent/solana/exporter.rs index dee0bb3..c903337 100644 --- a/src/agent/solana/exporter.rs +++ b/src/agent/solana/exporter.rs @@ -436,14 +436,6 @@ impl Exporter { // and to ignore stale information. let fresh_updates = local_store_contents .into_iter() - .filter(|(identifier, info)| { - // Filter out timestamps older than what we already published - if let Some(last_info) = self.last_published_state.get(identifier) { - last_info.timestamp < info.timestamp - } else { - true // No prior data found, letting the price through - } - }) .filter(|(_identifier, info)| { // Filter out timestamps that are old (now - info.timestamp) < self.config.staleness_threshold.as_secs() as i64 @@ -452,7 +444,7 @@ impl Exporter { // Filter out unchanged price data if the max delay wasn't reached if let Some(last_info) = self.last_published_state.get(identifier) { - if (info.timestamp - last_info.timestamp) + if info.timestamp.saturating_sub(last_info.timestamp) > self.config.unchanged_publish_threshold.as_secs() as i64 { true // max delay since last published state reached, we publish anyway