{"ref":{"kind":"component","id":"corporate_repayment","key":"sha256:13c6a29195179cfed926acb8fd066638fc64bdd048ded9b3884f295f41775271"},"label":"Debt repayment","description":"Allocate scheduled payments, a priority sweep and settlement without overpaying principal.","inputs":[{"label":"Amortization","name":"amortization","valueType":{"axes":[{"extent":null,"name":"tranche","variable":true}],"dtype":"f64","unit":"%"}},{"label":"Balance","name":"balance","valueType":{"axes":[{"extent":null,"name":"tranche","variable":true}],"dtype":"f64","unit":"$"}},{"label":"Cash","name":"cash","valueType":{"axes":[],"dtype":"f64","unit":"$"}},{"label":"Original","name":"original","valueType":{"axes":[{"extent":null,"name":"tranche","variable":true}],"dtype":"f64","unit":"$"}},{"label":"Payoff Fee Rate","name":"payoff_fee_rate","valueType":{"axes":[{"extent":null,"name":"tranche","variable":true}],"dtype":"f64","unit":"%"}},{"label":"Settlement","name":"settlement","valueType":{"axes":[],"dtype":"f64","unit":"flag"}},{"label":"Sweep Rate","name":"sweep_rate","valueType":{"axes":[],"dtype":"f64","unit":"%"}}],"outputs":[{"label":"Closing","name":"closing","valueType":{"axes":[{"extent":null,"name":"tranche","variable":true}],"dtype":"f64","unit":"$"}},{"label":"Fees","name":"fees","valueType":{"axes":[],"dtype":"f64","unit":"$"}},{"label":"Payoff","name":"payoff","valueType":{"axes":[{"extent":null,"name":"tranche","variable":true}],"dtype":"f64","unit":"$"}},{"label":"Repayments","name":"repayments","valueType":{"axes":[{"extent":null,"name":"tranche","variable":true}],"dtype":"f64","unit":"$"}},{"label":"Scheduled","name":"scheduled","valueType":{"axes":[{"extent":null,"name":"tranche","variable":true}],"dtype":"f64","unit":"$"}},{"label":"Sweep","name":"sweep","valueType":{"axes":[{"extent":null,"name":"tranche","variable":true}],"dtype":"f64","unit":"$"}}],"dependencies":[{"id":"corporate_amortization","key":"sha256:d45ca964d344f6d168d5f072ab312cc55c900bafaa1ac82d8489aaa61bb7c933","kind":"component"}],"libraries":["corporate_debt"],"notes":{"conventions":["Amounts follow tranche priority: the first tranche receives sweep cash first.","Scheduled amortization uses original principal and an annual rate, capped at outstanding principal.","Cash available is after interest and commitment fees. Mandatory payments can create a funding gap.","A sweep uses the remaining positive cash budget and cannot exceed outstanding claims.","Settlement pays remaining principal after scheduled payments and sweeps.","The payoff fee applies only to settlement principal; scheduled and sweep payments carry no payoff fee."]},"calculation":{"nodes":[{"id":"input-amortization","label":"Amortization","kind":"input"},{"id":"input-balance","label":"Balance","kind":"input"},{"id":"input-cash","label":"Cash","kind":"input"},{"id":"input-original","label":"Original","kind":"input"},{"id":"input-payoff_fee_rate","label":"Payoff Fee Rate","kind":"input"},{"id":"input-settlement","label":"Settlement","kind":"input"},{"id":"input-sweep_rate","label":"Sweep Rate","kind":"input"},{"id":"step-scheduled","label":"Scheduled","kind":"step","rule":"Result of Scheduled principal","sources":[{"node":"input-balance"},{"node":"input-original"},{"node":"input-amortization"}],"calls":[{"component":"corporate_amortization","purpose":"Calculate monthly scheduled principal from original and outstanding balances.","label":"Scheduled principal","bindings":[{"name":"balance","label":"Balance","value":"Balance"},{"name":"original","label":"Original","value":"Original"},{"name":"rate","label":"Rate","value":"Amortization"}]}]},{"id":"step-value1","label":"(Balance − Scheduled)","kind":"step","rule":"(Balance − Scheduled)","sources":[{"node":"input-balance"},{"node":"step-scheduled"}]},{"id":"output-scheduled","kind":"output","label":"Scheduled","rule":"Scheduled","sources":[{"node":"step-scheduled"}]},{"id":"step-sweep","label":"Sweep","kind":"step","rule":"Lower of (Balance − Scheduled) and Higher of ((Higher of (Cash − Sum(Scheduled)) and 0 × Limit to range(Sweep Rate, 0, 1)) − Shift(Running total((Balance − Scheduled)), 1)) and 0","sources":[{"node":"step-value1"},{"node":"input-cash"},{"node":"step-scheduled"},{"node":"input-sweep_rate"}]},{"id":"step-value0","label":"((Balance − Scheduled) − Sweep)","kind":"step","rule":"((Balance − Scheduled) − Sweep)","sources":[{"node":"step-value1"},{"node":"step-sweep"}]},{"id":"output-sweep","kind":"output","label":"Sweep","rule":"Sweep","sources":[{"node":"step-sweep"}]},{"id":"step-payoff","label":"Payoff","kind":"step","rule":"if (Settlement > 0), then ((Balance − Scheduled) − Sweep), otherwise 0","sources":[{"node":"input-settlement"},{"node":"step-value0"}]},{"id":"output-closing","kind":"output","label":"Closing","rule":"(((Balance − Scheduled) − Sweep) − Payoff)","sources":[{"node":"step-value0"},{"node":"step-payoff"}]},{"id":"output-fees","kind":"output","label":"Fees","rule":"Sum((Payoff × Payoff Fee Rate))","sources":[{"node":"step-payoff"},{"node":"input-payoff_fee_rate"}]},{"id":"output-payoff","kind":"output","label":"Payoff","rule":"Payoff","sources":[{"node":"step-payoff"}]},{"id":"output-repayments","kind":"output","label":"Repayments","rule":"((Scheduled + Sweep) + Payoff)","sources":[{"node":"step-scheduled"},{"node":"step-sweep"},{"node":"step-payoff"}]}],"topics":[{"label":"Debt repayment","results":["output-closing","output-fees","output-payoff","output-repayments","output-scheduled","output-sweep"]}]},"usedBy":[{"kind":"recipe","id":"lbo","key":"sha256:6c9502c2e1a240aaed8179c2349c4bfb3748ca35116e53755e0146d818a0638f"}]}
