yellowbean / Hastructure

ABS/MBS cashflow engine written in Haskell, with API to Python and C/Java (on the way)
https://deal-bench.xyz
Other
15 stars 4 forks source link

Add trigger values to output #184

Closed dandevmsc closed 2 months ago

dandevmsc commented 2 months ago

Hi,

Thanks again for the great work on this project, it's very impressive. Currently for Bonds, Fees, Accounts and Pool the cashflows related to these items are in the bndStmt, feeStmt, accStmt and futureCf respectively. For the triggers there doesn't seem to be a way to output the values related to the triggers other than adding them to the run assumptions as an "inspect", this would then provide a true false whether the trigger has breached. Additionally for the modelling phase of each deal having the actual values that are being assessed would be very helpful as we could validate that the model is correctly modelled. Would it be possible to have a similar "triggerStmt" under the "triggers" which would output the values in a similar manner to the other components?

Thanks!

yellowbean commented 2 months ago

Hi, appreciate your feedback, it's very helpful.

Yes, it was not intended for triggers to have Statement, because , Statement is a real world thing.

Like a bond being paid, then there would be a record in the book keeper. Or, an fund transfer ,then there is an bank transaction booked in the bank statement. Or a fee being paid, there would be a fee payment slip.

But it indeed a repetitive work to inspect it and join with other outputs . Let me expose trigger stmts in 0.28.6

yellowbean commented 2 months ago

To be tested with version

dandevmsc commented 2 months ago

That's really useful and thanks for the quick response! Indeed now it outputs the true/false, would the plan be to also output the values related to that trigger? image

yellowbean commented 2 months ago

That's really useful and thanks for the quick response! Indeed now it outputs the true/false, would the plan be to also output the values related to that trigger? image

Yeah, the 3rd element from contents" ("2025-5-3",false,"") is reserved for Why this trigger is fired or not. If just dump it in raw, that's a lot of noise. I'm think of a way to make the condition more "human readable", because it not just a formula : a Value > another Value . It could be a Date> 20240601, or a nested condition like "All"/"Any" or nested formula.

yellowbean commented 2 months ago

With 0.26.8, a simple formula string has been included.

image

dandevmsc commented 2 months ago

Thanks this works perfectly!