Skip to content

Commit

Permalink
fix: prevent strategy apy calculation leaking between Avs (#311)
Browse files Browse the repository at this point in the history
Co-authored-by: Gowtham S <[email protected]>
  • Loading branch information
uditdc and gowthamsundaresan authored Dec 19, 2024
1 parent d6753eb commit 14e97ff
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/api/src/routes/operators/operatorController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,13 +563,6 @@ async function calculateOperatorApy(operator: any) {
}[]
}
> = new Map()
const strategyApyMap: Map<
string,
{
apy: number
tokens: Map<string, number>
}
> = new Map()

const tokenPrices = await fetchTokenPrices()
const strategiesWithSharesUnderlying = await getStrategiesWithShareUnderlying()
Expand All @@ -592,6 +585,14 @@ async function calculateOperatorApy(operator: any) {
return []

for (const avs of avsWithEligibleRewardSubmissions) {
const strategyApyMap: Map<
string,
{
apy: number
tokens: Map<string, number>
}
> = new Map()

const shares = withOperatorShares(avs.avs.operators).filter(
(s) => avs.avs.restakeableStrategies?.indexOf(s.strategyAddress.toLowerCase()) !== -1
)
Expand Down

0 comments on commit 14e97ff

Please sign in to comment.