@fintekkers/ledger-models 1.1.16 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog/measures.json +88 -30
- package/package.json +1 -1
package/catalog/measures.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_doc": "applies_to lists the products a measure covers. Each entry is a ProductTypeProto name (e.g. TIPS, TREASURY_FRN) or a node name from ../hierarchy.json (e.g. BOND, STOCK, CASH_INSTRUMENT), which covers every product type under it.",
|
|
2
|
+
"_doc": "applies_to lists the products a measure covers. Each entry is a ProductTypeProto name (e.g. TIPS, TREASURY_FRN) or a node name from ../hierarchy.json (e.g. BOND, STOCK, CASH_INSTRUMENT), which covers every product type under it. computed_by says where a measure's value comes from: input (supplied by the caller, not computed), ledger-service or valuation-service. The UNKNOWN_MEASURE sentinel has computed_by null. depends_on lists what a measure is computed from: other measure names from this catalog, plus these inputs: TAX_LOTS (the position's tax lots), SECURITY_TERMS (the security's terms and conditions), CPI_U (the CPI-U index series), BILL_FIXINGS (T-bill auction fixings), YIELD_CURVE (the discount curve) and TREASURY_PRICES (Treasury market prices). It is empty for an input.",
|
|
3
3
|
"schema_version": "1.0",
|
|
4
4
|
"measures": [
|
|
5
5
|
{
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"category": "sentinel",
|
|
13
13
|
"applies_to": [],
|
|
14
14
|
"model_assumptions": [],
|
|
15
|
-
"implemented": false
|
|
15
|
+
"implemented": false,
|
|
16
|
+
"computed_by": null,
|
|
17
|
+
"depends_on": []
|
|
16
18
|
},
|
|
17
19
|
{
|
|
18
20
|
"name": "DIRECTED_QUANTITY",
|
|
@@ -24,7 +26,9 @@
|
|
|
24
26
|
"category": "input",
|
|
25
27
|
"applies_to": ["BOND", "TIPS", "TREASURY_FRN", "STOCK", "CASH_INSTRUMENT"],
|
|
26
28
|
"model_assumptions": [],
|
|
27
|
-
"implemented": true
|
|
29
|
+
"implemented": true,
|
|
30
|
+
"computed_by": "ledger-service",
|
|
31
|
+
"depends_on": ["TAX_LOTS"]
|
|
28
32
|
},
|
|
29
33
|
{
|
|
30
34
|
"name": "MARKET_VALUE",
|
|
@@ -38,7 +42,9 @@
|
|
|
38
42
|
"model_assumptions": [
|
|
39
43
|
"None — direct mark-to-market calculation"
|
|
40
44
|
],
|
|
41
|
-
"implemented": true
|
|
45
|
+
"implemented": true,
|
|
46
|
+
"computed_by": "valuation-service",
|
|
47
|
+
"depends_on": ["CLEAN_PRICE", "DIRECTED_QUANTITY", "INDEX_RATIO"]
|
|
42
48
|
},
|
|
43
49
|
{
|
|
44
50
|
"name": "UNADJUSTED_COST_BASIS",
|
|
@@ -52,7 +58,9 @@
|
|
|
52
58
|
"model_assumptions": [
|
|
53
59
|
"None — pass-through of the input price"
|
|
54
60
|
],
|
|
55
|
-
"implemented": true
|
|
61
|
+
"implemented": true,
|
|
62
|
+
"computed_by": "ledger-service",
|
|
63
|
+
"depends_on": ["TAX_LOTS"]
|
|
56
64
|
},
|
|
57
65
|
{
|
|
58
66
|
"name": "ADJUSTED_COST_BASIS",
|
|
@@ -83,7 +91,9 @@
|
|
|
83
91
|
"Treasury FRN other indices (e.g. SOFR): not defined yet",
|
|
84
92
|
"No lots: the measure is absent, with a \"no open lots\" warning, never 0"
|
|
85
93
|
],
|
|
86
|
-
"implemented": false
|
|
94
|
+
"implemented": false,
|
|
95
|
+
"computed_by": "valuation-service",
|
|
96
|
+
"depends_on": ["TAX_LOTS", "SECURITY_TERMS", "REFERENCE_CPI", "BILL_FIXINGS"]
|
|
87
97
|
},
|
|
88
98
|
{
|
|
89
99
|
"name": "CURRENT_YIELD",
|
|
@@ -99,7 +109,9 @@
|
|
|
99
109
|
"For TIPS, uses the inflation-adjusted principal for the annual coupon calculation",
|
|
100
110
|
"Day count: Actual/365 for years-to-maturity calculation"
|
|
101
111
|
],
|
|
102
|
-
"implemented": true
|
|
112
|
+
"implemented": true,
|
|
113
|
+
"computed_by": "valuation-service",
|
|
114
|
+
"depends_on": ["CLEAN_PRICE", "SECURITY_TERMS"]
|
|
103
115
|
},
|
|
104
116
|
{
|
|
105
117
|
"name": "YIELD_TO_MATURITY",
|
|
@@ -117,7 +129,9 @@
|
|
|
117
129
|
"Day count: Actual/365 for years-to-maturity",
|
|
118
130
|
"Solver: Newton-Raphson iteration with linear approximation initial guess"
|
|
119
131
|
],
|
|
120
|
-
"implemented": true
|
|
132
|
+
"implemented": true,
|
|
133
|
+
"computed_by": "valuation-service",
|
|
134
|
+
"depends_on": ["CLEAN_PRICE", "SECURITY_TERMS", "INDEX_RATIO"]
|
|
121
135
|
},
|
|
122
136
|
{
|
|
123
137
|
"name": "MACAULAY_DURATION",
|
|
@@ -133,7 +147,9 @@
|
|
|
133
147
|
"Flat yield curve (single rate for all maturities)",
|
|
134
148
|
"Settlement on a coupon date (integer period exponents)"
|
|
135
149
|
],
|
|
136
|
-
"implemented": true
|
|
150
|
+
"implemented": true,
|
|
151
|
+
"computed_by": "valuation-service",
|
|
152
|
+
"depends_on": ["YIELD_TO_MATURITY"]
|
|
137
153
|
},
|
|
138
154
|
{
|
|
139
155
|
"name": "PRESENT_VALUE",
|
|
@@ -149,7 +165,9 @@
|
|
|
149
165
|
"For TIPS: inflation-adjusted cash flows discounted at REAL_YIELD, consistent with clean_price × index_ratio",
|
|
150
166
|
"Three-way invariant: price == present_value == sum(cashflow_pvs)"
|
|
151
167
|
],
|
|
152
|
-
"implemented": true
|
|
168
|
+
"implemented": true,
|
|
169
|
+
"computed_by": "valuation-service",
|
|
170
|
+
"depends_on": ["YIELD_TO_MATURITY"]
|
|
153
171
|
},
|
|
154
172
|
{
|
|
155
173
|
"name": "REAL_YIELD",
|
|
@@ -164,7 +182,9 @@
|
|
|
164
182
|
"Same solver and conventions as YIELD_TO_MATURITY",
|
|
165
183
|
"The quoted real price is scaled by the same index ratio as the cash flows, so the result is the true real yield and does not change with CPI"
|
|
166
184
|
],
|
|
167
|
-
"implemented": true
|
|
185
|
+
"implemented": true,
|
|
186
|
+
"computed_by": "valuation-service",
|
|
187
|
+
"depends_on": ["YIELD_TO_MATURITY"]
|
|
168
188
|
},
|
|
169
189
|
{
|
|
170
190
|
"name": "INFLATION_ADJUSTED_PRINCIPAL",
|
|
@@ -179,7 +199,9 @@
|
|
|
179
199
|
"Uses base_cpi from the security's tips_extension and the reference CPI from TipsInput.cpi",
|
|
180
200
|
"Deflation floor applies only to the principal at maturity; interim coupons use the raw adjusted principal"
|
|
181
201
|
],
|
|
182
|
-
"implemented": true
|
|
202
|
+
"implemented": true,
|
|
203
|
+
"computed_by": "valuation-service",
|
|
204
|
+
"depends_on": ["SECURITY_TERMS", "INDEX_RATIO"]
|
|
183
205
|
},
|
|
184
206
|
{
|
|
185
207
|
"name": "PRESENT_VALUE_CASHFLOWS",
|
|
@@ -194,7 +216,9 @@
|
|
|
194
216
|
"Same as PRESENT_VALUE",
|
|
195
217
|
"Three-way invariant: sum(pv_amounts) == present_value == price"
|
|
196
218
|
],
|
|
197
|
-
"implemented": true
|
|
219
|
+
"implemented": true,
|
|
220
|
+
"computed_by": "valuation-service",
|
|
221
|
+
"depends_on": ["YIELD_TO_MATURITY", "YIELD_CURVE"]
|
|
198
222
|
},
|
|
199
223
|
{
|
|
200
224
|
"name": "DISCOUNT_MARGIN",
|
|
@@ -212,7 +236,9 @@
|
|
|
212
236
|
"Solver: Newton-Raphson, same as YTM",
|
|
213
237
|
"T_BILL_13_WEEK fixings: FrnInput.fixings rate is the auction's high discount rate as Treasury publishes it, in percent per annum on a bank-discount basis (4.215 = 4.215%), the same as IssuanceProto.high_discount_rate. valuation-service converts it to the money-market yield the FRN accrues on, using the fixing's bill_maturity_date. SOFR fixings stay decimal fractions (0.0432 = 4.32%)."
|
|
214
238
|
],
|
|
215
|
-
"implemented": true
|
|
239
|
+
"implemented": true,
|
|
240
|
+
"computed_by": "valuation-service",
|
|
241
|
+
"depends_on": ["CLEAN_PRICE", "YIELD_CURVE", "BILL_FIXINGS"]
|
|
216
242
|
},
|
|
217
243
|
{
|
|
218
244
|
"name": "SPREAD_DURATION",
|
|
@@ -228,7 +254,9 @@
|
|
|
228
254
|
"Uses a symmetric 1bp bump for numerical differentiation",
|
|
229
255
|
"Interest rate duration of an FRN is near-zero; spread duration captures the economically significant risk"
|
|
230
256
|
],
|
|
231
|
-
"implemented": true
|
|
257
|
+
"implemented": true,
|
|
258
|
+
"computed_by": "valuation-service",
|
|
259
|
+
"depends_on": ["DISCOUNT_MARGIN", "YIELD_CURVE"]
|
|
232
260
|
},
|
|
233
261
|
{
|
|
234
262
|
"name": "PAR_YIELD",
|
|
@@ -243,7 +271,9 @@
|
|
|
243
271
|
"Coupon frequency matches market convention (semiannual for US Treasuries)",
|
|
244
272
|
"Interpolation between observed maturities uses method specified in CurveRequestProto"
|
|
245
273
|
],
|
|
246
|
-
"implemented": false
|
|
274
|
+
"implemented": false,
|
|
275
|
+
"computed_by": "valuation-service",
|
|
276
|
+
"depends_on": ["TREASURY_PRICES"]
|
|
247
277
|
},
|
|
248
278
|
{
|
|
249
279
|
"name": "SPOT_YIELD",
|
|
@@ -258,7 +288,9 @@
|
|
|
258
288
|
"Requires a complete par yield curve as input",
|
|
259
289
|
"Bootstrap assumes exact coupon dates"
|
|
260
290
|
],
|
|
261
|
-
"implemented": false
|
|
291
|
+
"implemented": false,
|
|
292
|
+
"computed_by": "valuation-service",
|
|
293
|
+
"depends_on": ["PAR_YIELD"]
|
|
262
294
|
},
|
|
263
295
|
{
|
|
264
296
|
"name": "FORWARD_YIELD",
|
|
@@ -274,7 +306,9 @@
|
|
|
274
306
|
"No-arbitrage between spot and forward rates",
|
|
275
307
|
"Forward period defined by adjacent tenor points"
|
|
276
308
|
],
|
|
277
|
-
"implemented": false
|
|
309
|
+
"implemented": false,
|
|
310
|
+
"computed_by": "valuation-service",
|
|
311
|
+
"depends_on": ["SPOT_YIELD"]
|
|
278
312
|
},
|
|
279
313
|
{
|
|
280
314
|
"name": "PROFIT_LOSS",
|
|
@@ -288,7 +322,9 @@
|
|
|
288
322
|
"model_assumptions": [
|
|
289
323
|
"The measure is absent, never 0, when MarketValue, UnadjustedCostBasis or DirectedQuantity is unavailable"
|
|
290
324
|
],
|
|
291
|
-
"implemented": true
|
|
325
|
+
"implemented": true,
|
|
326
|
+
"computed_by": "valuation-service",
|
|
327
|
+
"depends_on": ["MARKET_VALUE", "UNADJUSTED_COST_BASIS", "DIRECTED_QUANTITY"]
|
|
292
328
|
},
|
|
293
329
|
{
|
|
294
330
|
"name": "PROFIT_LOSS_PERCENT",
|
|
@@ -302,7 +338,9 @@
|
|
|
302
338
|
"model_assumptions": [
|
|
303
339
|
"The measure is absent, never 0, when MarketValue, UnadjustedCostBasis or DirectedQuantity is unavailable"
|
|
304
340
|
],
|
|
305
|
-
"implemented": true
|
|
341
|
+
"implemented": true,
|
|
342
|
+
"computed_by": "valuation-service",
|
|
343
|
+
"depends_on": ["PROFIT_LOSS", "UNADJUSTED_COST_BASIS"]
|
|
306
344
|
},
|
|
307
345
|
{
|
|
308
346
|
"name": "ACCRUED_INTEREST",
|
|
@@ -318,7 +356,9 @@
|
|
|
318
356
|
"Treasury FRNs: the fixings are the ones supplied in the request; no curve is used",
|
|
319
357
|
"Returns null/zero for Equity, Cash, and zero-coupon bonds"
|
|
320
358
|
],
|
|
321
|
-
"implemented": true
|
|
359
|
+
"implemented": true,
|
|
360
|
+
"computed_by": "valuation-service",
|
|
361
|
+
"depends_on": ["SECURITY_TERMS", "BILL_FIXINGS"]
|
|
322
362
|
},
|
|
323
363
|
{
|
|
324
364
|
"name": "CONVEXITY",
|
|
@@ -335,7 +375,9 @@
|
|
|
335
375
|
"For FRN: uses flat-forwards effective YTM (same model as PRESENT_VALUE)",
|
|
336
376
|
"Settlement on a coupon date (integer period exponents)"
|
|
337
377
|
],
|
|
338
|
-
"implemented": true
|
|
378
|
+
"implemented": true,
|
|
379
|
+
"computed_by": "valuation-service",
|
|
380
|
+
"depends_on": ["YIELD_TO_MATURITY"]
|
|
339
381
|
},
|
|
340
382
|
{
|
|
341
383
|
"name": "DIRTY_PRICE",
|
|
@@ -347,7 +389,9 @@
|
|
|
347
389
|
"category": "valuation",
|
|
348
390
|
"applies_to": ["BOND", "TIPS", "TREASURY_FRN"],
|
|
349
391
|
"model_assumptions": [],
|
|
350
|
-
"implemented": true
|
|
392
|
+
"implemented": true,
|
|
393
|
+
"computed_by": "valuation-service",
|
|
394
|
+
"depends_on": ["CLEAN_PRICE", "ACCRUED_INTEREST"]
|
|
351
395
|
},
|
|
352
396
|
{
|
|
353
397
|
"name": "CLEAN_PRICE",
|
|
@@ -359,7 +403,9 @@
|
|
|
359
403
|
"category": "input",
|
|
360
404
|
"applies_to": ["BOND", "TIPS", "TREASURY_FRN"],
|
|
361
405
|
"model_assumptions": [],
|
|
362
|
-
"implemented": false
|
|
406
|
+
"implemented": false,
|
|
407
|
+
"computed_by": "input",
|
|
408
|
+
"depends_on": []
|
|
363
409
|
},
|
|
364
410
|
{
|
|
365
411
|
"name": "MODIFIED_DURATION",
|
|
@@ -371,7 +417,9 @@
|
|
|
371
417
|
"category": "risk",
|
|
372
418
|
"applies_to": ["BOND", "TIPS", "TREASURY_FRN"],
|
|
373
419
|
"model_assumptions": [],
|
|
374
|
-
"implemented": true
|
|
420
|
+
"implemented": true,
|
|
421
|
+
"computed_by": "valuation-service",
|
|
422
|
+
"depends_on": ["MACAULAY_DURATION"]
|
|
375
423
|
},
|
|
376
424
|
{
|
|
377
425
|
"name": "DV01",
|
|
@@ -383,7 +431,9 @@
|
|
|
383
431
|
"category": "risk",
|
|
384
432
|
"applies_to": ["BOND", "TIPS", "TREASURY_FRN"],
|
|
385
433
|
"model_assumptions": [],
|
|
386
|
-
"implemented": true
|
|
434
|
+
"implemented": true,
|
|
435
|
+
"computed_by": "valuation-service",
|
|
436
|
+
"depends_on": ["MODIFIED_DURATION", "MARKET_VALUE"]
|
|
387
437
|
},
|
|
388
438
|
{
|
|
389
439
|
"name": "DISCOUNT_YIELD",
|
|
@@ -399,7 +449,9 @@
|
|
|
399
449
|
"360-day year (Actual/360 day count)",
|
|
400
450
|
"Assumes the security has a defined maturity_date and face_value; null for instruments where days_to_maturity is undefined"
|
|
401
451
|
],
|
|
402
|
-
"implemented": true
|
|
452
|
+
"implemented": true,
|
|
453
|
+
"computed_by": "valuation-service",
|
|
454
|
+
"depends_on": ["CLEAN_PRICE", "SECURITY_TERMS"]
|
|
403
455
|
},
|
|
404
456
|
{
|
|
405
457
|
"name": "BOND_EQUIVALENT_YIELD",
|
|
@@ -415,7 +467,9 @@
|
|
|
415
467
|
"365-day year (Actual/365 day count)",
|
|
416
468
|
"Same applicability constraints as DISCOUNT_YIELD"
|
|
417
469
|
],
|
|
418
|
-
"implemented": true
|
|
470
|
+
"implemented": true,
|
|
471
|
+
"computed_by": "valuation-service",
|
|
472
|
+
"depends_on": ["CLEAN_PRICE", "SECURITY_TERMS"]
|
|
419
473
|
},
|
|
420
474
|
{
|
|
421
475
|
"name": "REFERENCE_CPI",
|
|
@@ -432,7 +486,9 @@
|
|
|
432
486
|
"Request rejected unless readings are exactly months m-3 and m-2 (UTC settlement month)",
|
|
433
487
|
"Absent when no CPI is given"
|
|
434
488
|
],
|
|
435
|
-
"implemented": false
|
|
489
|
+
"implemented": false,
|
|
490
|
+
"computed_by": "valuation-service",
|
|
491
|
+
"depends_on": ["CPI_U"]
|
|
436
492
|
},
|
|
437
493
|
{
|
|
438
494
|
"name": "INDEX_RATIO",
|
|
@@ -448,7 +504,9 @@
|
|
|
448
504
|
"Unrounded (Treasury publishes 5 decimals)",
|
|
449
505
|
"Unfloored: the deflation floor applies to INFLATION_ADJUSTED_PRINCIPAL only"
|
|
450
506
|
],
|
|
451
|
-
"implemented": false
|
|
507
|
+
"implemented": false,
|
|
508
|
+
"computed_by": "valuation-service",
|
|
509
|
+
"depends_on": ["REFERENCE_CPI", "SECURITY_TERMS"]
|
|
452
510
|
}
|
|
453
511
|
]
|
|
454
512
|
}
|