Skip to content

Commit

Permalink
fix: get extra apy takes list by address now
Browse files Browse the repository at this point in the history
  • Loading branch information
essserrr committed Jan 14, 2025
1 parent 943d8e3 commit 2e9ff46
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/gearboxRewards/apy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
PartialRecord,
PERCENTAGE_DECIMALS,
PERCENTAGE_FACTOR,
RAY,
Expand Down Expand Up @@ -69,7 +68,7 @@ interface GetPoolExtraLmAPYProps
interface GetCAExtraAPYProps {
assets: Array<Asset>;
supply: Record<Address, bigint> | Record<Address, Asset>;
rewardInfo: PartialRecord<SupportedToken, Array<FarmInfo>>;
rewardInfo: Record<Address, Array<FarmInfo>>;
currentTimestamp: number;

prices: Record<Address, bigint>;
Expand Down Expand Up @@ -195,10 +194,9 @@ export class GearboxRewardsApy {
}: GetCAExtraAPYProps): Array<ExtraRewardApy> {
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({
Expand Down

0 comments on commit 2e9ff46

Please sign in to comment.