This commit is contained in:
Ralfs 2021-04-10 15:42:00 +03:00
parent 0b5580274d
commit 1aaec24536
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ const runCron = async () => {
const marginAccountPk = new PublicKey(alert.marginAccountPk);
const marginAccount = await client.getMarginAccount(connection, marginAccountPk, dexProgramId);
const collateralRatio = marginAccount.getCollateralRatio(mangoGroups[alert.mangoGroupPk]['mangoGroup'], mangoGroups[alert.mangoGroupPk]['prices']);
if (collateralRatio <= alert.collateralRatioThresh) {
if ((100 * collateralRatio) <= alert.collateralRatioThresh) {
let message = MESSAGE.replace('@ratio@', alert.collateralRatioThresh);
message += marginAccount.toPrettyString(
mangoGroups[alert.mangoGroupPk]['mangoGroup'],