@takentrade/takentrade-libs
Version:
TakeNTrade shared libraries
26 lines (25 loc) • 893 B
TypeScript
interface PenaltyTier {
maxDays: number;
rate: number;
}
/**
* Calculates the penalty rate based on the number of days a loan repayment is delayed.
* Uses predefined penalty tiers to determine the rate.
*
* @param delayInDays - The number of days the loan repayment is delayed.
* @returns The penalty rate as a decimal (e.g., 0.025 for 2.5%).
*/
export declare const calculatePenalty: (delayInDays: number) => number;
/**
* Calculates the penalty amount based on the principal and the number of days delayed.
*
* @param principal - The principal amount of the loan.
* @param delayInDays - The number of days the loan repayment is delayed.
* @returns The penalty amount.
*/
export declare const calculatePenaltyAmount: (principal: number, delayInDays: number) => number;
/**
* Get all penalty tiers
*/
export declare const getPenaltyTiers: () => PenaltyTier[];
export {};