Skip to content

Commit

Permalink
fix: tokenSymbol return for rewardTokens
Browse files Browse the repository at this point in the history
  • Loading branch information
murka committed Dec 30, 2024
1 parent ce2df84 commit 0bd4d15
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/adaptors/evaa-protocol/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ const assets = {
tsTON: { assetId: sha256Hash("tsTON"), token: 'EQC98_qAmNEptUtPc7W6xdHh_ZHrBUFpw5Ft_IzNU20QAJav' },
};

function findAssetKeyByBigIntId(searchAssetId) {
return Object.entries(assets).find(([key, value]) =>
BigInt(value.assetId) === searchAssetId
)?.[0];
}


const MASTER_CONSTANTS = {
FACTOR_SCALE: BigInt(1e12),
Expand Down Expand Up @@ -380,7 +386,9 @@ const getApy = async () => {
);

const apyReward = apyRewardData ? apyRewardData.apy : undefined;
const rewardTokens = apyRewardData ? [apyRewardData.rewardsAssetId] : undefined;
const rewardTokens = apyRewardData
? [findAssetKeyByBigIntId(apyRewardData.rewardsAssetId)]
: undefined;

const apyRewardBorrowData = rewardApys.find(
(rewardApy) =>
Expand Down

0 comments on commit 0bd4d15

Please sign in to comment.