Skip to content

Commit 2e9ff46

Browse files
committed
fix: get extra apy takes list by address now
1 parent 943d8e3 commit 2e9ff46

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/gearboxRewards/apy.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
PartialRecord,
32
PERCENTAGE_DECIMALS,
43
PERCENTAGE_FACTOR,
54
RAY,
@@ -69,7 +68,7 @@ interface GetPoolExtraLmAPYProps
6968
interface GetCAExtraAPYProps {
7069
assets: Array<Asset>;
7170
supply: Record<Address, bigint> | Record<Address, Asset>;
72-
rewardInfo: PartialRecord<SupportedToken, Array<FarmInfo>>;
71+
rewardInfo: Record<Address, Array<FarmInfo>>;
7372
currentTimestamp: number;
7473

7574
prices: Record<Address, bigint>;
@@ -195,10 +194,9 @@ export class GearboxRewardsApy {
195194
}: GetCAExtraAPYProps): Array<ExtraRewardApy> {
196195
const extra = assets.reduce((acc, asset) => {
197196
const { token } = asset;
198-
const { symbol } = restProps.tokensList[token] || {};
199-
const info = rewardInfo[symbol || ""];
197+
const info = rewardInfo[token || ""];
200198

201-
if (!info) return acc;
199+
if (!info || info.length === 0) return acc;
202200

203201
const extra = info.map(inf =>
204202
this.getCASingleExtraAPY_V3({

0 commit comments

Comments
 (0)