From 70f3a1f4da58ee698af7eb5686eb0a43725bc990 Mon Sep 17 00:00:00 2001 From: Corey Caplan Date: Thu, 28 Dec 2023 08:56:25 -0500 Subject: [PATCH] Update oARB yields + GMX asset (#1129) * added base lending pools * reverted changes to package lock * reverted other weird change * Update tarot/index.js * updated borrowable + APYs * wip * added STIP rewards * updated yield rates for oARB" * removed duplicate pools --------- Co-authored-by: Corey --- src/adaptors/dolomite/index.js | 60 ++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/src/adaptors/dolomite/index.js b/src/adaptors/dolomite/index.js index 6b764077a9..dfeb1ddf90 100644 --- a/src/adaptors/dolomite/index.js +++ b/src/adaptors/dolomite/index.js @@ -13,13 +13,15 @@ const LINK_MARKET_ID = 3; const WBTC_MARKET_ID = 4; const ARB_MARKET_ID = 7; const USDC_MARKET_ID = 17; +const GMX_MARKET_ID = 30; const REWARD_TOKENS_TO_AMOUNTS_PER_WEEK = { - [WETH_MARKET_ID]: 22_500, - [LINK_MARKET_ID]: 2_700, - [WBTC_MARKET_ID]: 22_500, - [ARB_MARKET_ID]: 6_300, - [USDC_MARKET_ID]: 36_000, + [WETH_MARKET_ID]: 17_325, + [LINK_MARKET_ID]: 2_080, + [WBTC_MARKET_ID]: 17_325, + [ARB_MARKET_ID]: 4_850, + [USDC_MARKET_ID]: 27_720, + [GMX_MARKET_ID]: 2_700, }; const rewardEndTimestamp = 1708041600; // Fri Feb 16 2024 00:00:00 GMT+0000 @@ -143,7 +145,10 @@ async function apy() { const names = namesRes.output.map((o) => o.output); for (let i = 0; i < names.length; i++) { - if (names[i] === 'Dolomite: Fee + Staked GLP' || names[i].includes('Dolomite Isolation:')) { + if (names[i] === 'Dolomite Isolation: Arbitrum' || names[i] === 'GMX') { + tokens[i] = undefined; + symbols[i] = undefined; + } else if (names[i] === 'Dolomite: Fee + Staked GLP' || names[i].includes('Dolomite Isolation:')) { const underlyingToken = await sdk.api.abi.call({ abi: isolationModeAbi.find((i) => i.name === 'UNDERLYING_TOKEN'), target: tokens[i], @@ -182,25 +187,30 @@ async function apy() { } }); - return range.map(i => ({ - pool: `${tokens[i]}-${chain}`.toLowerCase(), - symbol: symbols[i], - chain: chain.charAt(0).toUpperCase() + chain.slice(1), - project: 'dolomite', - tvlUsd: supplyUsds[i] - borrowUsds[i], - apyBase: supplyInterestRateApys[i], - apyReward: rewardApys[i], - underlyingTokens: [tokens[i]], - rewardTokens: [ARB], - apyBaseBorrow: borrowInterestRateApys[i], - apyRewardBorrow: 0, - totalSupplyUsd: supplyUsds[i], - totalBorrowUsd: borrowUsds[i], - ltv: 1 / ((1 + marginRatio) + ((1 + marginRatio) * marginPremiums[i])), - poolMeta: 'Dolomite Balance', - url: `https://app.dolomite.io/stats/token/${tokens[i].toLowerCase()}`, - borrowable: borrowables[i], - })) + return range.reduce((acc, i) => { + if (tokens[i]) { + acc.push({ + pool: `${tokens[i]}-${chain}`.toLowerCase(), + symbol: symbols[i], + chain: chain.charAt(0).toUpperCase() + chain.slice(1), + project: 'dolomite', + tvlUsd: supplyUsds[i] - borrowUsds[i], + apyBase: supplyInterestRateApys[i], + apyReward: rewardApys[i], + underlyingTokens: [tokens[i]], + rewardTokens: [ARB], + apyBaseBorrow: borrowInterestRateApys[i], + apyRewardBorrow: 0, + totalSupplyUsd: supplyUsds[i], + totalBorrowUsd: borrowUsds[i], + ltv: 1 / ((1 + marginRatio) + ((1 + marginRatio) * marginPremiums[i])), + poolMeta: 'Dolomite Balance', + url: `https://app.dolomite.io/stats/token/${tokens[i].toLowerCase()}`, + borrowable: borrowables[i], + }) + } + return acc + }, []) }, []); }