@0dotxyz/p0-ts-sdk 2.5.0 → 2.5.1

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.cjs CHANGED
@@ -70724,6 +70724,13 @@ async function computeSmartCrank({
70724
70724
  isCrankable: true
70725
70725
  });
70726
70726
  }
70727
+ const activeEmodeWeightsByBank = computeLowestEmodeWeights(
70728
+ computeActiveEmodePairs(
70729
+ getEmodePairs(Array.from(bankMap.values())),
70730
+ liabilityBalances.map((b) => b.bankPk),
70731
+ assetBalances.map((b) => b.bankPk)
70732
+ )
70733
+ );
70727
70734
  const getBanks = (balances) => balances.map((b) => bankMap.get(b.bankPk.toBase58())).filter((bank) => bank !== void 0);
70728
70735
  const projectedAssetBanks = getBanks(assetBalances);
70729
70736
  const liabilityBanks = getBanks(liabilityBalances);
@@ -70808,7 +70815,8 @@ async function computeSmartCrank({
70808
70815
  oraclePricesByBank: oraclePrices,
70809
70816
  assetBanks: nonSWBAssets.map((b) => b.address),
70810
70817
  marginRequirement: 0 /* Initial */,
70811
- assetShareValueMultiplierByBank
70818
+ assetShareValueMultiplierByBank,
70819
+ activeEmodeWeightsByBank
70812
70820
  });
70813
70821
  const healthDiff = nonSWBAssetsHealth.minus(totalLiabilitiesInitHealth);
70814
70822
  if (healthDiff.gt(0)) {
@@ -70848,7 +70856,8 @@ async function computeSmartCrank({
70848
70856
  oraclePricesByBank: oraclePrices,
70849
70857
  assetBanks: allAvailableAssetAddresses,
70850
70858
  marginRequirement: 0 /* Initial */,
70851
- assetShareValueMultiplierByBank
70859
+ assetShareValueMultiplierByBank,
70860
+ activeEmodeWeightsByBank
70852
70861
  });
70853
70862
  const healthWithAllAssets = allAssetsHealth.minus(totalLiabilitiesInitHealth);
70854
70863
  if (!healthWithAllAssets.gt(0)) {
@@ -70885,7 +70894,8 @@ async function computeSmartCrank({
70885
70894
  oraclePricesByBank: oraclePrices,
70886
70895
  assetBanks: [...nonSWBAssetAddresses, ...comboAddresses],
70887
70896
  marginRequirement: 0 /* Initial */,
70888
- assetShareValueMultiplierByBank
70897
+ assetShareValueMultiplierByBank,
70898
+ activeEmodeWeightsByBank
70889
70899
  });
70890
70900
  const health = comboHealth.minus(totalLiabilitiesInitHealth);
70891
70901
  if (!health.gt(0)) continue;