From e5cae7d182aa99b2a2161c7a386edcd39c4a720f Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Sun, 20 Oct 2024 06:51:58 +0000 Subject: [PATCH] Update apy.rs --- crates/subgraph/src/apy.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/subgraph/src/apy.rs b/crates/subgraph/src/apy.rs index ec7c304ea..8ba9e3b43 100644 --- a/crates/subgraph/src/apy.rs +++ b/crates/subgraph/src/apy.rs @@ -474,10 +474,11 @@ fn year() -> I256 { /// Returns annual rate as 18 point decimals as I256 fn annual_rate(start: u64, end: u64) -> I256 { - let timeframe = parse_units(&(end - start).to_string(), 18) + parse_units(&(end - start).to_string(), 18) .unwrap() - .get_signed(); - timeframe.saturating_mul(one()).saturating_div(year()) + .get_signed() + .saturating_mul(one()) + .saturating_div(year()) } #[cfg(test)]