-
Notifications
You must be signed in to change notification settings - Fork 0
/
product-api-repo-product-func.rosetta
238 lines (180 loc) · 7.11 KB
/
product-api-repo-product-func.rosetta
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
namespace cdm.api.repo : <"API for access to repo components.">
version "${project.version}"
import cdm.base.*
import cdm.base.math.*
import cdm.base.datetime.*
import cdm.base.staticdata.party.*
import cdm.base.staticdata.identifier.*
import cdm.base.staticdata.asset.common.*
import cdm.observable.asset.*
import cdm.observable.common.*
import cdm.observable.event.*
import cdm.product.template.*
import cdm.product.asset.*
import cdm.product.common.schedule.*
import cdm.product.common.settlement.*
import cdm.observable.asset.*
import cdm.base.staticdata.asset.rates.*
import cdm.base.datetime.*
import cdm.product.collateral.*
import cdm.legaldocumentation.common.*
import cdm.legaldocumentation.master.*
import cdm.event.workflow.*
import cdm.event.position.*
import cdm.event.common.*
import cdm.product.template.*
import cdm.api.repo.common.*
func GetRepoTermType:
inputs:
product Product (1..1)
output:
termType string (1..1)
alias termDate:
product->contractualProduct->economicTerms->terminationDate->adjustableDate->adjustedDate
set termType:
if termDate exists
then 'TERM'
else
'OPEN'
func GetRepoRateType:
inputs:
product Product (1..1)
output:
rateType string (1..1)
alias fixedRate:
product->contractualProduct->economicTerms->payout->interestRatePayout->rateSpecification->fixedRate
set rateType:
if fixedRate exists
then 'FIXED'
else
'FLOAT'
func GetFloatingRateIndexDescription:
inputs:
product Product (1..1)
output:
indexName string (1..1)
set indexName:
product->contractualProduct->economicTerms->payout->interestRatePayout->rateSpecification->floatingRate->rateOption->floatingRateIndex first to-string
func SetFloatingRateIndex:
inputs:
floatingRateIndex FloatingRateIndexEnum (1..1)
output:
rateOption FloatingRateOption (1..1)
set rateOption->floatingRateIndex: floatingRateIndex
func GetFloatingRateIndexResetFreq:
inputs:
product Product (1..1)
output:
indexFreq string (1..1)
alias indexFreqMultiplier:
product->contractualProduct->economicTerms->payout->interestRatePayout->rateSpecification->floatingRate->rateOption->indexTenor->periodMultiplier first to-string
alias indexFreqPeriod:
product->contractualProduct->economicTerms->payout->interestRatePayout->rateSpecification->floatingRate->rateOption->indexTenor->period first to-string
set indexFreq:
indexFreqMultiplier + indexFreqPeriod
func SetFloatingRateIndexResetFreq:
inputs:
indexPeriod PeriodEnum (1..1)
indexMultiplier int (1..1)
output:
rateOption FloatingRateOption (1..1)
set rateOption->indexTenor->periodMultiplier: indexMultiplier
set rateOption->indexTenor->period: indexPeriod
func GetInterestPaymentFreq:
inputs:
product Product (1..1)
output:
paymentFreq string (1..1)
alias paymentFreqMultiplier:
product->contractualProduct->economicTerms->payout->interestRatePayout->paymentDates->paymentFrequency->periodMultiplier first to-string
alias paymentFreqPeriod:
product->contractualProduct->economicTerms->payout->interestRatePayout->paymentDates->paymentFrequency->period first to-string
set paymentFreq:
paymentFreqMultiplier + paymentFreqPeriod
func GetTerminalableOnDemand:
inputs:
product Product (1..1)
output:
terminable boolean (1..1)
set terminable:
product->contractualProduct->economicTerms->terminationProvision->cancelableProvision->effectivePeriod exists
or
product->contractualProduct->economicTerms->terminationProvision->cancelableProvision->effectiveDate exists
func GetNoticePeriod:
inputs:
product Product (1..1)
output:
noticePeriod string(1..1)
set noticePeriod:
product->contractualProduct->economicTerms->terminationProvision->cancelableProvision->effectivePeriod->period to-string +
product->contractualProduct->economicTerms->terminationProvision->cancelableProvision->effectivePeriod->periodMultiplier to-string
func GetDeliveryMethod:
inputs:
assetLeg AssetLeg(1..1)
output:
deliveryMethod string (1..*)
set deliveryMethod:
assetLeg->deliveryMethod to-string
func GetSubstitutionAllowed:
inputs:
product Product (1..1)
output:
substitution boolean (1..1)
set substitution:
product->contractualProduct->economicTerms->collateral->collateralProvisions->substitutionProvisions->numberOfSubstitutionsAllowed > 0
func GetSettlementCurrency:
inputs:
product Product (1..1)
output:
currency string (1..1)
set currency:
product->contractualProduct->economicTerms->payout->interestRatePayout->settlementTerms->cashSettlementTerms -> cashSettlementAmount->unit->currency first to-string
func GetDayCountFraction:
inputs:
product Product (1..1)
output:
dayCount string (1..1)
set dayCount:
product->contractualProduct->economicTerms->payout->interestRatePayout->dayCountFraction first to-string
func GetBusinessCenter:
inputs:
product Product (1..1)
output:
businessCenter string (1..1)
alias businessCenterName:
if (product->contractualProduct->economicTerms->effectiveDate->adjustableDate->dateAdjustments exists)
then product->contractualProduct->economicTerms->effectiveDate->adjustableDate->dateAdjustments->businessCenters->businessCenter first to-string
else if (product->contractualProduct->economicTerms->effectiveDate->relativeDate exists)
then product->contractualProduct->economicTerms->effectiveDate->relativeDate->relativeDateAdjustments->businessCenters->businessCenter first to-string
set businessCenter:
businessCenterName
func Create_FloatingRateFixedTermRepoProduct:
inputs:
purchaseDate date (1..1)
repurchaseDate date (1..1)
collateral Collateral (1..1)
terminationProvision TerminationProvision (1..1)
floatingRateIndex FloatingRateIndexEnum (1..1)
indexPeriod PeriodEnum (1..1)
indexMultiplier int (1..1)
output:
product Product (1..1)
set product:SetPurchaseDate(product,purchaseDate)
set product:SetRePurchaseDate(product,repurchaseDate)
set product->contractualProduct->economicTerms->payout->interestRatePayout->rateSpecification->floatingRate->rateOption:SetFloatingRateIndex(floatingRateIndex)
set product->contractualProduct->economicTerms->payout->interestRatePayout->rateSpecification->floatingRate->rateOption:SetFloatingRateIndexResetFreq(indexPeriod,indexMultiplier)
set product->contractualProduct->economicTerms->collateral:collateral
set product->contractualProduct->economicTerms->terminationProvision:terminationProvision
func Create_FixedRateFixedTermRepoProduct:
inputs:
purchaseDate date (1..1)
repurchaseDate date (1..1)
collateral Collateral (1..1)
terminationProvision TerminationProvision (1..1)
output:
product Product (1..1)
set product:SetPurchaseDate(product,purchaseDate)
set product:SetRePurchaseDate(product,repurchaseDate)
set product->contractualProduct->economicTerms->payout->interestRatePayout->rateSpecification->fixedRate->rateSchedule->price->priceType:PriceTypeEnum->InterestRate
set product->contractualProduct->economicTerms->collateral:collateral
set product->contractualProduct->economicTerms->terminationProvision:terminationProvision