@1delta/margin-fetcher-sol 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -6892,6 +6892,12 @@ interface JupiterPriceApiOptions extends HttpOptions {
|
|
|
6892
6892
|
apiKey?: string;
|
|
6893
6893
|
/** Mints per request. The API caps `ids` at 50. */
|
|
6894
6894
|
batchSize?: number;
|
|
6895
|
+
/**
|
|
6896
|
+
* Drop prices whose `liquidity` (USD, Jupiter's own field) is below this.
|
|
6897
|
+
* A long-tail mint can carry a price off a pool too thin to trade at it;
|
|
6898
|
+
* absent = keep every price, the behaviour the Exponent caller relies on.
|
|
6899
|
+
*/
|
|
6900
|
+
minLiquidityUsd?: number;
|
|
6895
6901
|
}
|
|
6896
6902
|
/**
|
|
6897
6903
|
* Jupiter's price feed, the price fetcher wired for Exponent.
|
package/dist/index.d.ts
CHANGED
|
@@ -6892,6 +6892,12 @@ interface JupiterPriceApiOptions extends HttpOptions {
|
|
|
6892
6892
|
apiKey?: string;
|
|
6893
6893
|
/** Mints per request. The API caps `ids` at 50. */
|
|
6894
6894
|
batchSize?: number;
|
|
6895
|
+
/**
|
|
6896
|
+
* Drop prices whose `liquidity` (USD, Jupiter's own field) is below this.
|
|
6897
|
+
* A long-tail mint can carry a price off a pool too thin to trade at it;
|
|
6898
|
+
* absent = keep every price, the behaviour the Exponent caller relies on.
|
|
6899
|
+
*/
|
|
6900
|
+
minLiquidityUsd?: number;
|
|
6895
6901
|
}
|
|
6896
6902
|
/**
|
|
6897
6903
|
* Jupiter's price feed, the price fetcher wired for Exponent.
|
package/dist/index.js
CHANGED
|
@@ -37541,6 +37541,8 @@ async function fetchJupiterPrices(mints, tokenList = {}, opts = {}) {
|
|
|
37541
37541
|
for (const [mint, r] of Object.entries(res ?? {})) {
|
|
37542
37542
|
const p = num(r?.usdPrice);
|
|
37543
37543
|
if (!(p > 0)) continue;
|
|
37544
|
+
if (opts.minLiquidityUsd !== void 0 && !(num(r?.liquidity) >= opts.minLiquidityUsd))
|
|
37545
|
+
continue;
|
|
37544
37546
|
byMint[mint] = p;
|
|
37545
37547
|
const stock = num(r?.stockData?.price);
|
|
37546
37548
|
if (stock > 0) stockPriceByMint[mint] = stock;
|