-
Notifications
You must be signed in to change notification settings - Fork 463
/
ContractState.hs
30 lines (27 loc) · 1.8 KB
/
ContractState.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{-# LANGUAGE DerivingStrategies #-}
module Language.Marlowe.ACTUS.Definitions.ContractState where
import Data.Time (LocalTime)
import Language.Marlowe (Observation, Value)
import Language.Marlowe.ACTUS.Definitions.ContractTerms (PRF)
{-| ACTUS contract states are defined in
https://github.com/actusfrf/actus-dictionary/blob/master/actus-dictionary-states.json
-}
data ContractStatePoly a b = ContractStatePoly
{
tmd :: Maybe b -- ^ Maturity Date (MD): The timestamp as per which the contract matures according to the initial terms or as per unscheduled events
, nt :: a -- ^ Notional Principal (NT): The outstanding nominal value
, ipnr :: a -- ^ Nominal Interest Rate (IPNR) : The applicable nominal rate
, ipac :: a -- ^ Accrued Interest (IPAC): The current value of accrued interest
, feac :: a -- ^ Fee Accrued (FEAC): The current value of accrued fees
, nsc :: a -- ^ Notional Scaling Multiplier (SCNT): The multiplier being applied to principal cash flows
, isc :: a -- ^ InterestScalingMultiplier (SCIP): The multiplier being applied to interest cash flows
, prf :: PRF -- ^ Contract Performance (PRF)
, sd :: b -- ^ Status Date (MD): The timestamp as per which the state is captured at any point in time
, prnxt :: a -- ^ Next Principal Redemption Payment (PRNXT): The value at which principal is being repaid
, ipcb :: a -- ^ Interest Calculation Base (IPCB)
, xd :: Maybe b -- ^ Exercise Date (XD)
, xa :: Maybe a -- ^ Exercise Amount (XA)
}
deriving stock (Show, Eq)
type ContractState = ContractStatePoly Double LocalTime
type ContractStateMarlowe = ContractStatePoly (Value Observation) (Value Observation)