@haven-fi/solauto-sdk 1.0.30 → 1.0.31
Sign up to get free protection for your applications and to get access to all the features.
@@ -50,7 +50,7 @@ async function getTokenPrices(mints) {
|
|
50
50
|
console.log("Accessing price cache");
|
51
51
|
return mints.map((mint) => solautoConstants_1.PRICES[mint.toString()].price);
|
52
52
|
}
|
53
|
-
console.log(
|
53
|
+
console.log(`Fetching prices for ${mints.join(", ")}`);
|
54
54
|
const priceFeedIds = mints.map((mint) => pythConstants_1.PYTH_PRICE_FEED_IDS[mint.toString()]);
|
55
55
|
const getReq = async () => await fetch(`https://hermes.pyth.network/v2/updates/price/latest?${priceFeedIds.map((x) => `ids%5B%5D=${x}`).join("&")}`);
|
56
56
|
let resp = await getReq();
|
package/package.json
CHANGED
@@ -58,7 +58,7 @@ export async function getTokenPrices(mints: PublicKey[]): Promise<number[]> {
|
|
58
58
|
return mints.map((mint) => PRICES[mint.toString()].price);
|
59
59
|
}
|
60
60
|
|
61
|
-
console.log(
|
61
|
+
console.log(`Fetching prices for ${mints.join(", ")}`);
|
62
62
|
const priceFeedIds = mints.map(
|
63
63
|
(mint) => PYTH_PRICE_FEED_IDS[mint.toString()]
|
64
64
|
);
|
@@ -261,6 +261,7 @@ describe("Rebalance tests", async () => {
|
|
261
261
|
let supplyPrice: number, debtPrice: number;
|
262
262
|
|
263
263
|
before(async () => {
|
264
|
+
console.log("Fetching prices for test");
|
264
265
|
[supplyPrice, debtPrice] = await getTokenPrices([
|
265
266
|
NATIVE_MINT,
|
266
267
|
new PublicKey(USDC_MINT),
|