@1delta/margin-fetcher 0.0.209 → 0.0.210
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
|
@@ -27350,6 +27350,21 @@ var midasFetcher = {
|
|
|
27350
27350
|
}
|
|
27351
27351
|
};
|
|
27352
27352
|
|
|
27353
|
+
// src/yields/intrinsic/fetchers/cap.ts
|
|
27354
|
+
var CAP_CUSD_TIMESERIES_URL = "https://api.cap.app/v1/vaults/1/0xcCcc62962d17b8914c62D74FfB843d73B2a3cccC/timeseries/1d_1M";
|
|
27355
|
+
var stcUSD = "Staked cap USD::stcUSD";
|
|
27356
|
+
var capFetcher = {
|
|
27357
|
+
label: "CAP",
|
|
27358
|
+
fetch: async () => {
|
|
27359
|
+
const res = await fetch(CAP_CUSD_TIMESERIES_URL).then((r) => r.json());
|
|
27360
|
+
const ts = res?.timeseries ?? [];
|
|
27361
|
+
const last7 = ts.slice(-7);
|
|
27362
|
+
if (last7.length === 0) return { [stcUSD]: 0 };
|
|
27363
|
+
const avg = last7.reduce((sum, e) => sum + Number(e.stakingApr), 0) / last7.length;
|
|
27364
|
+
return { [stcUSD]: avg * 100 };
|
|
27365
|
+
}
|
|
27366
|
+
};
|
|
27367
|
+
|
|
27353
27368
|
// src/yields/intrinsic/index.ts
|
|
27354
27369
|
async function fetchIntrinsicYields() {
|
|
27355
27370
|
const wstethPromise = safeFetch(wstethFetcher.label, wstethFetcher.fetch);
|
|
@@ -27400,7 +27415,8 @@ async function fetchIntrinsicYields() {
|
|
|
27400
27415
|
ondoFetcher,
|
|
27401
27416
|
syzusdFetcher,
|
|
27402
27417
|
susdfFetcher,
|
|
27403
|
-
midasFetcher
|
|
27418
|
+
midasFetcher,
|
|
27419
|
+
capFetcher
|
|
27404
27420
|
];
|
|
27405
27421
|
const results = await Promise.all([
|
|
27406
27422
|
wstethPromise,
|