From eead4ce172dbe887a9f9fb4efff1a1b9af0dd84f Mon Sep 17 00:00:00 2001 From: MazyGio Date: Thu, 25 Apr 2024 21:41:27 -0500 Subject: [PATCH] linting fixes --- crates/hyperdrive-math/src/short/open.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/hyperdrive-math/src/short/open.rs b/crates/hyperdrive-math/src/short/open.rs index e26c010d9..229889618 100644 --- a/crates/hyperdrive-math/src/short/open.rs +++ b/crates/hyperdrive-math/src/short/open.rs @@ -152,16 +152,16 @@ impl State { /// $$ /// r_{implied} = \frac{r_{variable} - r_{effective}}{r_{effective}} /// $$ - /// + /// /// We can short-cut this calculation using the amount of base the short /// will pay and comparing this to the amount of base the short will receive /// if the variable rate stays the same. The implied rate is just the ROI /// if the variable rate stays the same. - /// + /// /// To do this, we must adjust the variable rate $r_{adjusted}$ according to /// the position duration $t$ and the variable yield source's compounding /// frequency $f$. The adjusted rate will be: - /// + /// /// $$ /// r_{adjusted} = ((1 + r_{variable})^{1/f})^{t*f}-1 /// $$ @@ -174,10 +174,9 @@ impl State { ) -> Result { let base_paid = self.calculate_open_short(bond_amount, open_vault_share_price)?; let base_proceeds = bond_amount - * (((fixed!(1e18) + variable_apy) - .pow(fixed!(1e18) / compounding_frequency)) - .pow(self.annualized_position_duration() * compounding_frequency) - - fixed!(1e18)); + * (((fixed!(1e18) + variable_apy).pow(fixed!(1e18) / compounding_frequency)) + .pow(self.annualized_position_duration() * compounding_frequency) + - fixed!(1e18)); if base_proceeds > base_paid { Ok(I256::try_from((base_proceeds - base_paid) / base_paid)?) } else {