From e3d034f23cacac1e0e9bd0fc9834e81d1ae0cacc Mon Sep 17 00:00:00 2001 From: Tom Beynon Date: Fri, 17 May 2024 11:11:13 +0100 Subject: [PATCH] Replace dYdX APR API --- chains/chainMonitor.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/chains/chainMonitor.js b/chains/chainMonitor.js index ce9d384..6f74678 100644 --- a/chains/chainMonitor.js +++ b/chains/chainMonitor.js @@ -264,16 +264,10 @@ function ChainMonitor() { async function calculateApr(chain, annualProvision, bondedTokens, communityTax, blocksPerYear, actualBlocksPerYear) { const path = chain.path try { - if (path === 'dydx' && process.env.APYBARA_API_KEY) { - const opts = { - headers: { - 'X-ACCESS-KEY': `${process.env.APYBARA_API_KEY}` - }, - ...gotOpts - } - const aprRequest = await got.get("https://api.protocolstaking.info/v0/protocols/dydx", opts).json(); + if (path === 'dydx') { + const aprRequest = await got.get("https://api.lacertalabs.xyz/data/stakingapr", gotOpts).json(); return { - calculatedApr: aprRequest[0]?.rewardRate + calculatedApr: aprRequest['0']?.average_stakingapr } } else if (path === 'sifchain') { const aprRequest = await got.get("https://data.sifchain.finance/beta/validator/stakingRewards", gotOpts).json();