@1delta/margin-fetcher 0.0.303 → 0.0.304
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
|
@@ -38408,7 +38408,9 @@ function mapApiDetail(d, chainId, prices, tokenList) {
|
|
|
38408
38408
|
const totalAssetsRaw = String(d.totalAssets ?? "0");
|
|
38409
38409
|
const totalSupplyRaw = String(d.totalShares ?? "0");
|
|
38410
38410
|
const convertToAssets = d.exchangeRate != null ? rescaleExchangeRate(d.exchangeRate, decimals) : deriveConvertToAssets(totalAssetsRaw, totalSupplyRaw, decimals);
|
|
38411
|
-
const supplyRate =
|
|
38411
|
+
const supplyRate = apyToAprPercent(
|
|
38412
|
+
Number(d.supplyApy ?? d.apyCurrent ?? 0) || 0
|
|
38413
|
+
);
|
|
38412
38414
|
const availableRaw = safeBigInt2(d.availableAssets) || safeBigInt2(totalAssetsRaw);
|
|
38413
38415
|
const totalAssetsBig = safeBigInt2(totalAssetsRaw);
|
|
38414
38416
|
const liquidityRaw = (availableRaw > totalAssetsBig ? totalAssetsBig : availableRaw).toString();
|
|
@@ -38436,11 +38438,15 @@ function mapApiDetail(d, chainId, prices, tokenList) {
|
|
|
38436
38438
|
// The API doesn't surface the performance fee on this endpoint; the
|
|
38437
38439
|
// headline APY is already net, so 0 here only affects fee display.
|
|
38438
38440
|
fee: 0,
|
|
38439
|
-
owner
|
|
38440
|
-
|
|
38441
|
+
// owner/curator/guardian/feeRecipient + timelock live under
|
|
38442
|
+
// `governance`/`management` in the current API; fall back to the legacy
|
|
38443
|
+
// flat fields for older snapshots.
|
|
38444
|
+
timelock: Number(d.governance?.timelock ?? d.management?.timelockSeconds ?? 0) || void 0,
|
|
38445
|
+
owner: (d.governance?.owner ?? d.management?.owner ?? d.owner)?.toLowerCase(),
|
|
38446
|
+
curator: (d.governance?.curator ?? d.management?.curator ?? d.curator)?.toLowerCase(),
|
|
38441
38447
|
curatorName: curatorNameFromVaultName(d.name, assetMeta?.symbol),
|
|
38442
|
-
guardian: d.guardian?.toLowerCase(),
|
|
38443
|
-
feeRecipient: d.feeReceiver?.toLowerCase() || void 0,
|
|
38448
|
+
guardian: (d.governance?.guardian ?? d.management?.guardian ?? d.guardian)?.toLowerCase(),
|
|
38449
|
+
feeRecipient: (d.governance?.feeReceiver ?? d.management?.feeRecipient ?? d.feeReceiver)?.toLowerCase() || void 0,
|
|
38444
38450
|
asset: assetMeta,
|
|
38445
38451
|
priceUsd: priceUsd || void 0,
|
|
38446
38452
|
totalAssetsFormatted,
|