Skip to content

Commit

Permalink
fix: switch to stratAPR
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Dec 4, 2024
1 parent c86eae6 commit 02e2769
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions processes/apr/forward.v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@ func computeVaultV3ForwardAPY(
** the vault as expected APR
**********************************************************************************************/
var hasError error
if vault.Kind == models.VaultKindSingle {
expected, err := oracle.GetStrategyApr(nil, vault.Address, big.NewInt(0))
if err == nil {
oracleAPR = helpers.ToNormalizedAmount(bigNumber.SetInt(expected), 18)
} else {
hasError = err
}
expected, err := oracle.GetStrategyApr(nil, vault.Address, big.NewInt(0))
if err == nil {
oracleAPR = helpers.ToNormalizedAmount(bigNumber.SetInt(expected), 18)
} else {
hasError = err
}

if vault.Kind == models.VaultKindMultiple || hasError != nil {
if hasError != nil || oracleAPR.IsZero() {
expected, err := oracle.GetCurrentApr(nil, vault.Address)
if err == nil {
oracleAPR = helpers.ToNormalizedAmount(bigNumber.SetInt(expected), 18)
Expand Down

0 comments on commit 02e2769

Please sign in to comment.