@1delta/margin-fetcher 0.0.167 → 0.0.168
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
|
@@ -7977,7 +7977,8 @@ var BLOCK_TIMES = {
|
|
|
7977
7977
|
[Chain.POLYGON_MAINNET]: 2,
|
|
7978
7978
|
[Chain.BASE]: 1,
|
|
7979
7979
|
[Chain.CRONOS_MAINNET]: 0.5,
|
|
7980
|
-
[Chain.AVALANCHE_C_CHAIN]: 1
|
|
7980
|
+
[Chain.AVALANCHE_C_CHAIN]: 1,
|
|
7981
|
+
[Chain.CORE_BLOCKCHAIN_MAINNET]: 3
|
|
7981
7982
|
};
|
|
7982
7983
|
var SECONDS_PER_YEAR = 31536e3;
|
|
7983
7984
|
var apyToApr = (apy) => {
|
|
@@ -25754,6 +25755,22 @@ var mapleFetcher = {
|
|
|
25754
25755
|
}
|
|
25755
25756
|
};
|
|
25756
25757
|
|
|
25758
|
+
// src/yields/fetchers/ondo.ts
|
|
25759
|
+
var ONDO_BASE_URL = "https://app.ondo.finance/api/v2/assets";
|
|
25760
|
+
var ondoFetcher = {
|
|
25761
|
+
label: "ONDO",
|
|
25762
|
+
fetch: async () => {
|
|
25763
|
+
const [ousgRes, usdyRes] = await Promise.all([
|
|
25764
|
+
fetch(`${ONDO_BASE_URL}/ousg/info`).then((r) => r.json()),
|
|
25765
|
+
fetch(`${ONDO_BASE_URL}/usdy/info`).then((r) => r.json())
|
|
25766
|
+
]);
|
|
25767
|
+
return {
|
|
25768
|
+
OUSG: apyToAprPercent(Number(ousgRes?.primaryMarket?.apy ?? 0)),
|
|
25769
|
+
USDY: apyToAprPercent(Number(usdyRes?.primaryMarket?.apy ?? 0))
|
|
25770
|
+
};
|
|
25771
|
+
}
|
|
25772
|
+
};
|
|
25773
|
+
|
|
25757
25774
|
// src/yields/fetchGeneralYields.ts
|
|
25758
25775
|
var fetchGeneralYields = async () => {
|
|
25759
25776
|
const wstethPromise = safeFetch(wstethFetcher.label, wstethFetcher.fetch);
|
|
@@ -25800,15 +25817,14 @@ var fetchGeneralYields = async () => {
|
|
|
25800
25817
|
gmxFetcher,
|
|
25801
25818
|
pendleFetcher,
|
|
25802
25819
|
usdaiFetcher,
|
|
25803
|
-
mapleFetcher
|
|
25820
|
+
mapleFetcher,
|
|
25821
|
+
ondoFetcher
|
|
25804
25822
|
];
|
|
25805
25823
|
const [wstethData, ...results] = await Promise.all([
|
|
25806
25824
|
wstethPromise,
|
|
25807
25825
|
...fetchers.map((f) => safeFetch(f.label, f.fetch))
|
|
25808
25826
|
]);
|
|
25809
|
-
const intrinsicYields = {
|
|
25810
|
-
USDY: 4.35
|
|
25811
|
-
};
|
|
25827
|
+
const intrinsicYields = {};
|
|
25812
25828
|
if (wstethData) Object.assign(intrinsicYields, wstethData);
|
|
25813
25829
|
for (const result of results) {
|
|
25814
25830
|
if (result) Object.assign(intrinsicYields, result);
|