Hastructure
Safe HaskellNone
LanguageHaskell2010

Liability

Synopsis

Documentation

data Bond Source #

Constructors

Bond 

Fields

MultiIntBond 

Fields

BondGroup (Map String Bond) (Maybe BondType)

bond group

Instances

Instances details
UseRate Bond Source # 
Instance details

Defined in Liability

HasStmt Bond Source # 
Instance details

Defined in Liability

QueryByComment Bond Source # 
Instance details

Defined in Liability

Liable Bond Source # 
Instance details

Defined in Liability

FromJSON Bond Source # 
Instance details

Defined in Liability

ToJSON Bond Source # 
Instance details

Defined in Liability

Generic Bond Source # 
Instance details

Defined in Liability

Associated Types

type Rep Bond 
Instance details

Defined in Liability

type Rep Bond = D1 ('MetaData "Bond" "Liability" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) (C1 ('MetaCons "Bond" 'PrefixI 'True) (((S1 ('MetaSel ('Just "bndName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "bndType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BondType) :*: S1 ('MetaSel ('Just "bndOriginInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OriginalInfo))) :*: ((S1 ('MetaSel ('Just "bndInterestInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestInfo) :*: S1 ('MetaSel ('Just "bndStepUp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe StepUp))) :*: (S1 ('MetaSel ('Just "bndBalance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: S1 ('MetaSel ('Just "bndRate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate)))) :*: ((S1 ('MetaSel ('Just "bndDuePrin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: (S1 ('MetaSel ('Just "bndDueInt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: S1 ('MetaSel ('Just "bndDueIntOverInt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance))) :*: ((S1 ('MetaSel ('Just "bndDueIntDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date)) :*: S1 ('MetaSel ('Just "bndLastIntPay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date))) :*: (S1 ('MetaSel ('Just "bndLastPrinPay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date)) :*: S1 ('MetaSel ('Just "bndStmt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Statement)))))) :+: (C1 ('MetaCons "MultiIntBond" 'PrefixI 'True) (((S1 ('MetaSel ('Just "bndName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "bndType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BondType) :*: S1 ('MetaSel ('Just "bndOriginInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OriginalInfo))) :*: ((S1 ('MetaSel ('Just "bndInterestInfos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [InterestInfo]) :*: S1 ('MetaSel ('Just "bndStepUps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [StepUp]))) :*: (S1 ('MetaSel ('Just "bndBalance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: S1 ('MetaSel ('Just "bndRates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [IRate])))) :*: ((S1 ('MetaSel ('Just "bndDuePrin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: (S1 ('MetaSel ('Just "bndDueInts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Balance]) :*: S1 ('MetaSel ('Just "bndDueIntOverInts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Balance]))) :*: ((S1 ('MetaSel ('Just "bndDueIntDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date)) :*: S1 ('MetaSel ('Just "bndLastIntPays") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Date]))) :*: (S1 ('MetaSel ('Just "bndLastPrinPay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date)) :*: S1 ('MetaSel ('Just "bndStmt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Statement)))))) :+: C1 ('MetaCons "BondGroup" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map String Bond)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe BondType)))))

Methods

from :: Bond -> Rep Bond x #

to :: Rep Bond x -> Bond #

Read Bond Source # 
Instance details

Defined in Liability

Show Bond Source # 
Instance details

Defined in Liability

Methods

showsPrec :: Int -> Bond -> ShowS #

show :: Bond -> String #

showList :: [Bond] -> ShowS #

Eq Bond Source # 
Instance details

Defined in Liability

Methods

(==) :: Bond -> Bond -> Bool #

(/=) :: Bond -> Bond -> Bool #

Ord Bond Source # 
Instance details

Defined in Liability

Methods

compare :: Bond -> Bond -> Ordering #

(<) :: Bond -> Bond -> Bool #

(<=) :: Bond -> Bond -> Bool #

(>) :: Bond -> Bond -> Bool #

(>=) :: Bond -> Bond -> Bool #

max :: Bond -> Bond -> Bond #

min :: Bond -> Bond -> Bond #

type Rep Bond Source # 
Instance details

Defined in Liability

type Rep Bond = D1 ('MetaData "Bond" "Liability" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) (C1 ('MetaCons "Bond" 'PrefixI 'True) (((S1 ('MetaSel ('Just "bndName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "bndType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BondType) :*: S1 ('MetaSel ('Just "bndOriginInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OriginalInfo))) :*: ((S1 ('MetaSel ('Just "bndInterestInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestInfo) :*: S1 ('MetaSel ('Just "bndStepUp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe StepUp))) :*: (S1 ('MetaSel ('Just "bndBalance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: S1 ('MetaSel ('Just "bndRate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate)))) :*: ((S1 ('MetaSel ('Just "bndDuePrin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: (S1 ('MetaSel ('Just "bndDueInt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: S1 ('MetaSel ('Just "bndDueIntOverInt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance))) :*: ((S1 ('MetaSel ('Just "bndDueIntDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date)) :*: S1 ('MetaSel ('Just "bndLastIntPay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date))) :*: (S1 ('MetaSel ('Just "bndLastPrinPay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date)) :*: S1 ('MetaSel ('Just "bndStmt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Statement)))))) :+: (C1 ('MetaCons "MultiIntBond" 'PrefixI 'True) (((S1 ('MetaSel ('Just "bndName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "bndType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BondType) :*: S1 ('MetaSel ('Just "bndOriginInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OriginalInfo))) :*: ((S1 ('MetaSel ('Just "bndInterestInfos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [InterestInfo]) :*: S1 ('MetaSel ('Just "bndStepUps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [StepUp]))) :*: (S1 ('MetaSel ('Just "bndBalance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: S1 ('MetaSel ('Just "bndRates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [IRate])))) :*: ((S1 ('MetaSel ('Just "bndDuePrin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: (S1 ('MetaSel ('Just "bndDueInts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Balance]) :*: S1 ('MetaSel ('Just "bndDueIntOverInts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Balance]))) :*: ((S1 ('MetaSel ('Just "bndDueIntDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date)) :*: S1 ('MetaSel ('Just "bndLastIntPays") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Date]))) :*: (S1 ('MetaSel ('Just "bndLastPrinPay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date)) :*: S1 ('MetaSel ('Just "bndStmt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Statement)))))) :+: C1 ('MetaCons "BondGroup" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map String Bond)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe BondType)))))

data BondType Source #

Constructors

Sequential

Pass through type tranche

PAC PlannedAmorSchedule

bond with schedule amortization

AmtByPeriod (PerCurve Balance)

principal due by period

PacAnchor PlannedAmorSchedule [BondName]

pay till schdule balance if bonds from bond names has oustanding balance, if other bonds are paid off ,then pay oustanding balance

Lockout Date

No principal due till date

IO 
Z

Z tranche

Equity

Equity type tranche

Instances

Instances details
FromJSON BondType Source # 
Instance details

Defined in Liability

ToJSON BondType Source # 
Instance details

Defined in Liability

Generic BondType Source # 
Instance details

Defined in Liability

Associated Types

type Rep BondType 
Instance details

Defined in Liability

Methods

from :: BondType -> Rep BondType x #

to :: Rep BondType x -> BondType #

Read BondType Source # 
Instance details

Defined in Liability

Show BondType Source # 
Instance details

Defined in Liability

Eq BondType Source # 
Instance details

Defined in Liability

Ord BondType Source # 
Instance details

Defined in Liability

type Rep BondType Source # 
Instance details

Defined in Liability

data OriginalInfo Source #

Constructors

OriginalInfo 

Fields

Instances

Instances details
FromJSON OriginalInfo Source # 
Instance details

Defined in Liability

ToJSON OriginalInfo Source # 
Instance details

Defined in Liability

Generic OriginalInfo Source # 
Instance details

Defined in Liability

Associated Types

type Rep OriginalInfo 
Instance details

Defined in Liability

type Rep OriginalInfo = D1 ('MetaData "OriginalInfo" "Liability" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) (C1 ('MetaCons "OriginalInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "originBalance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: S1 ('MetaSel ('Just "originDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Date)) :*: (S1 ('MetaSel ('Just "originRate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rate) :*: S1 ('MetaSel ('Just "maturityDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date)))))
Read OriginalInfo Source # 
Instance details

Defined in Liability

Show OriginalInfo Source # 
Instance details

Defined in Liability

Eq OriginalInfo Source # 
Instance details

Defined in Liability

Ord OriginalInfo Source # 
Instance details

Defined in Liability

type Rep OriginalInfo Source # 
Instance details

Defined in Liability

type Rep OriginalInfo = D1 ('MetaData "OriginalInfo" "Liability" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) (C1 ('MetaCons "OriginalInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "originBalance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Balance) :*: S1 ('MetaSel ('Just "originDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Date)) :*: (S1 ('MetaSel ('Just "originRate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rate) :*: S1 ('MetaSel ('Just "maturityDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Date)))))

payPrin :: Date -> Amount -> Bond -> Bond Source #

no cash payment , do nothing

isPaidOff :: Liable lb => lb -> Bool Source #

pv :: Ts -> Date -> Date -> Amount -> Amount Source #

calculate present value in the future using constant rate

data InterestInfo Source #

scale a spread to interest rate info

Constructors

Floater IRate Index Spread RateReset DayCount (Maybe Floor) (Maybe Cap) 
Fix IRate DayCount

fixed rate

RefBal DealStats InterestInfo

accure interest based on balance(described by a formula)

RefRate IRate DealStats Float RateReset

interest rate depends to a formula

CapRate InterestInfo IRate

cap rate

FloorRate InterestInfo IRate

floor rate

WithIoI InterestInfo InterestOverInterestType

Interest Over Interest(normal on left,IoI on right)

Instances

Instances details
FromJSON InterestInfo Source # 
Instance details

Defined in Liability

ToJSON InterestInfo Source # 
Instance details

Defined in Liability

Generic InterestInfo Source # 
Instance details

Defined in Liability

Associated Types

type Rep InterestInfo 
Instance details

Defined in Liability

type Rep InterestInfo = D1 ('MetaData "InterestInfo" "Liability" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) ((C1 ('MetaCons "Floater" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Index) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Spread))) :*: ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RateReset) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DayCount)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Floor)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Cap))))) :+: (C1 ('MetaCons "Fix" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DayCount)) :+: C1 ('MetaCons "RefBal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DealStats) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestInfo)))) :+: ((C1 ('MetaCons "RefRate" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DealStats)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RateReset))) :+: C1 ('MetaCons "CapRate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestInfo) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate))) :+: (C1 ('MetaCons "FloorRate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestInfo) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate)) :+: C1 ('MetaCons "WithIoI" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestInfo) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestOverInterestType)))))
Read InterestInfo Source # 
Instance details

Defined in Liability

Show InterestInfo Source # 
Instance details

Defined in Liability

Eq InterestInfo Source # 
Instance details

Defined in Liability

Ord InterestInfo Source # 
Instance details

Defined in Liability

type Rep InterestInfo Source # 
Instance details

Defined in Liability

type Rep InterestInfo = D1 ('MetaData "InterestInfo" "Liability" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) ((C1 ('MetaCons "Floater" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Index) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Spread))) :*: ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RateReset) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DayCount)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Floor)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Cap))))) :+: (C1 ('MetaCons "Fix" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DayCount)) :+: C1 ('MetaCons "RefBal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DealStats) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestInfo)))) :+: ((C1 ('MetaCons "RefRate" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DealStats)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RateReset))) :+: C1 ('MetaCons "CapRate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestInfo) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate))) :+: (C1 ('MetaCons "FloorRate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestInfo) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IRate)) :+: C1 ('MetaCons "WithIoI" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestInfo) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InterestOverInterestType)))))

calcZspread :: (Rational, Date) -> Bond -> Ts -> Either String Spread Source #

get total funded balance (from transaction) of a bond

payYield :: Date -> Amount -> Bond -> Bond Source #

pay principal to single bond principal with limit of principal due

isAdjustble :: InterestInfo -> Bool Source #

test if a bond may changes its interest rate

data StepUp Source #

Constructors

PassDateSpread Date Spread

add a spread on a date and effective afterwards

PassDateLadderSpread Date Spread RateReset

add a spread on the date pattern

Instances

Instances details
FromJSON StepUp Source # 
Instance details

Defined in Liability

ToJSON StepUp Source # 
Instance details

Defined in Liability

Generic StepUp Source # 
Instance details

Defined in Liability

Methods

from :: StepUp -> Rep StepUp x #

to :: Rep StepUp x -> StepUp #

Read StepUp Source # 
Instance details

Defined in Liability

Show StepUp Source # 
Instance details

Defined in Liability

Eq StepUp Source # 
Instance details

Defined in Liability

Methods

(==) :: StepUp -> StepUp -> Bool #

(/=) :: StepUp -> StepUp -> Bool #

Ord StepUp Source # 
Instance details

Defined in Liability

type Rep StepUp Source # 
Instance details

Defined in Liability

fundWith :: Date -> Amount -> Bond -> Bond Source #

get interest rate for due interest

data InterestOverInterestType Source #

the way how interest due amount is calculated

Constructors

OverCurrRateBy Rational

inflat ioi rate by pct over current rate

OverFixSpread Spread

inflat ioi rate by fix spread

Instances

Instances details
FromJSON InterestOverInterestType Source # 
Instance details

Defined in Liability

ToJSON InterestOverInterestType Source # 
Instance details

Defined in Liability

Generic InterestOverInterestType Source # 
Instance details

Defined in Liability

Associated Types

type Rep InterestOverInterestType 
Instance details

Defined in Liability

type Rep InterestOverInterestType = D1 ('MetaData "InterestOverInterestType" "Liability" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) (C1 ('MetaCons "OverCurrRateBy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)) :+: C1 ('MetaCons "OverFixSpread" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Spread)))
Read InterestOverInterestType Source # 
Instance details

Defined in Liability

Show InterestOverInterestType Source # 
Instance details

Defined in Liability

Eq InterestOverInterestType Source # 
Instance details

Defined in Liability

Ord InterestOverInterestType Source # 
Instance details

Defined in Liability

type Rep InterestOverInterestType Source # 
Instance details

Defined in Liability

type Rep InterestOverInterestType = D1 ('MetaData "InterestOverInterestType" "Liability" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) (C1 ('MetaCons "OverCurrRateBy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)) :+: C1 ('MetaCons "OverFixSpread" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Spread)))

setBondOrigDate :: Date -> Bond -> Bond Source #

build bond factors

stepUpInterestInfo :: StepUp -> InterestInfo -> InterestInfo Source #

get reset dates from interest info

payIntByIndex :: Date -> Int -> Amount -> Bond -> Bond Source #

pay interest to single bond regardless any interest due

getDueIntAt :: Liable lb => lb -> Int -> Balance Source #

getCurRate :: Liable lb => lb -> IRate Source #

bondCashflow :: Bond -> ([Date], [Amount]) Source #

remove empty transaction frgetBondByName :: Ast.Assetom a bond

getTxnInt :: Txn -> Amount Source #

get present value of a bond

adjInterestInfoByRate :: Rate -> InterestInfo -> InterestInfo Source #

add a spread to interest rate info