Type d'instrument
Crédit documentaire (Import)
Crédit documentaire (Export)
Export LC (escompte)
SBLC / Garantie
Frais confirmation (%/an)
Spread FX (% du montant)
Frais fixes (SWIFT, avis, doc)
Simuler
Preset Import LC Confirmée
Preset Export LC Discount
Preset SBLC
@if (result is not null)
{
Résultats
Montant: @result.Currency @result.Amount:n2
Coût émission: @result.Currency @result.IssuanceFee:n2
@if (result.ConfirmFee > 0)
{
Coût confirmation: @result.Currency @result.ConfirmFee:n2
}
Intérêts financement/discount: @result.Currency @result.FinancingInterest:n2
@if (result.Insurance > 0)
{
Assurance: @result.Currency @result.Insurance:n2
}
@if (result.FXSpread > 0)
{
Spread FX: @result.Currency @result.FXSpread:n2
}
@if (result.FixedFees > 0)
{
Frais fixes: @result.Currency @result.FixedFees:n2
}
Coût total estimé: @result.Currency @result.TotalCost:n2
TAEG approx: @result.APRPct:n2 %
@if (result.NetProceeds > 0)
{
Net perçu (export): @result.Currency @result.NetProceeds:n2
}
}
@code {
TradeForm form = new()
{
Instrument = "ImportLC",
Amount = 100000m,
Currency = "USD",
TenorDays = 90,
FinanceRatePct = 9.0m,
IssuancePctPerAn = 1.5m,
ConfirmPctPerAn = 2.0m,
RiskFactor = 1.0m,
InsurancePct = 0.0m,
FXPct = 0.0m,
FixedFees = 350m
};
Result? result;
void Preset_ImportLC_Confirmed()
{
form = form with
{
Instrument = "ImportLC",
Amount = 250000m,
TenorDays = 120,
FinanceRatePct = 10.5m,
IssuancePctPerAn = 1.2m,
ConfirmPctPerAn = 2.5m,
RiskFactor = 1.2m,
InsurancePct = 0.0m,
FXPct = 0.35m,
FixedFees = 450m
};
StateHasChanged();
}
void Preset_ExportLC_Discount()
{
form = form with
{
Instrument = "ExportLCDiscounted",
Amount = 180000m,
TenorDays = 60,
FinanceRatePct = 8.0m,
IssuancePctPerAn = 0.8m,
ConfirmPctPerAn = 1.8m,
RiskFactor = 1.0m,
InsurancePct = 0.25m,
FXPct = 0.25m,
FixedFees = 300m
};
StateHasChanged();
}
void Preset_SBLC()
{
form = form with
{
Instrument = "SBLC",
Amount = 500000m,
TenorDays = 365,
FinanceRatePct = 0m,
IssuancePctPerAn = 2.0m,
ConfirmPctPerAn = 0m,
RiskFactor = 1.1m,
InsurancePct = 0.0m,
FXPct = 0.0m,
FixedFees = 600m
};
StateHasChanged();
}
void Compute()
{
decimal tenorFactor = (decimal)form.TenorDays / 360m;
decimal issuanceFee = form.Amount * (form.IssuancePctPerAn / 100m) * tenorFactor;
decimal confirmFee = 0m;
if (form.Instrument is "ImportLC" or "ExportLC" or "ExportLCDiscounted")
confirmFee = form.Amount * (form.ConfirmPctPerAn / 100m) * form.RiskFactor * tenorFactor;
decimal financedBase = form.Instrument == "ExportLCDiscounted" ? form.Amount : form.Amount;
decimal financingInterest = (form.FinanceRatePct > 0)
? financedBase * (form.FinanceRatePct / 100m) * tenorFactor
: 0m;
decimal insurance = form.Amount * (form.InsurancePct / 100m);
decimal fx = form.Amount * (form.FXPct / 100m);
// SBLC: uniquement commission + frais fixes (par défaut)
if (form.Instrument == "SBLC")
{
financingInterest = 0m;
confirmFee = 0m; // selon cas, peut exister si confirmée; à activer si besoin
}
decimal totalCost = issuanceFee + confirmFee + financingInterest + insurance + fx + form.FixedFees;
// Net perçu pour export discount: montant moins coûts liés (hypothèse)
decimal net = 0m;
if (form.Instrument == "ExportLCDiscounted")
net = form.Amount - (confirmFee + financingInterest + insurance + fx + form.FixedFees);
decimal apr = (form.TenorDays > 0)
? (double)(totalCost / form.Amount) / ((double)form.TenorDays / 360d) * 100d
: 0d;
result = new Result
{
Instrument = form.Instrument,
Amount = form.Amount,
Currency = form.Currency,
IssuanceFee = issuanceFee,
ConfirmFee = confirmFee,
FinancingInterest = financingInterest,
Insurance = insurance,
FXSpread = fx,
FixedFees = form.FixedFees,
TotalCost = totalCost,
APRPct = Math.Round(apr, 2),
NetProceeds = net
};
}
public record TradeForm
{
[Required] public string Instrument { get; init; } = "ImportLC";
[Range(1000, 100000000)] public decimal Amount { get; init; }
[Required] public string Currency { get; init; } = "USD";
[Range(1, 720)] public int TenorDays { get; init; }
[Range(0, 40)] public decimal FinanceRatePct { get; init; }
[Range(0, 10)] public decimal IssuancePctPerAn { get; init; }
[Range(0, 10)] public decimal ConfirmPctPerAn { get; init; }
[Range(0.5, 2.0)] public decimal RiskFactor { get; init; }
[Range(0, 5)] public decimal InsurancePct { get; init; }
[Range(0, 5)] public decimal FXPct { get; init; }
[Range(0, 1000000)] public decimal FixedFees { get; init; }
}
public class Result
{
public string Instrument { get; set; } = "";
public decimal Amount { get; set; }
public string Currency { get; set; } = "USD";
public decimal IssuanceFee { get; set; }
public decimal ConfirmFee { get; set; }
public decimal FinancingInterest { get; set; }
public decimal Insurance { get; set; }
public decimal FXSpread { get; set; }
public decimal FixedFees { get; set; }
public decimal TotalCost { get; set; }
public double APRPct { get; set; }
public decimal NetProceeds { get; set; }
}
}
");
}
bool showDetails = false;
void ToggleDetails()
{
showDetails = !showDetails;
}
decimal contractAmount = 0;
decimal financeRate = 0;
int durationMonths = 0;
decimal totalCost = 0;
void CalculateFinance()
{
var monthlyRate = financeRate / 100 / 12;
totalCost = contractAmount * (1 + monthlyRate * durationMonths);
}
[Inject]
HttpClient Http { get; set; }
string result = "";
async Task LoadData()
{
result = await Http.GetStringAsync("https://api.paymame.com/data");
}
ContactModel contact = new();
async Task SubmitForm()
{
await Http.PostAsJsonAsync("https://api.paymame.com/contact", contact);
}
string currentLanguage = "FR";
void SwitchLanguage()
{
currentLanguage = currentLanguage == "FR" ? "EN" : "FR";
}
bool isAnimated = false;
void TriggerAnimation()
{
isAnimated = true;
}
void OnExploreClick()
{
TriggerAnimation();
Console.WriteLine("Utilisateur explore PayMame");
NavigationManager.NavigateTo("/soboomzen");
}
}
Space professional