first commit

This commit is contained in:
Isuru Bimsara
2026-08-14 22:46:02 +05:30
commit 81d0e65686
132 changed files with 24398 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
/**
* Copyright (c) 2026 Niolla
* All rights reserved.
*
* This source code is proprietary and confidential.
* Unauthorized copying, modification, distribution, or use
* of this file, via any medium, is strictly prohibited.
*/
// app/utils/basis.util.js
const calculateBasis = (marginPercent, usdRate) => {
if (!usdRate || usdRate <= 0) {
throw new Error("Invalid USD rate");
}
const multiplier = (100 + marginPercent) / 100; // e.g. 25% -> 1.25
const basis = multiplier / usdRate;
return Number(basis).toFixed(10);
};
module.exports = { calculateBasis };