Skip to content
bitzorcas
中EN

Concept

Legal Fee & Interest Calculation Engine

In-depth architecture of BitzOrcas.Platform.LegalCalculators: tiered court filing fees, asset preservation caps, and delayed performance compound interest.

Last updated

Legal Fee & Interest Calculation Engine

In legal technology and judicial case management, financial calculations demand strict mathematical precision and legal certainty:

  • Court Filing Fees: Calculated using progressive tiered brackets based on statutory judicial fee schedules, tolerating zero floating-point error;
  • Asset Preservation Fees: Tiered by preservation target amounts with a mandatory statutory ceiling of 5,000 RMB;
  • Delayed Performance Interest: Calculated via compound or benchmark daily interest rates (such as 0.0175% daily) with calendar date precision.

BitzOrcas.Platform.LegalCalculators is a zero-database-dependency, deterministic domain algorithm library engineered for sub-millisecond execution.


1. Tiered Court Filing Fee Algorithm

Calculations utilize C# high-precision decimal values to prevent binary floating-point rounding errors:

using System;
namespace BitzOrcas.Platform.LegalCalculators;
/// <summary>
/// Result record containing court filing fee calculations
/// </summary>
public sealed record LitigationFeeCalculationResult(
decimal ClaimAmount,
decimal StandardCourtFee,
decimal SummaryProcedureFee,
decimal ConciliationFee
);
/// <summary>
/// Deterministic court litigation fee calculator
/// </summary>
public static class CourtLitigationFeeCalculator
{
/// <summary>
/// Calculates standard first-instance court fees based on monetary claim amounts
/// </summary>
/// <param name="claimAmount">Total claim amount in standard currency</param>
/// <returns>Calculation result including full, summary, and conciliation amounts</returns>
public static LitigationFeeCalculationResult CalculatePropertyCaseFee(decimal claimAmount)
{
if (claimAmount <= 0)
{
return new LitigationFeeCalculationResult(0, 0, 0, 0);
}
decimal fee = 0;
// Tier 1: Up to 10,000 RMB: 50 RMB flat
if (claimAmount <= 10000m)
{
fee = 50m;
}
// Tier 2: 10,000 to 100,000 RMB: 2.5%
else if (claimAmount <= 100000m)
{
fee = 50m + (claimAmount - 10000m) * 0.025m;
}
// Tier 3: 100,000 to 200,000 RMB: 2%
else if (claimAmount <= 200000m)
{
fee = 50m + 90000m * 0.025m + (claimAmount - 100000m) * 0.02m;
}
// Tier 4: 200,000 to 500,000 RMB: 1.5%
else if (claimAmount <= 500000m)
{
fee = 50m + 90000m * 0.025m + 100000m * 0.02m + (claimAmount - 200000m) * 0.015m;
}
// Tier 5: 500,000 to 1,000,000 RMB: 1%
else if (claimAmount <= 1000000m)
{
fee = 50m + 90000m * 0.025m + 100000m * 0.02m + 300000m * 0.015m + (claimAmount - 500000m) * 0.01m;
}
// Tier 6: 1,000,000 to 2,000,000 RMB: 0.9%
else if (claimAmount <= 2000000m)
{
fee = 50m + 90000m * 0.025m + 100000m * 0.02m + 300000m * 0.015m + 500000m * 0.01m + (claimAmount - 1000000m) * 0.009m;
}
// Tier 7: 2,000,000 to 5,000,000 RMB: 0.8%
else if (claimAmount <= 5000000m)
{
fee = 50m + 90000m * 0.025m + 100000m * 0.02m + 300000m * 0.015m + 500000m * 0.01m + 1000000m * 0.009m + (claimAmount - 2000000m) * 0.008m;
}
// Tier 8: 5,000,000 to 10,000,000 RMB: 0.7%
else if (claimAmount <= 10000000m)
{
fee = 50m + 90000m * 0.025m + 100000m * 0.02m + 300000m * 0.015m + 500000m * 0.01m + 1000000m * 0.009m + 3000000m * 0.008m + (claimAmount - 5000000m) * 0.007m;
}
// Tier 9: 10,000,000 to 20,000,000 RMB: 0.6%
else if (claimAmount <= 20000000m)
{
fee = 50m + 90000m * 0.025m + 100000m * 0.02m + 300000m * 0.015m + 500000m * 0.01m + 1000000m * 0.009m + 3000000m * 0.008m + 5000000m * 0.007m + (claimAmount - 10000000m) * 0.006m;
}
// Tier 10: Over 20,000,000 RMB: 0.5%
else
{
fee = 50m + 90000m * 0.025m + 100000m * 0.02m + 300000m * 0.015m + 500000m * 0.01m + 1000000m * 0.009m + 3000000m * 0.008m + 5000000m * 0.007m + 10000000m * 0.006m + (claimAmount - 20000000m) * 0.005m;
}
var standardFee = Math.Round(fee, 2, MidpointRounding.AwayFromZero);
var halfFee = Math.Round(standardFee / 2m, 2, MidpointRounding.AwayFromZero);
return new LitigationFeeCalculationResult(
ClaimAmount: claimAmount,
StandardCourtFee: standardFee,
SummaryProcedureFee: halfFee,
ConciliationFee: halfFee
);
}
}

2. Asset Preservation Fee Algorithm (5,000 RMB Ceiling)

Asset preservation follows tiered brackets capped strictly at 5,000 RMB:

  • Up to 1,000 RMB: 30 RMB;
  • 1,000 to 100,000 RMB: 1%;
  • Over 100,000 RMB: 0.5%;
  • Absolute maximum cap: 5,000 RMB.
public static decimal CalculatePreservationFee(decimal preservationAmount)
{
if (preservationAmount <= 0) return 0m;
if (preservationAmount <= 1000m) return 30m;
decimal fee;
if (preservationAmount <= 100000m)
{
fee = 30m + (preservationAmount - 1000m) * 0.01m;
}
else
{
fee = 30m + 99000m * 0.01m + (preservationAmount - 100000m) * 0.005m;
}
// Enforce 5,000 RMB statutory ceiling
return Math.Min(Math.Round(fee, 2, MidpointRounding.AwayFromZero), 5000m);
}

3. Delayed Performance Penalty Interest Engine

Calculates statutory delayed judgment execution penalty interest:

Statutory Delayed Performance Penalty Formula: Delayed Interest = Unsatisfied Principal × Daily Statutory Rate (0.0175%) × Elapsed Days

public static decimal CalculateDelayedPerformanceInterest(
decimal principalAmount,
DateOnly startDate,
DateOnly endDate)
{
if (principalAmount <= 0 || endDate <= startDate)
{
return 0m;
}
var days = endDate.DayNumber - startDate.DayNumber;
const decimal dailyRate = 0.000175m; // 0.0175% daily statutory rate
var interest = principalAmount * dailyRate * days;
return Math.Round(interest, 2, MidpointRounding.AwayFromZero);
}

100%

Scroll or use controls to zoom · drag when enlarged · double-click for 100% / 200%