From fcb82e3695bc10d0d6f9dd87b0851dbef69818ba Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Thu, 7 Sep 2023 18:22:21 +0530 Subject: [PATCH] Collateral calculation bug fix --- index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index d5b6eed..91adb85 100644 --- a/index.html +++ b/index.html @@ -454,7 +454,8 @@ -

Collateral amount: ${formatAmount((loanAmount / floGlobals.btcRate) * loan_collateral_ratio)}

+ +

Collateral amount: ${formatAmount(btcMortgage.util.calcRequiredCollateral((loanAmount / floGlobals.btcRate), loan_collateral_ratio))}

Collateral amount
-

${formatAmount((loanAmount / floGlobals.btcRate) * loan_collateral_ratio)}

+

${formatAmount(btcMortgage.util.calcRequiredCollateral((loanAmount / floGlobals.btcRate), loan_collateral_ratio))}

Collateral provider
@@ -653,7 +654,7 @@ const [verifyingCollateral, setVerifyCollateral] = useState(false) let collateralAmount = 0 if (!isLender) - collateralAmount = btcMortgage.util.toFixedDecimal(btcMortgage.policies[policyID]?.loan_collateral_ratio * (loanAmount / floGlobals.btcRate)) || 0 + collateralAmount = btcMortgage.util.calcRequiredCollateral((loanAmount / floGlobals.btcRate), btcMortgage.policies[policyID]?.loan_collateral_ratio) || 0 async function verifyCollateral(e) { const confirmation = await getConfirmation('Verify collateral?', { message: `You are about to check for ${formatAmount(collateralAmount)} as collateral. Continue?`, confirmText: 'Verify', cancelText: 'Cancel' }) if (!confirmation)