Closed DannyDelott closed 2 months ago
I'm confused about how it is different from calculate_spot_rate_after_short
https://github.com/delvtech/hyperdrive/blob/main/crates/hyperdrive-math/src/short/open.rs#L100
edit: ok I get it; this is the implied rate a short has to pay which is different from the spot rate after the short is opened. It'll be a function of base paid, fees, and the interest adjustment.
We talked about the algorithm to compute this offline. Let's assume that the amount of bonds that we're shorting is given by $\Delta y$.
For example, let's say that $r{effective} = 1%$ and $r{variable} = 10%$. The short will pay a deposit 1 base for every 100 bonds they short. They will receive 10 base at maturity for every 100 bonds that they short. This means that their implied rate is 900% which matches the formula of $\tfrac{0.1 - 0.01}{0.01} = 9$.
Adding a
calculate_implied_rate_for_open_short
to get the implied rate for opening a short will be very useful to show in the UI.https://github.com/delvtech/hyperdrive/blob/main/crates/hyperdrive-math/src/short/open.rs
From @jrhea:
it would be really helpful to show the implied rate when opening a short. it would be good bc it could inform users that shorts (at the current rate) are not profitable and it would also communicate the potential for multiplied exposure when the fixed is less than the variable
From @MazyGio:
there's currently no indication about how shorting at 21.90% fixed rate vs 3.6% variable rate seems like a very risky bet to take
https://discord.com/channels/754739461707006013/799343723086479421/1230937901823692881