diff --git a/packages/api/src/routes/operators/operatorController.ts b/packages/api/src/routes/operators/operatorController.ts index c19dc16b..738b95b0 100644 --- a/packages/api/src/routes/operators/operatorController.ts +++ b/packages/api/src/routes/operators/operatorController.ts @@ -237,16 +237,18 @@ export async function getOperator(req: Request, res: Response) { const strategiesWithSharesUnderlying = withTvl ? await getStrategiesWithShareUnderlying() : [] + const rewardsMap = + withRewards || withTrailingApy + ? await calculateOperatorApyForAll([operator], withTrailingApy) + : {} + res.send({ ...operator, avsRegistrations, totalStakers: operator.totalStakers, totalAvs: operator.totalAvs, tvl: withTvl ? sharesToTVL(operator.shares, strategiesWithSharesUnderlying) : undefined, - rewards: - withRewards || withTrailingApy - ? await calculateOperatorApyForAll([operator], withTrailingApy) - : undefined, + rewards: withRewards || withTrailingApy ? rewardsMap[operator.address] : undefined, stakers: undefined, metadataUrl: undefined, isMetadataSynced: undefined,