From 89c9ee19cea51eb1c972ed25278cd69350194364 Mon Sep 17 00:00:00 2001 From: Sindermann <163030670+Sindermann@users.noreply.github.com> Date: Mon, 22 Apr 2024 07:09:57 +0100 Subject: [PATCH] feat: updated to include wombat LPs (#1277) --- src/adaptors/yield-yak-aggregator/index.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/adaptors/yield-yak-aggregator/index.js b/src/adaptors/yield-yak-aggregator/index.js index 53bc3c914a..9fc7d09b7b 100644 --- a/src/adaptors/yield-yak-aggregator/index.js +++ b/src/adaptors/yield-yak-aggregator/index.js @@ -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);