Socket
Socket
Sign inDemoInstall

@blockworks-foundation/mango-v4

Package Overview
Dependencies
Maintainers
7
Versions
239
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blockworks-foundation/mango-v4 - npm Package Compare versions

Comparing version 0.16.8 to 0.16.9

10

dist/cjs/src/accounts/healthCache.js

@@ -763,6 +763,4 @@ "use strict";

function healthAfterPriceChange(newPrice) {
const gClone = (0, cloneDeep_1.default)(group);
gClone.getPerpMarketByMarketIndex(perpMarket.perpMarketIndex)._price =
newPrice;
const hc = HealthCache.fromMangoAccount(gClone, mangoAccount);
const pi = hc.perpInfos[hc.findPerpInfoIndex(perpPosition.marketIndex)];
pi.prices.oracle = newPrice;
return hc.health(mangoAccount_1.HealthType.maint);

@@ -776,6 +774,6 @@ }

}
return HealthCache.binaryApproximationSearch(zero, healthAtPriceZero, perpMarket.price, (0, I80F48_1.ZERO_I80F48)(), perpMarket.priceLotsToNative(new anchor_1.BN(1)), healthAfterPriceChange, { maxIterations: 20 });
return HealthCache.binaryApproximationSearch(zero, healthAtPriceZero, perpMarket.price, (0, I80F48_1.ZERO_I80F48)(), perpMarket.priceLotsToNative(new anchor_1.BN(1)), healthAfterPriceChange);
}
const price1000x = perpMarket.price.mul(I80F48_1.I80F48.fromNumber(1000));
return HealthCache.binaryApproximationSearch(perpMarket.price, hc.health(mangoAccount_1.HealthType.maint), price1000x, (0, I80F48_1.ZERO_I80F48)(), perpMarket.priceLotsToNative(new anchor_1.BN(1)), healthAfterPriceChange, { maxIterations: 20 });
return HealthCache.binaryApproximationSearch(perpMarket.price, hc.health(mangoAccount_1.HealthType.maint), price1000x, (0, I80F48_1.ZERO_I80F48)(), perpMarket.priceLotsToNative(new anchor_1.BN(1)), healthAfterPriceChange);
}

@@ -782,0 +780,0 @@ }

@@ -757,6 +757,4 @@ import { BN } from '@coral-xyz/anchor';

function healthAfterPriceChange(newPrice) {
const gClone = cloneDeep(group);
gClone.getPerpMarketByMarketIndex(perpMarket.perpMarketIndex)._price =
newPrice;
const hc = HealthCache.fromMangoAccount(gClone, mangoAccount);
const pi = hc.perpInfos[hc.findPerpInfoIndex(perpPosition.marketIndex)];
pi.prices.oracle = newPrice;
return hc.health(HealthType.maint);

@@ -770,6 +768,6 @@ }

}
return HealthCache.binaryApproximationSearch(zero, healthAtPriceZero, perpMarket.price, ZERO_I80F48(), perpMarket.priceLotsToNative(new BN(1)), healthAfterPriceChange, { maxIterations: 20 });
return HealthCache.binaryApproximationSearch(zero, healthAtPriceZero, perpMarket.price, ZERO_I80F48(), perpMarket.priceLotsToNative(new BN(1)), healthAfterPriceChange);
}
const price1000x = perpMarket.price.mul(I80F48.fromNumber(1000));
return HealthCache.binaryApproximationSearch(perpMarket.price, hc.health(HealthType.maint), price1000x, ZERO_I80F48(), perpMarket.priceLotsToNative(new BN(1)), healthAfterPriceChange, { maxIterations: 20 });
return HealthCache.binaryApproximationSearch(perpMarket.price, hc.health(HealthType.maint), price1000x, ZERO_I80F48(), perpMarket.priceLotsToNative(new BN(1)), healthAfterPriceChange);
}

@@ -776,0 +774,0 @@ }

2

package.json
{
"name": "@blockworks-foundation/mango-v4",
"version": "0.16.8",
"version": "0.16.9",
"description": "Typescript Client for mango-v4 program.",

@@ -5,0 +5,0 @@ "repository": "https://github.com/blockworks-foundation/mango-v4",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc