Financial Calculations & Valuation Beginner

Letter of Credit (LC) Usance Bill Discounting & Effective Yield Calculator in Python

Calculate upfront bill discounting interest, grace-period usance charges, handling commission, and effective annualized yield for trade finance LCs in Python.

#numpy

Problem Statement

In corporate trade finance, discounting a 90-day Usance Letter of Credit (LC) involves upfront interest deduction, transit/grace days, and flat bank commissions, making the true effective cost higher than the quoted discount rate.

Formula / Core Logic

Total_Tenor = Usance_Days + Grace_Days Discount_Interest = Bill_Value * (Discount_Rate / 100) * (Total_Tenor / 365) Net_Disbursement = Bill_Value - Discount_Interest - Commission Effective_Cost_PA = (Discount_Interest + Commission) / Net_Disbursement * (365 / Total_Tenor)

Installation

pip install numpy
letter-of-credit-lc-bill-discounting-usance-calculator-python.py
def calculate_lc_bill_discounting(bill_amount, usance_days=90, grace_days=3, discount_rate_pa=9.25, commission_pct=0.15):
    total_days = usance_days + grace_days
    discount_interest = bill_amount * (discount_rate_pa / 100.0) * (total_days / 365.0)
    commission = bill_amount * (commission_pct / 100.0)
    net_proceeds = bill_amount - discount_interest - commission
    
    effective_yield_pa = ((discount_interest + commission) / net_proceeds) * (365.0 / total_days) * 100.0
    return {
        'Gross_Bill_Amount': round(bill_amount, 2),
        'Chargeable_Days': total_days,
        'Upfront_Discount_Interest': round(discount_interest, 2),
        'Bank_Commission': round(commission, 2),
        'Net_Payout_To_Seller': round(net_proceeds, 2),
        'Effective_Annual_Cost_Pct': round(effective_yield_pa, 2)
    }

Get the Complete 100+ Python Quant & Automation Bundle

Instant lifetime access to all production-ready scripts, valuation models, and trading bots ($19).

Buy Full Bundle on Gumroad ($19) →

Frequently Asked Questions

Q: Why is Effective Annual Cost higher than the quoted 9.25% discount rate?

Because discount interest is deducted upfront on Day 1, meaning the borrower receives a smaller net principal (`Net_Payout_To_Seller`) while paying interest on the full face value.