From 72922ea91cad99bb20f07e8f56201ceabd06aa0b Mon Sep 17 00:00:00 2001 From: reikodoteth <149171651+reikodoteth@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:40:14 +0100 Subject: [PATCH] Fix Goat Protocol yields (#1630) --- src/adaptors/goat-protocol/index.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/adaptors/goat-protocol/index.js b/src/adaptors/goat-protocol/index.js index a7a691da6d..d52de3a22b 100644 --- a/src/adaptors/goat-protocol/index.js +++ b/src/adaptors/goat-protocol/index.js @@ -1,10 +1,10 @@ const utils = require('../utils'); -const dappUrl = 'https://goat.fi'; +const dappUrl = 'https://app.goat.fi'; const url = 'https://api.goat.fi'; const urlApy = `${url}/apy`; const urlTvl = `${url}/tvl`; -const urlMeta = `${url}/vaults`; +const urlMeta = `${url}/multistrategies`; const networkMapping = { 42161: 'arbitrum', @@ -21,28 +21,22 @@ const main = async () => { if (apy[pool] === undefined) { continue; } - const poolMeta = meta.find((m) => m?.id === pool); - const platformId = poolMeta?.platformId; + const poolMeta = meta.find((m) => m?.address === pool); if (!poolMeta) continue; - const poolId = poolMeta.earnedTokenAddress; + const poolId = poolMeta.address; const isActive = poolMeta.status == 'active'; - const underlyingTokens = - poolMeta && poolMeta.assets.length === 1 && poolMeta.tokenAddress - ? [poolMeta.tokenAddress] - : undefined; + const underlyingTokens = poolMeta ? [poolMeta.asset] : undefined; data.push({ pool: `${poolId}-${networkMapping[chain]}`.toLowerCase(), chain: utils.formatChain(networkMapping[chain]), project: 'goat-protocol', - symbol: utils.formatSymbol(poolMeta?.assets.join('-')), + symbol: utils.formatSymbol(poolMeta.oracleId), tvlUsd: poolData[pool], apy: isActive ? apy[pool] * 100 : 0, - poolMeta: - platformId === undefined ? null : utils.formatChain(platformId), underlyingTokens, url: `${dappUrl}/#/${networkMapping[chain].toLowerCase()}/vault/${poolId}` });