Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
solendvega committed Jun 23, 2022
1 parent 6ef230c commit 4a833e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ function getApp() {
return app;
}

export async function deserializeMarkets(data: MarketConfig[]): Promise<MarketConfig[]> {
return data;
}

export async function getMarkets(): Promise<MarketConfig[]> {
let attemptCount = 0;
let backoffFactor = 1;
Expand All @@ -43,7 +39,7 @@ export async function getMarkets(): Promise<MarketConfig[]> {
attemptCount += 1;
const resp = await got(`https://api.solend.fi/v1/markets/configs?deployment=${getApp()}`, { json: true });
const data = resp.body as MarketConfig[];
return await deserializeMarkets(data);
return data;
} catch (error) {
console.error('error fetching /v1/markets: ', error);
}
Expand Down
8 changes: 2 additions & 6 deletions src/libs/actions/liquidateAndRedeem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,10 @@ export const liquidateAndRedeem = async (
const reserveInfo: MarketConfigReserve = findWhere(lendingMarket!.reserves, {
address: reserveAddress,
});
const oracleInfo = {
priceAddress: reserveInfo.pythOracle,
switchboardFeedAddress: reserveInfo.switchboardOracle,
};
const refreshReserveIx = refreshReserveInstruction(
new PublicKey(reserveAddress),
new PublicKey(oracleInfo!.priceAddress),
new PublicKey(oracleInfo!.switchboardFeedAddress),
new PublicKey(reserveInfo.pythOracle),
new PublicKey(reserveInfo.switchboardOracle),
);
ixs.push(refreshReserveIx);
});
Expand Down

0 comments on commit 4a833e6

Please sign in to comment.