Hastructure
Safe HaskellNone
LanguageHaskell2010

Waterfall

Documentation

data PoolSource Source #

Constructors

CollectedInterest

interest

CollectedPrincipal

schdule principal

CollectedRecoveries

recoveries

CollectedPrepayment

prepayment

CollectedPrepaymentPenalty

prepayment pentalty

CollectedRental

rental from pool

CollectedFeePaid

fee from pool

CollectedCash

cash from pool

NewDefaults

new defaults in balance

NewLosses

new losses in balance

NewDelinquencies

new delinquencies in balance

CurBalance

performing balance

CurBegBalance

performing balance at the beginning of the period

Instances

Instances details
FromJSON PoolSource Source # 
Instance details

Defined in Types

ToJSON PoolSource Source # 
Instance details

Defined in Types

Generic PoolSource Source # 
Instance details

Defined in Types

Associated Types

type Rep PoolSource 
Instance details

Defined in Types

type Rep PoolSource = D1 ('MetaData "PoolSource" "Types" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) (((C1 ('MetaCons "CollectedInterest" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CollectedPrincipal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CollectedRecoveries" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "CollectedPrepayment" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CollectedPrepaymentPenalty" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CollectedRental" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "CollectedFeePaid" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CollectedCash" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NewDefaults" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "NewLosses" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NewDelinquencies" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CurBalance" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CurBegBalance" 'PrefixI 'False) (U1 :: Type -> Type)))))
Read PoolSource Source # 
Instance details

Defined in Types

Show PoolSource Source # 
Instance details

Defined in Types

Eq PoolSource Source # 
Instance details

Defined in Types

Ord PoolSource Source # 
Instance details

Defined in Types

type Rep PoolSource Source # 
Instance details

Defined in Types

type Rep PoolSource = D1 ('MetaData "PoolSource" "Types" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) (((C1 ('MetaCons "CollectedInterest" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CollectedPrincipal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CollectedRecoveries" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "CollectedPrepayment" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CollectedPrepaymentPenalty" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CollectedRental" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "CollectedFeePaid" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CollectedCash" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NewDefaults" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "NewLosses" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NewDelinquencies" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CurBalance" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CurBegBalance" 'PrefixI 'False) (U1 :: Type -> Type)))))

data Action Source #

Constructors

Transfer (Maybe Limit) AccountName AccountName (Maybe TxnComment) 
TransferAndBook (Maybe Limit) AccountName AccountName BookLedger (Maybe TxnComment) 
TransferMultiple [(Maybe Limit, AccountName)] AccountName (Maybe TxnComment) 
CalcFee [FeeName]

calculate fee due amount in the fee names

PayFee (Maybe Limit) AccountName [FeeName] (Maybe ExtraSupport)

pay fee with cash from account with optional limit or extra support

PayFeeBySeq (Maybe Limit) AccountName [FeeName] (Maybe ExtraSupport)

pay fee with cash from account with optional limit or extra support

CalcAndPayFee (Maybe Limit) AccountName [FeeName] (Maybe ExtraSupport)

combination of CalcFee and PayFee

PayFeeResidual (Maybe Limit) AccountName FeeName

pay fee regardless fee due amount Bond - Interest

CalcBondInt [BondName] 
CalcBondIntBy BondName DealStats DealStats

calculate interest due amount in the bond names,with optional balance and rate

PayIntOverInt (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport)

pay interest over interest only

PayInt (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport)

pay interest with cash from the account with optional limit or extra support

PayIntAndBook (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport) BookLedger

pay interest with cash from the account with optional limit or extra support

PayIntBySeq (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport)

with sequence

PayIntOverIntBySeq (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport)

pay interest over interest only with sequence

AccrueAndPayInt (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport)

combination of CalcInt and PayInt

AccrueAndPayIntBySeq (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport)

with sequence

PayIntResidual (Maybe Limit) AccountName BondName

pay interest to bond regardless interest due

PayIntByRateIndex (Maybe Limit) AccountName [BondName] Int (Maybe ExtraSupport)

pay interest to bond by index

PayIntByRateIndexBySeq (Maybe Limit) AccountName [BondName] Int (Maybe ExtraSupport)

pay interest to bond by index Bond - Principal

CalcBondPrin (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport)

calculate principal due amount in the bond names

CalcBondPrin2 (Maybe Limit) [BondName]

calculate principal due amount in the bond names

PayPrinWithDue AccountName [BondName] (Maybe ExtraSupport)

pay principal to bond till due amount

PayPrin (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport)

pay principal to bond via pro-rata

PayPrinBySeq (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport)

pay principal to bond via sequence

PayPrinResidual AccountName [BondName]

pay principal regardless predefined balance schedule

PayIntPrinBySeq (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport)

pay int & prin to bonds sequentially

AccrueAndPayIntPrinBySeq (Maybe Limit) AccountName [BondName] (Maybe ExtraSupport) 
PayPrinGroup (Maybe Limit) AccountName BondName PayOrderBy (Maybe ExtraSupport)

pay bond group with cash from account with optional limit or extra support

AccrueIntGroup [BondName] 
PayIntGroup (Maybe Limit) AccountName BondName PayOrderBy (Maybe ExtraSupport)

pay bond group with cash from account with optional limit or extra support

AccrueAndPayIntGroup (Maybe Limit) AccountName BondName PayOrderBy (Maybe ExtraSupport) 
WriteOff (Maybe Limit) BondName 
WriteOffAndBook (Maybe Limit) BondName BookLedger 
WriteOffBySeq (Maybe Limit) [BondName] 
WriteOffBySeqAndBook (Maybe Limit) [BondName] BookLedger 
FundWith (Maybe Limit) AccountName BondName

extra more funds from bond and deposit cash to account Pool/Asset change

BuyAsset (Maybe Limit) PricingMethod AccountName (Maybe PoolId)

buy asset from revolving assumptions using funds from account

BuyAssetFrom (Maybe Limit) PricingMethod AccountName (Maybe String) (Maybe PoolId)

buy asset from specific pool, with revolving assumptions using funds from account

LiquidatePool PricingMethod AccountName (Maybe [PoolId])

sell all assets and deposit proceeds to account TODO include a limit for LIquidatePool Liquidation support

LiqSupport (Maybe Limit) LiquidityProviderName LiqDrawType [String]

draw credit and deposit to accountfeebond interest/principal

LiqRepay (Maybe Limit) LiqRepayType AccountName LiquidityProviderName

repay liquidity facility

LiqYield (Maybe Limit) AccountName LiquidityProviderName

repay compensation to liquidity facility

LiqAccrue [LiquidityProviderName]

accure premium/due interest of liquidity facility Rate Swap

SwapAccrue CeName

calculate the net amount of swap manually

SwapReceive AccountName CeName

receive amount from net amount of swap and deposit to account

SwapPay AccountName CeName

pay out net amount from account

SwapSettle AccountName CeName

pay & receive net amount of swap with account RateCap

CollectRateCap AccountName CeName

collect cash from rate cap and deposit to account Record booking

BookBy BookType

book an ledger with book types Pre

ActionWithPre Pre [Action]

execute actions if pre is true

ActionWithPre2 Pre [Action] [Action]

execute action1 if pre is true ,else execute action2 Trigger

RunTrigger DealCycle [String]

update the trigger status during the waterfall execution Debug

WatchVal (Maybe String) [DealStats]

inspect vals during the waterfall execution

Placeholder (Maybe String) 
ChangeStatus (Maybe Pre) DealStatus 

Instances

Instances details
FromJSON Action Source # 
Instance details

Defined in Waterfall

ToJSON Action Source # 
Instance details

Defined in Waterfall

Generic Action Source # 
Instance details

Defined in Waterfall

Associated Types

type Rep Action 
Instance details

Defined in Waterfall

type Rep Action

Methods

from :: Action -> Rep Action x #

to :: Rep Action x -> Action #

Show Action Source # 
Instance details

Defined in Waterfall

Eq Action Source # 
Instance details

Defined in Waterfall

Methods

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

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

Ord Action Source # 
Instance details

Defined in Waterfall

type Rep Action Source # 
Instance details

Defined in Waterfall

type Rep Action

data ActionWhen Source #

Constructors

EndOfPoolCollection

waterfall executed at the end of pool collection

DistributionDay DealStatus

waterfall executed depends on deal status

CleanUp

waterfall exectued upon a clean up call

OnClosingDay

waterfall executed on deal closing day

DefaultDistribution

default waterfall executed

RampUp

ramp up

WithinTrigger String

waterfall executed within a trigger

CustomWaterfall String

custom waterfall

Instances

Instances details
FromJSON ActionWhen Source # 
Instance details

Defined in Types

FromJSONKey ActionWhen Source # 
Instance details

Defined in Types

ToJSON ActionWhen Source # 
Instance details

Defined in Types

ToJSONKey ActionWhen Source # 
Instance details

Defined in Types

Generic ActionWhen Source # 
Instance details

Defined in Types

Associated Types

type Rep ActionWhen 
Instance details

Defined in Types

type Rep ActionWhen = D1 ('MetaData "ActionWhen" "Types" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) (((C1 ('MetaCons "EndOfPoolCollection" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DistributionDay" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DealStatus))) :+: (C1 ('MetaCons "CleanUp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OnClosingDay" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "DefaultDistribution" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RampUp" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "WithinTrigger" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "CustomWaterfall" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))
Read ActionWhen Source # 
Instance details

Defined in Types

Show ActionWhen Source # 
Instance details

Defined in Types

Eq ActionWhen Source # 
Instance details

Defined in Types

Ord ActionWhen Source # 
Instance details

Defined in Types

type Rep ActionWhen Source # 
Instance details

Defined in Types

type Rep ActionWhen = D1 ('MetaData "ActionWhen" "Types" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) (((C1 ('MetaCons "EndOfPoolCollection" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DistributionDay" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DealStatus))) :+: (C1 ('MetaCons "CleanUp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OnClosingDay" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "DefaultDistribution" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RampUp" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "WithinTrigger" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "CustomWaterfall" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))

data BookType Source #

Instances

Instances details
FromJSON BookType Source # 
Instance details

Defined in Waterfall

ToJSON BookType Source # 
Instance details

Defined in Waterfall

Generic BookType Source # 
Instance details

Defined in Waterfall

Methods

from :: BookType -> Rep BookType x #

to :: Rep BookType x -> BookType #

Show BookType Source # 
Instance details

Defined in Waterfall

Eq BookType Source # 
Instance details

Defined in Waterfall

Ord BookType Source # 
Instance details

Defined in Waterfall

type Rep BookType Source # 
Instance details

Defined in Waterfall

data ExtraSupport Source #

Constructors

SupportAccount AccountName (Maybe BookLedger)

if there is deficit, draw another account to pay the shortfall

SupportLiqFacility LiquidityProviderName

if there is deficit, draw facility's available credit to pay the shortfall

MultiSupport [ExtraSupport]

if there is deficit, draw multiple supports (by sequence in the list) to pay the shortfall

WithCondition Pre ExtraSupport

support only available if Pre is true

Instances

Instances details
FromJSON ExtraSupport Source # 
Instance details

Defined in Waterfall

ToJSON ExtraSupport Source # 
Instance details

Defined in Waterfall

Generic ExtraSupport Source # 
Instance details

Defined in Waterfall

Associated Types

type Rep ExtraSupport 
Instance details

Defined in Waterfall

Show ExtraSupport Source # 
Instance details

Defined in Waterfall

Eq ExtraSupport Source # 
Instance details

Defined in Waterfall

Ord ExtraSupport Source # 
Instance details

Defined in Waterfall

type Rep ExtraSupport Source # 
Instance details

Defined in Waterfall

data PayOrderBy Source #

Instances

Instances details
FromJSON PayOrderBy Source # 
Instance details

Defined in Waterfall

ToJSON PayOrderBy Source # 
Instance details

Defined in Waterfall

Generic PayOrderBy Source # 
Instance details

Defined in Waterfall

Associated Types

type Rep PayOrderBy 
Instance details

Defined in Waterfall

type Rep PayOrderBy = D1 ('MetaData "PayOrderBy" "Waterfall" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) ((C1 ('MetaCons "ByName" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ByProRataCurBal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ByCurrentRate" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ByMaturity" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ByStartDate" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ByCustomNames" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String])) :+: C1 ('MetaCons "ReverseSeq" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PayOrderBy)))))
Show PayOrderBy Source # 
Instance details

Defined in Waterfall

Eq PayOrderBy Source # 
Instance details

Defined in Waterfall

Ord PayOrderBy Source # 
Instance details

Defined in Waterfall

type Rep PayOrderBy Source # 
Instance details

Defined in Waterfall

type Rep PayOrderBy = D1 ('MetaData "PayOrderBy" "Waterfall" "Hastructure-0.50.4-C46IQoFqEMALLVrlvHB4m" 'False) ((C1 ('MetaCons "ByName" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ByProRataCurBal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ByCurrentRate" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ByMaturity" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ByStartDate" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ByCustomNames" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String])) :+: C1 ('MetaCons "ReverseSeq" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PayOrderBy)))))