revert ma/health checks
This commit is contained in:
parent
8b6383f149
commit
3464953256
|
@ -253,14 +253,13 @@ const handleAlert = async (alert: any, db: any) => {
|
|||
mangoAccountPk,
|
||||
mangoGroup.dexProgramId
|
||||
)
|
||||
if (mangoAccount) {
|
||||
const walletPublicKey = mangoAccount.owner.toBase58()
|
||||
const health = await mangoAccount.getHealthRatio(
|
||||
mangoGroup,
|
||||
mangoCache,
|
||||
"Maint"
|
||||
)
|
||||
if (health && health.toNumber() <= parseFloat(alert.health)) {
|
||||
if (health.toNumber() <= parseFloat(alert.health)) {
|
||||
let message = MESSAGE.replace("@ratio@", alert.health)
|
||||
message +=
|
||||
"Deposit more collateral or reduce your liabilities to improve your account health. \n"
|
||||
|
@ -275,7 +274,6 @@ const handleAlert = async (alert: any, db: any) => {
|
|||
db.collection("alerts").deleteOne({ _id: alert._id })
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Error handling alert:", alert.mangoAccountPk, e)
|
||||
// sendLogsToDiscord(null, e)
|
||||
|
|
Loading…
Reference in New Issue