From 2e9ff46712f6043a3800f4f6dbdba121610f9ed6 Mon Sep 17 00:00:00 2001 From: esser Date: Tue, 14 Jan 2025 17:18:46 +0800 Subject: [PATCH] fix: get extra apy takes list by address now --- src/gearboxRewards/apy.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gearboxRewards/apy.ts b/src/gearboxRewards/apy.ts index 50e23cd5..7fae53e9 100644 --- a/src/gearboxRewards/apy.ts +++ b/src/gearboxRewards/apy.ts @@ -1,5 +1,4 @@ import { - PartialRecord, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, RAY, @@ -69,7 +68,7 @@ interface GetPoolExtraLmAPYProps interface GetCAExtraAPYProps { assets: Array; supply: Record | Record; - rewardInfo: PartialRecord>; + rewardInfo: Record>; currentTimestamp: number; prices: Record; @@ -195,10 +194,9 @@ export class GearboxRewardsApy { }: GetCAExtraAPYProps): Array { const extra = assets.reduce((acc, asset) => { const { token } = asset; - const { symbol } = restProps.tokensList[token] || {}; - const info = rewardInfo[symbol || ""]; + const info = rewardInfo[token || ""]; - if (!info) return acc; + if (!info || info.length === 0) return acc; const extra = info.map(inf => this.getCASingleExtraAPY_V3({