@1delta/margin-fetcher 0.0.81 → 0.0.82
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.js
CHANGED
|
@@ -17649,7 +17649,8 @@ function generateLendingPairs(lenderData, prices, histPrices) {
|
|
|
17649
17649
|
eMode: long.eMode?.category ?? 0,
|
|
17650
17650
|
longTotalDepositsUSD: long.totalDepositsUSD,
|
|
17651
17651
|
longTotalDebtUSD: long.totalDebtUSD,
|
|
17652
|
-
|
|
17652
|
+
// if the asset cannot be borrowed, liquidity is not a pparameter for longing
|
|
17653
|
+
longTotalLiquidityUSD: long.borrowingEnabled ? long.totalLiquidityUSD : 1e10,
|
|
17653
17654
|
shortTotalDepositsUSD: short.totalDepositsUSD,
|
|
17654
17655
|
shortTotalDebtUSD: short.totalDebtUSD,
|
|
17655
17656
|
shortTotalLiquidityUSD: short.totalLiquidityUSD,
|
|
@@ -17953,6 +17954,7 @@ var jitoSol = "Jito Staked SOL::JitoSOL";
|
|
|
17953
17954
|
var thBill = "Theo Short Duration US Treasury Fund::THBILL";
|
|
17954
17955
|
var ssuperusd = "SuperReturn sSuperUSD::SSUPERUSD";
|
|
17955
17956
|
var hbhype = "hyperbeat x ether.fi HYPE::beHYPE";
|
|
17957
|
+
var hlp = "Wrapped HLP::WHLP";
|
|
17956
17958
|
var FeedData = {
|
|
17957
17959
|
WSTETH: "https://eth-api.lido.fi/v1/protocol/steth/apr/sma",
|
|
17958
17960
|
STMATIC: "https://polygon.lido.fi/api/stats",
|
|
@@ -17987,7 +17989,8 @@ var FeedData = {
|
|
|
17987
17989
|
THBILL: "https://thbill-api.theo.xyz/snapshots",
|
|
17988
17990
|
YEARN_KATANA: "https://katana-apr-service.vercel.app/api/vaults",
|
|
17989
17991
|
SSUPERUSD: "https://www.superreturn.ai/api/trpc/cmc.getUSDCPrice,rewardBackend.getYield,rewardBackend.getTvlChange?batch=1&input=%7B%220%22%3A%7B%22json%22%3Anull%2C%22meta%22%3A%7B%22values%22%3A%5B%22undefined%22%5D%7D%7D%2C%221%22%3A%7B%22json%22%3Anull%2C%22meta%22%3A%7B%22values%22%3A%5B%22undefined%22%5D%7D%7D%2C%222%22%3A%7B%22json%22%3Anull%2C%22meta%22%3A%7B%22values%22%3A%5B%22undefined%22%5D%7D%7D%7D",
|
|
17990
|
-
HBHYPE: "https://api.hyperbeat.org/api/v1/staking?address=0xCeaD893b162D38e714D82d06a7fe0b0dc3c38E0b"
|
|
17992
|
+
HBHYPE: "https://api.hyperbeat.org/api/v1/staking?address=0xCeaD893b162D38e714D82d06a7fe0b0dc3c38E0b",
|
|
17993
|
+
HLP: "https://api-ui.hyperliquid.xyz/info"
|
|
17991
17994
|
};
|
|
17992
17995
|
function averageDataLastN(arr, n = 7) {
|
|
17993
17996
|
const last = arr.slice(-n);
|
|
@@ -18259,6 +18262,22 @@ var fetchGeneralYields = async () => {
|
|
|
18259
18262
|
const vba = res?.data?.vaultByAddress;
|
|
18260
18263
|
return apyToAprPercent(vba.state.apy ?? 0) * 100 + (vba?.asset?.yield.apr ?? 0) * 100;
|
|
18261
18264
|
});
|
|
18265
|
+
const hlpPromise = safeFetch("HLP", async () => {
|
|
18266
|
+
const res = await fetch(FeedData.HLP, {
|
|
18267
|
+
method: "POST",
|
|
18268
|
+
headers: {
|
|
18269
|
+
Accept: "application/json",
|
|
18270
|
+
"Content-Type": "application/json"
|
|
18271
|
+
// <-- required
|
|
18272
|
+
},
|
|
18273
|
+
body: JSON.stringify({
|
|
18274
|
+
type: "vaultDetails",
|
|
18275
|
+
vaultAddress: "0xdfc24b077bc1425ad1dea75bcb6f8158e10df303"
|
|
18276
|
+
})
|
|
18277
|
+
}).then((r) => r.json());
|
|
18278
|
+
const apr = (res?.apr ?? 0) * 100;
|
|
18279
|
+
return apr;
|
|
18280
|
+
});
|
|
18262
18281
|
const rtokensPromise = safeFetch("RTOKENS", async () => {
|
|
18263
18282
|
const res = await fetch(FeedData.RTOKENS).then((r) => r.json());
|
|
18264
18283
|
const data2 = res.rtokens["8453"];
|
|
@@ -18355,7 +18374,8 @@ var fetchGeneralYields = async () => {
|
|
|
18355
18374
|
yearnKatanaData,
|
|
18356
18375
|
ssuperusdData,
|
|
18357
18376
|
hbhypeData,
|
|
18358
|
-
pendleData
|
|
18377
|
+
pendleData,
|
|
18378
|
+
hlpData
|
|
18359
18379
|
] = await Promise.all([
|
|
18360
18380
|
wstethPromise,
|
|
18361
18381
|
ezethPromise,
|
|
@@ -18392,7 +18412,8 @@ var fetchGeneralYields = async () => {
|
|
|
18392
18412
|
yearnKatanaPromise,
|
|
18393
18413
|
ssuperusdPromise,
|
|
18394
18414
|
hbhypePromise,
|
|
18395
|
-
pendlePromise
|
|
18415
|
+
pendlePromise,
|
|
18416
|
+
hlpPromise
|
|
18396
18417
|
]);
|
|
18397
18418
|
const data = {
|
|
18398
18419
|
intrinsicYields: {
|
|
@@ -18429,6 +18450,7 @@ var fetchGeneralYields = async () => {
|
|
|
18429
18450
|
[thBill]: thBillData,
|
|
18430
18451
|
[ssuperusd]: ssuperusdData,
|
|
18431
18452
|
[hbhype]: hbhypeData,
|
|
18453
|
+
[hlp]: hlpData,
|
|
18432
18454
|
...rtokensData,
|
|
18433
18455
|
...hypeData,
|
|
18434
18456
|
...angleData,
|