Skip to content

Commit

Permalink
add direction for payGroupPrin/payGroupInt
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowbean committed Nov 5, 2024
1 parent 05b6025 commit f45d61d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/Deal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,11 @@ run t@TestDeal{accounts=accMap,fees=feeMap,triggers=mTrgMap,bonds=bndMap,status=

BuildReport sd ed ->
let
bsReport = Rpt.buildBalanceSheet t ed
bsReport = Rpt.buildBalanceSheet t ed -- `debug` ("bs report"++ show ed)
cashReport = Rpt.buildCashReport t sd ed
newlog = FinancialReport sd ed bsReport cashReport
in
run t poolFlowMap (Just ads) rates calls rAssump $ log++[newlog]
run t poolFlowMap (Just ads) rates calls rAssump $ log++[newlog] -- `debug` ("new log"++ show ed++ show newlog)


FireTrigger d cyc n ->
Expand Down Expand Up @@ -1098,8 +1098,8 @@ getInits t@TestDeal{fees=feeMap,pool=thePool,status=status,bonds=bndMap} mAssump
-> let
_ds = genSerialDatesTill2 II startDate dp endDate
in
[ BuildReport _sd _ed | (_sd,_ed) <- zip _ds (tail _ds) ]
_ -> []
[ BuildReport _sd _ed | (_sd,_ed) <- zip _ds (tail _ds) ] -- `debug` ("ds"++ show _ds)
_ -> [] -- `debug` ("emtpy rpt dates")

irSwapRateDates = case rateSwap t of
Nothing -> []
Expand Down Expand Up @@ -1163,7 +1163,7 @@ getInits t@TestDeal{fees=feeMap,pool=thePool,status=status,bonds=bndMap} mAssump
a = concat [bActionDates,pActionDates,iAccIntDates,makeWholeDate
,feeAccrueDates,liqResetDates,mannualTrigger,concat rateCapSettleDates
,concat irSwapRateDates,inspectDates, bndRateResets,financialRptDates
,bondIssuePlan,bondRefiPlan,callDates]
,bondIssuePlan,bondRefiPlan,callDates] -- `debug` ("reports"++ show financialRptDates)
in
case (dates t,status) of
(PreClosingDates {}, PreClosing _) -> sortBy sortActionOnDate $ DealClosed closingDate:a
Expand Down
5 changes: 3 additions & 2 deletions src/Liability.hs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ priceBond d rc b@(Bond bn _ (OriginalInfo obal od _ _) iinfo _ bal cr _ _ _ _ la
in
b/presentValue -- `debug` "PRICING -D" -- `debug` ("B->"++show b++"PV"++show presentValue)
in
PriceResult presentValue (fromRational (100*(toRational presentValue)/(toRational obal))) (realToFrac wal) (realToFrac duration) (realToFrac convexity) accruedInt futureCfs-- `debug` ("Obal->"++ show obal++"Rate>>"++ show (bndRate b))
-- PriceResult presentValue (fromRational (100*(toRational presentValue)/(toRational obal))) (realToFrac wal) (realToFrac duration) (realToFrac convexity) accruedInt futureCfs-- `debug` ("Obal->"++ show obal++"Rate>>"++ show (bndRate b))
PriceResult presentValue (fromRational (100* (safeDivide' presentValue obal))) (realToFrac wal) (realToFrac duration) (realToFrac convexity) accruedInt futureCfs-- `debug` ("Obal->"++ show obal++"Rate>>"++ show (bndRate b))
where
futureCfs = cutBy Exc Future d txns
futureCfDates = getDate <$> futureCfs
Expand Down Expand Up @@ -507,4 +508,4 @@ $(deriveJSON defaultOptions ''InterestInfo)
$(deriveJSON defaultOptions ''OriginalInfo)
$(deriveJSON defaultOptions ''BondType)
$(deriveJSON defaultOptions ''StepUp)
$(deriveJSON defaultOptions ''Bond)
$(deriveJSON defaultOptions ''Bond)
2 changes: 2 additions & 0 deletions src/Stmt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ getFlow :: TxnComment -> FlowDirection
getFlow comment =
case comment of
PayInt _ -> Outflow
PayGroupInt _ -> Outflow
PayGroupPrin _ -> Outflow
PayYield _ -> Outflow
PayPrin _ -> Outflow
PayFee _ -> Outflow
Expand Down
2 changes: 1 addition & 1 deletion swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -19066,7 +19066,7 @@
"name": "BSD 3"
},
"title": "Hastructure API",
"version": "0.30.7"
"version": "0.30.8"
},
"openapi": "3.0.0",
"paths": {
Expand Down

0 comments on commit f45d61d

Please sign in to comment.