Skip to content

Commit

Permalink
Update oARB yields + GMX asset (#1129)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
coreycaplan3 and Corey authored Dec 28, 2023
1 parent b8374f1 commit 70f3a1f
Showing 1 changed file with 35 additions and 25 deletions.
60 changes: 35 additions & 25 deletions src/adaptors/dolomite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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
}, [])
}, []);
}

Expand Down

0 comments on commit 70f3a1f

Please sign in to comment.