Skip to content

Commit

Permalink
feat: updated to include wombat LPs (#1277)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sindermann authored Apr 22, 2024
1 parent b5a6adb commit 89c9ee1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/adaptors/yield-yak-aggregator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,17 @@ const main = async () => {
(farm.totalDeposits / farm.lpToken.supply);
}
} else {
const tokenSymbol = farm.depositToken.address.toLowerCase();
const tokenName = farm.name.toLowerCase();
const tokenPrice =
pricesByAddress[tokenSymbol] || pricesBySymbol[tokenName];
let tokenPrice = 0;

if (farm.platform == 'wombat') {
const tokenSymbol = farm.depositToken.underlying[0].toLowerCase();
tokenPrice = pricesByAddress[tokenSymbol];
} else {
const tokenSymbol = farm.depositToken.address.toLowerCase();
const tokenName = farm.name.toLowerCase();
tokenPrice =
pricesByAddress[tokenSymbol] || pricesBySymbol[tokenName];
}

if (farm.depositToken.stablecoin) tvlUsd = Number(farm.totalDeposits);
else if (tokenPrice) tvlUsd = tokenPrice * Number(farm.totalDeposits);
Expand Down

0 comments on commit 89c9ee1

Please sign in to comment.