{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Calculations","siteUrl":"https://docs.peachfinance.com","description":"API and product documentation for Peach Finance, a lending-as-a-service platform.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"calculations","__idx":0},"children":["Calculations"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"obligation-and-balance-calculations","__idx":1},"children":["Obligation and Balance Calculations"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"scheduled-monthly-payment-amount","__idx":2},"children":["Scheduled Monthly Payment Amount"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Field 13:"]}," Scheduled Monthly Payment Amount"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This field represents the regular payment amount due."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Calculation:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"IF snapshot.loan_status IN ('ChargedOff', 'PaidOff'):\n  scheduled_payment = 0\nELIF lender_supplied_account_status = '97':  # ChargedOff\n  scheduled_payment = 0\nELSE:\n  # Get current period obligation\n  obligation = find_obligation_in_period(month_start, month_end)\n  IF obligation:\n    scheduled_payment = obligation.obligation_amount\n  ELSE:\n    scheduled_payment = 0\n\nRETURN round_to_whole_dollars(scheduled_payment)\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"amount-past-due","__idx":3},"children":["Amount Past Due"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Field 22:"]}," Amount Past Due"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This field reports the total amount that is past due on the account."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Calculation:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"FUNCTION calculate_amount_past_due(loan, snapshot, lender_supplied_status):\n  # Priority 1: Paid-in-full statuses always report zero\n  IF lender_supplied_status IN ('61', '62', '63'):  # Paid in full statuses\n    RETURN 0\n  \n  # Priority 2: Voluntary Surrender when account is current\n  IF lender_supplied_status = '95' AND account_is_current:\n    RETURN 0\n  \n  # Priority 3: Based on loan status\n  IF snapshot.loan_status IN ('Active', 'Frozen'):\n    amount_past_due = snapshot.overdue_over_30_days_balance_total_amount\n  \n  ELIF snapshot.loan_status IN ('Accelerated', 'ChargedOff'):\n    amount_past_due = snapshot.outstanding_balance_total_amount\n  \n  ELIF snapshot.loan_status IN ('Pending', 'Originated', 'Declined', 'PaidOff', 'Canceled'):\n    amount_past_due = 0\n  \n  ELSE:\n    RAISE ERROR \"Unknown loan status\"\n  \n  RETURN round_to_whole_dollars(max(amount_past_due, 0))\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Logic Explanation:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Loan Status"},"children":["Loan Status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Amount Past Due Source"},"children":["Amount Past Due Source"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Rationale"},"children":["Rationale"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Active, Frozen"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["overdue_over_30_days_balance_total_amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Only amounts 30+ days past due are reported"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Accelerated, ChargedOff"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["outstanding_balance_total_amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Entire balance is considered past due"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PaidOff, Canceled, Pending, Originated, Declined"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No amount past due"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Override Conditions:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Condition"},"children":["Condition"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Result"},"children":["Result"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"CRRG Requirement"},"children":["CRRG Requirement"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Status 61, 62, 63 (Paid in Full)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Always 0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\"Requires Current Balance and Amount Past Due = zero\""]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Status 95 (Voluntary Surrender) + Account Current"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Account surrendered before becoming delinquent"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"current-balance","__idx":4},"children":["Current Balance"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Field 21:"]}," Current Balance"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Source:"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["snapshot.outstanding_balance_total_amount"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Components:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Principal balance"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Accrued interest"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Outstanding fees"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Special Rules:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For status codes 13, 61, 62, 63: Always report $0"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Negative balances: Report as $0"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Round according to loan type configuration"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"transaction-types-and-payment-calculations","__idx":5},"children":["Transaction Types and Payment Calculations"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"overview","__idx":6},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Actual Payment Amount field (Field 17) requires understanding which transactions count as \"payments\" for credit reporting purposes."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"transaction-types","__idx":7},"children":["Transaction Types"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Transaction Type"},"children":["Transaction Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payment"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Consumer payment (AutoPay, OneTimePayment, Settlement)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ServiceCredit"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Lender-applied credit adjustment"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"service-credit-types","__idx":8},"children":["Service Credit Types"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Credit Type"},"children":["Credit Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Reports as Payment?"},"children":["Reports as Payment?"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serviceAgent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[YES]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Agent-applied credit"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serviceSupervisor"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[YES]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Supervisor-approved credit"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["balanceTransfer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[YES]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Balance transferred from another account"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["usuryCap"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[YES]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Usury cap adjustment"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["settlementOfDebt"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[NO]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Settlement credit (considered a loss)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fraud"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[NO]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fraud adjustment credit (considered a loss)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["badDebt"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[NO]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Bad debt write-off credit (considered a loss)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deceased"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[NO]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Deceased borrower adjustment (considered a loss)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bankruptcy"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[NO]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Bankruptcy adjustment (special Account Status handling)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[NO]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Refund (always excluded)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["interestAdjustment"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[NO]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Interest adjustment (always excluded)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rewards"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[YES]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Rewards credit (e.g., cashback applied to balance)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rounding"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[NO]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Rounding adjustment (always excluded)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rewards"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[YES]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Rewards credit (e.g., cashback applied to balance)"]}]}]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Important:"]}," Service credits with types ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["settlementOfDebt"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["settlementOfDebtNoLoss"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fraud"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["badDebt"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deceased"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bankruptcy"]}," are NOT considered \"real\" payments for Actual Payment Amount or Date of Last Payment calculations."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Of those, only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["settlementOfDebt"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fraud"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["badDebt"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deceased"]}," are also treated as \"loss\" transactions for Account Status determination — their presence prevents a charged-off loan from reporting as status 64 (Paid in Full). ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["settlementOfDebtNoLoss"]}," is explicitly ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["excluded"]}," from the loss check — it is the variant for settlement scenarios where the lender does not want a loss recorded, allowing a 64 outcome."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bankruptcy"]}," is also excluded from the loss check because it is the mechanism for zeroing a balance after a bankruptcy discharge and does not by itself force a 97 status. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/credit-reporting/account-status"},"children":["Account Status Codes"]}," for the full algorithm."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bankruptcy"]}," service credit type should only be used when a bankruptcy case has been discharged and the lender needs to zero the loan balance."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"actual-payment-amount-algorithm","__idx":9},"children":["Actual Payment Amount Algorithm"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"FUNCTION calculate_actual_payment_amount(loan, month_start, month_end):\n  \n  total_payment = 0\n  \n  # Query payments in the reporting period\n  transactions = query_transactions(\n    loan_id = loan.id,\n    is_virtual = False,\n    status IN ('Initiated', 'Pending', 'Succeeded'),\n    display_date BETWEEN month_start AND month_end\n  )\n  \n  # Also include transactions that failed AFTER the report cutoff\n  # (they were valid at the time of reporting)\n  transactions += query_transactions(\n    loan_id = loan.id,\n    status = 'Failed',\n    failed_at > file_creation_max_datetime,\n    initiated_or_pending_at BETWEEN file_creation_min_datetime AND file_creation_max_datetime\n  )\n  \n  FOR EACH tx IN transactions:\n    \n    # Payment transactions\n    IF tx.transaction_type = 'Payment':\n      IF tx.payment_reason IN ('AutoPay', 'OneTimePayment', 'Settlement'):\n        total_payment += tx.effective_amount\n    \n    # Service credits - ONLY these four types count as \"real\" payments\n    IF tx.transaction_type = 'ServiceCredit':\n      IF tx.credit_type IN ('serviceAgent', 'serviceSupervisor', 'balanceTransfer', 'usuryCap'):\n        total_payment += tx.effective_amount\n  \n  RETURN round_to_whole_dollars(total_payment)\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"date-of-last-payment","__idx":10},"children":["Date of Last Payment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Field 27:"]}," Date of Last Payment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns the date of the most recent qualifying transaction (same inclusion criteria as Actual Payment Amount):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"FUNCTION get_date_of_last_payment(loan, date_of_account_info):\n  \n  # Find most recent payment transaction\n  payment_tx = query_most_recent_transaction(\n    loan_id = loan.id,\n    transaction_type = 'Payment',\n    payment_reason IN ('AutoPay', 'OneTimePayment', 'Settlement'),\n    status IN ('Initiated', 'Pending', 'Succeeded'),\n    display_date <= date_of_account_info,\n    is_virtual = False\n  )\n  \n  # Find most recent qualifying service credit\n  service_tx = query_most_recent_transaction(\n    loan_id = loan.id,\n    transaction_type = 'ServiceCredit',\n    credit_type IN ('serviceAgent', 'serviceSupervisor', 'balanceTransfer', 'usuryCap'),\n    status IN ('Initiated', 'Pending', 'Succeeded'),\n    display_date <= date_of_account_info,\n    is_virtual = False\n  )\n  \n  # Return the most recent of the two\n  IF payment_tx AND service_tx:\n    RETURN max(payment_tx.display_date, service_tx.display_date)\n  ELIF payment_tx:\n    RETURN payment_tx.display_date\n  ELIF service_tx:\n    RETURN service_tx.display_date\n  ELSE:\n    RETURN NULL\n\n> **Note:** The implementation combines these two lookups into a single query for efficiency, but the logic is equivalent.\n"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note:"]}," The implementation combines these two lookups into a single query for efficiency, but the logic is equivalent."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"loan-replay-and-retroactive-changes","__idx":11},"children":["Loan Replay and Retroactive Changes"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"what-is-loan-replay","__idx":12},"children":["What is Loan Replay?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Loan replay is the process of recalculating a loan's history when:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Interest rates change retroactively"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Payments are backdated"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Errors are corrected"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"impact-on-credit-reporting","__idx":13},"children":["Impact on Credit Reporting"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When a loan is replayed:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Previous Metro 2 files remain unchanged (already submitted)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Next Metro 2 file reflects corrected current state"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Payment History Profile may show different values for past months"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"terminal-reporting-events","__idx":14},"children":["Terminal Reporting Events"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"when-reporting-stops--key-change","__idx":15},"children":["When Reporting Stops — Key Change"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["BEFORE (Old Logic):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"IF loan_status = 'ChargedOff' AND chargedOffReason = 'bankruptcy':\n  → Report loan for the LAST time (stop immediately)\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AFTER (New Logic - Matches Spec):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"IF loan_status = 'ChargedOff' AND outstanding_balance = 0:\n  → Report loan for the LAST time (stop when balance reaches zero)\n"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Key Difference:"]}," Previously, bankruptcy charge-offs stopped reporting immediately regardless of balance. Now, all charge-offs (including bankruptcy) continue reporting until the balance reaches $0."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"when-reporting-stops","__idx":16},"children":["When Reporting Stops"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Credit reporting stops (terminal event) when:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Condition"},"children":["Condition"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Final Status"},"children":["Final Status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Behavior"},"children":["Behavior"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Loan paid off"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["13"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Report once with status 13, then stop"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Loan charged off with zero balance AND no service credit transaction types (settlementOfDebt, fraud, badDebt, deceased)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["64"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Report once with status 64, then stop"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Loan charged off with zero balance BUT has service credit transaction types (settlementOfDebt, fraud, badDebt, deceased)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["97"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Report with status 97 (loss occurred)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Bankruptcy charge-off with balance"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["97"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Continue reporting until balance reaches zero"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Bankruptcy charge-off, balance reaches zero (no loss service credits)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["64"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Report once with status 64, then stop"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fraudulent charge-off"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["DF"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Send deletion, then stop"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Legal deletion"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["DA"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Send deletion, then stop"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Loan data corrupted"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["DA"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Send deletion, then stop"]}]}]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Service Credit Transaction Types Indicating Loss:"]}," Service credits of type ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["settlementOfDebt"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fraud"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["badDebt"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deceased"]}," indicate the lender took a loss. If any of these were used to bring the balance to zero, the account reports status 97 instead of 64."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"bankruptcy-charge-off-terminal-logic","__idx":17},"children":["Bankruptcy Charge-Off Terminal Logic"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Special handling for bankruptcy charge-offs:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"IF charged_off_reason = 'bankruptcy':\n  # Check for service credit transaction types that indicate a loss\n  # (excludes 'bankruptcy' serviceCreditType)\n  loss_service_credits = find_service_credits(\n    types = ['settlementOfDebt', 'fraud', 'badDebt', 'deceased'],\n    status = 'Succeeded'\n  )\n  \n  IF outstanding_balance > 0:\n    # Continue reporting with status 97\n    reporting_continues = True\n    account_status = '97'\n  ELIF count(loss_service_credits) > 0:\n    # Balance is zero but loss occurred\n    reporting_continues = False\n    account_status = '97'\n  ELSE:\n    # Balance is zero, no loss - final report with 64\n    reporting_continues = False\n    account_status = '64'\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"term-charge-off-terminal-logic","__idx":18},"children":["Term Charge-Off Terminal Logic"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"IF charged_off_reason = 'term':\n  loss_service_credits = find_service_credits(\n    types = ['settlementOfDebt', 'fraud', 'badDebt', 'deceased'],\n    status = 'Succeeded'\n  )\n  \n  IF outstanding_balance > 0:\n    reporting_continues = True\n    account_status = '97'\n  ELIF count(loss_service_credits) > 0:\n    # Balance is zero but loss occurred\n    reporting_continues = False\n    account_status = '97'\n  ELSE:\n    # Balance is zero, no loss - final report with 64\n    reporting_continues = False\n    account_status = '64'\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"stop-reporting-process","__idx":19},"children":["Stop Reporting Process"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When reporting should stop:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CreditReportingStatus.reporting_status"]}," is set to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Stopped"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["reporting_end_date"]}," is set to the final reporting date"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Final file includes the loan with terminal status"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Subsequent files exclude the loan"]}]}]},"headings":[{"value":"Calculations","id":"calculations","depth":1},{"value":"Obligation and Balance Calculations","id":"obligation-and-balance-calculations","depth":2},{"value":"Scheduled Monthly Payment Amount","id":"scheduled-monthly-payment-amount","depth":3},{"value":"Amount Past Due","id":"amount-past-due","depth":3},{"value":"Current Balance","id":"current-balance","depth":3},{"value":"Transaction Types and Payment Calculations","id":"transaction-types-and-payment-calculations","depth":2},{"value":"Overview","id":"overview","depth":3},{"value":"Transaction Types","id":"transaction-types","depth":3},{"value":"Service Credit Types","id":"service-credit-types","depth":3},{"value":"Actual Payment Amount Algorithm","id":"actual-payment-amount-algorithm","depth":3},{"value":"Date of Last Payment","id":"date-of-last-payment","depth":3},{"value":"Loan Replay and Retroactive Changes","id":"loan-replay-and-retroactive-changes","depth":2},{"value":"What is Loan Replay?","id":"what-is-loan-replay","depth":3},{"value":"Impact on Credit Reporting","id":"impact-on-credit-reporting","depth":3},{"value":"Terminal Reporting Events","id":"terminal-reporting-events","depth":2},{"value":"When Reporting Stops — Key Change","id":"when-reporting-stops--key-change","depth":3},{"value":"When Reporting Stops","id":"when-reporting-stops","depth":3},{"value":"Bankruptcy Charge-Off Terminal Logic","id":"bankruptcy-charge-off-terminal-logic","depth":3},{"value":"Term Charge-Off Terminal Logic","id":"term-charge-off-terminal-logic","depth":3},{"value":"Stop Reporting Process","id":"stop-reporting-process","depth":3}],"frontmatter":{"seo":{"title":"Calculations"}},"lastModified":"2026-05-21T20:32:15.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/credit-reporting/calculations","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}