diff --git a/src/auditor/borrowLimit.ts b/src/auditor/borrowLimit.ts index ec4d809..52ffc4f 100644 --- a/src/auditor/borrowLimit.ts +++ b/src/auditor/borrowLimit.ts @@ -1,10 +1,11 @@ import accountLiquidity, { normalizeDebt, type AccountLiquidityData } from "./accountLiquidity.js"; +import WAD from "../fixed-point-math/WAD.js"; import divWad from "../fixed-point-math/divWad.js"; export default function borrowLimit( data: AccountLiquidityData, market: string, - targetHealthFactor = BigInt(1.25 * 10 ** 18), + targetHealthFactor = (WAD * 105n) / 100n, timestamp = Math.floor(Date.now() / 1000), ): bigint { const { adjCollateral, adjDebt } = accountLiquidity(data, timestamp); diff --git a/src/auditor/withdrawLimit.ts b/src/auditor/withdrawLimit.ts index 9826348..ff46569 100644 --- a/src/auditor/withdrawLimit.ts +++ b/src/auditor/withdrawLimit.ts @@ -1,11 +1,12 @@ import type { AccountLiquidityData } from "./accountLiquidity.js"; import accountLiquidity, { adjustCollateral, normalizeCollateral } from "./accountLiquidity.js"; +import WAD from "../fixed-point-math/WAD.js"; import mulWad from "../fixed-point-math/mulWad.js"; export default function withdrawLimit( data: AccountLiquidityData, market: string, - targetHealthFactor = BigInt(1.25 * 10 ** 18), + targetHealthFactor = (WAD * 105n) / 100n, timestamp = Math.floor(Date.now() / 1000), ): bigint { const { adjCollateral, adjDebt } = accountLiquidity(data, timestamp);