@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.js CHANGED
@@ -70696,6 +70696,13 @@ async function computeSmartCrank({
70696
70696
  isCrankable: true
70697
70697
  });
70698
70698
  }
70699
+ const activeEmodeWeightsByBank = computeLowestEmodeWeights(
70700
+ computeActiveEmodePairs(
70701
+ getEmodePairs(Array.from(bankMap.values())),
70702
+ liabilityBalances.map((b) => b.bankPk),
70703
+ assetBalances.map((b) => b.bankPk)
70704
+ )
70705
+ );
70699
70706
  const getBanks = (balances) => balances.map((b) => bankMap.get(b.bankPk.toBase58())).filter((bank) => bank !== void 0);
70700
70707
  const projectedAssetBanks = getBanks(assetBalances);
70701
70708
  const liabilityBanks = getBanks(liabilityBalances);
@@ -70780,7 +70787,8 @@ async function computeSmartCrank({
70780
70787
  oraclePricesByBank: oraclePrices,
70781
70788
  assetBanks: nonSWBAssets.map((b) => b.address),
70782
70789
  marginRequirement: 0 /* Initial */,
70783
- assetShareValueMultiplierByBank
70790
+ assetShareValueMultiplierByBank,
70791
+ activeEmodeWeightsByBank
70784
70792
  });
70785
70793
  const healthDiff = nonSWBAssetsHealth.minus(totalLiabilitiesInitHealth);
70786
70794
  if (healthDiff.gt(0)) {
@@ -70820,7 +70828,8 @@ async function computeSmartCrank({
70820
70828
  oraclePricesByBank: oraclePrices,
70821
70829
  assetBanks: allAvailableAssetAddresses,
70822
70830
  marginRequirement: 0 /* Initial */,
70823
- assetShareValueMultiplierByBank
70831
+ assetShareValueMultiplierByBank,
70832
+ activeEmodeWeightsByBank
70824
70833
  });
70825
70834
  const healthWithAllAssets = allAssetsHealth.minus(totalLiabilitiesInitHealth);
70826
70835
  if (!healthWithAllAssets.gt(0)) {
@@ -70857,7 +70866,8 @@ async function computeSmartCrank({
70857
70866
  oraclePricesByBank: oraclePrices,
70858
70867
  assetBanks: [...nonSWBAssetAddresses, ...comboAddresses],
70859
70868
  marginRequirement: 0 /* Initial */,
70860
- assetShareValueMultiplierByBank
70869
+ assetShareValueMultiplierByBank,
70870
+ activeEmodeWeightsByBank
70861
70871
  });
70862
70872
  const health = comboHealth.minus(totalLiabilitiesInitHealth);
70863
70873
  if (!health.gt(0)) continue;