Add company management module with registration and entity switching
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user