Skip to content

Commit

Permalink
feat: add the new_averaged type for v2 vaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Nov 22, 2023
1 parent 15e0e19 commit 396483b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion processes/apr/current.v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ func computeCurrentV2VaultAPR(
** - The fees (performance and management)
** - The points (PPS evolution over time, for one week, one month and since inception)
**********************************************************************************************/
vaultAPRType := `v2:averaged`
twoWeeksAgoBlockNumber := ethereum.GetBlockNumberXDaysAgo(chainID, 14)
if vault.Activation > twoWeeksAgoBlockNumber {
vaultAPRType = `v2:new_averaged`
}

vaultAPR := TVaultAPR{
Type: "v2:averaged",
Type: vaultAPRType,
NetAPR: netAPR,
Fees: TFees{
Performance: vaultPerformanceFee,
Expand Down
1 change: 0 additions & 1 deletion processes/apr/current.v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func computeCurrentV3VaultAPR(
** - The points (PPS evolution over time, for one week, one month and since inception)
**********************************************************************************************/
vaultAPRType := `v3:averaged`

twoWeeksAgoBlockNumber := ethereum.GetBlockNumberXDaysAgo(chainID, 14)
if vault.Activation > twoWeeksAgoBlockNumber {
vaultAPRType = `v3:new_averaged`
Expand Down

0 comments on commit 396483b

Please sign in to comment.