Skip to content

Commit

Permalink
Merge branch 'replace-dydx-apr-api' into release-v0.5.16
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed May 17, 2024
2 parents 9c9c547 + e3d034f commit a45b014
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions chains/chainMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,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();
Expand Down

0 comments on commit a45b014

Please sign in to comment.