Skip to content

Commit

Permalink
Fix frontend error because of different assets
Browse files Browse the repository at this point in the history
  • Loading branch information
matejos committed Sep 17, 2024
1 parent 000d583 commit c9292c6
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions api3-aave-ui/src/helpers/compoundHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@ const compoundChainConfig = populateChainConfigs();
export async function getPrices(comet: any) {
const compoundMarket = populateCompoundMarket();

let [compPrice, wbtcPrice, wethPrice, usdcPrice] = await Promise.all([
comet.callStatic.getPrice(compoundMarket.priceFeeds.COMP),
comet.callStatic.getPrice(compoundMarket.priceFeeds.WBTC),
let [cbEthPrice, wethPrice, wstEthPrice] = await Promise.all([
comet.callStatic.getPrice(compoundMarket.priceFeeds.cbETH),
comet.callStatic.getPrice(compoundMarket.priceFeeds.WETH),
comet.callStatic.getPrice(compoundMarket.priceFeeds.USDC),
comet.callStatic.getPrice(compoundMarket.priceFeeds.wstETH),
]);
wbtcPrice /= Math.pow(10, 8);

usdcPrice /= Math.pow(10, 8);

cbEthPrice /= Math.pow(10, 8);
wethPrice /= Math.pow(10, 8);
compPrice /= Math.pow(10, 8);
wstEthPrice /= Math.pow(10, 8);

console.log({ compPrice, usdcPrice, wbtcPrice, wethPrice });
return [compPrice, wbtcPrice, wethPrice, usdcPrice];
console.log({ cbEthPrice, wethPrice, wstEthPrice });
return [cbEthPrice, wethPrice, wstEthPrice];
}

export async function getBorrowCapacity(
Expand Down

0 comments on commit c9292c6

Please sign in to comment.