Add company management module with registration and entity switching

This commit is contained in:
timurgordon
2025-05-05 13:58:51 +03:00
parent 2760f00a30
commit 9468595395
20 changed files with 2538 additions and 76 deletions

View File

@@ -411,18 +411,9 @@ document.addEventListener('DOMContentLoaded', function() {
if (liquidationUnitElement) liquidationUnitElement.textContent = assetUnit;
// Calculate collateral value
const amount = parseFloat(collateralAmountInput.value) || 0;
let collateralValue = 0;
if (assetType === 'token') {
// For tokens, calculate based on token price
const tokenPrice = assetValue / assetAmount;
collateralValue = amount * tokenPrice;
} else {
// For NFTs and other assets, use the full value if amount is 1
collateralValue = amount === 1 ? assetValue : 0;
liquidationPriceElement.value = (borrowedValue * 1.2).toFixed(2);
}
if (collateralValueElement) collateralValueElement.value = collateralValue.toFixed(2);
// Calculate max loan amount (75% of collateral value)