-
Notifications
You must be signed in to change notification settings - Fork 3
/
swagger-prod.yaml
1384 lines (1261 loc) · 53.1 KB
/
swagger-prod.yaml
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
swagger: '2.0'
info:
title: Cloud Prisma Margin Estimator API
version: "1.0"
description: >-
Cloud Prisma Margin Estimator (CPME) calculates margin for an uploaded portfolio
according to Eurex PRISMA methodology. The application is available to both members
and non-members of Eurex Clearing. It can be accessed via web user interface,
see [CPME GUI](https://cpme.eurex.com), or directly through API,
described here.
The key request is `/estimator`, it is the only request you need to calculate
the margin. Other requests provide lists or details of instruments, available dates etc.
CPME supports also greek and stress price calculation - these analytical tools
are not related to the margin.
[FAQ](https://deutsche-boerse-risk.github.io/CloudPrismaMarginEstimator/)
## API Key
For API access please register at
[Deutsche Boerse API website](https://console.developer.deutsche-boerse.com/apis).
There you create your project, subscribe to "Prisma Margin Estimator" API
and get a key. Use the key in a request header as `X-DBP-APIKEY`, e.g.:
<pre>
curl --header 'X-DBP-APIKEY: your-key' \
https://api.developer.deutsche-boerse.com/prod/prisma-margin-estimator/1.0.0/products
</pre>
Requests from web API portals (Apiary, SwaggerHub) must contain the key as well.
## Example in Python
The **[crossmargining.py](https://github.com/Deutsche-Boerse-Risk/CloudPrismaMarginEstimator-API/blob/master/examples/python/crossmargining.py)** generates a portfolio in CSV format.
The portfolio consists of a 10Y EUR interest rate swap starting two days from today and a short position in Euro-Bund futures.
Initial margin is calculated with and without cross margining (xm = True and xm = False, respectively) and results are printed.
Replace xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx by your API key (see above).
## Compressing request and response
Both requests and responses can be compressed by gzip which can reduce response time for large requests and bypass request size limits.
Use of compression in submitted request is indicated by `Content-Encoding: gzip` header.
Compressed response is requested by `Accept-Encoding: gzip` header.
For example:
<pre>echo '{"etd_portfolio":[{"line_no":1,"product_id":"FEXD","contract_date":20301220,"net_ls_balance":1}]}' \
| gzip \
| curl -s -H "X-DBP-APIKEY: your-key" -H "Content-Type: application/json" \
https://api.developer.deutsche-boerse.com/prod/prisma-margin-estimator/1.0.0/estimator \
--data-binary @- -H "Content-Encoding: gzip" -H "Accept-Encoding: gzip" \
| gunzip
</pre>
It is also possible to use compression only for request or only for response.
## Business date and time
The requests can contain optional business date and time attributes.
The application finds the latest snapshot from the requested business date
with timestamp equal or smaller than the requested time.
If time is not given then the latest timestamp of the business date is used.
It takes several minutes to start the instance for a specified snapshot,
That instance can then serve subsequent requests for the same snapshot.
After some inactive time the instance is shutdown.
It is recommended not to specify a date and time and calculate
current margin or margin as of last end-of-day, see below.
Example of requesting the latest snapshot of given date, in GET and POST type of request:
<pre>curl -H 'X-DBP-APIKEY: your-key' \
'https://api.developer.deutsche-boerse.com/prod/prisma-margin-estimator/1.0.0/series?products=FGBM&business_date=20190307'
echo '{"snapshot":{"business_date":20190307}, "etd_portfolio":[{"line_no":1,"product_id":"FEXD","contract_date":20301220,"net_ls_balance":1}]}' \
| curl -H 'X-DBP-APIKEY: your-key' \
'https://api.developer.deutsche-boerse.com/prod/prisma-margin-estimator/1.0.0/estimator' \
--data-binary @-
</pre>
If business date is not given, the latest business date is used.
If only live=False is specified, last end-of-day is used.
Calculation instance for these two requests is always up,
you should not experience any delay.
Response contains identification of the selected snapshot,
see attributes `business_date`, `live` and `live_timestamp`.
## Change log
- 6.8.0 Security Basket ISIN, errors explained
- 6.5.0 ETD maturity specified preferably by contract_date
- 6.1.1 default 1T payment period for inflation swaps, ignore unknown calendars
- 5.7.0 support for inflation swaps
- 5.4.0 fixed bug in etd_cp005 parser
- 5.2.0 request with live=false without date means last end-of-day
- 4.2.1 OTC trade details in estimator response
- 4.1.1 historical snapshots also for list of products, series and currencies
- 4.0.0 introduction of OTC portfolio components, cross-margining and historical snapshots
termsOfService: 'https://cpme.eurex.com/terms'
host: api.developer.deutsche-boerse.com
basePath: /prod/prisma-margin-estimator/1.0.0/
schemes:
- https
paths:
/products:
get:
summary: List All Products
description: >-
Lists all exchange-traded products, Eurex and ECC.
Only `product` and `instrument_type` are returned by default.
Remaining attributes (see response) are returned only if specified in `extrafields`.
parameters:
- $ref: '#/parameters/x_dbp_apikey'
- $ref: '#/parameters/extrafields'
- $ref: '#/parameters/business_date'
- $ref: '#/parameters/live'
- $ref: '#/parameters/live_timestamp'
responses:
'200':
description: OK
headers: {}
examples:
application/json:
business_date: 20180809
live: false
live_timestamp: 0
products:
- product: OSMI
instrument_type: option
clearing_house: EUXCDEFF
prod_name: OPT ON SWISS MARKET INDEX
prod_isin: CH0008616382
underlying_isin: CH0009980894
currency: CHF
product_type: OINX
extended_product_type:
margin_style_flag: T
exercise_style_flag: E
product_settlement_type: CASH
final_settlement_time: '09:00'
product_tick_size: 0.1
product_tick_value: 1.0
liquidation_group: PEQ01
xm_eligibility: false
schema:
type: object
properties:
business_date:
$ref: '#/definitions/business_date'
live:
$ref: '#/definitions/live'
live_timestamp:
$ref: '#/definitions/live_timestamp'
products:
type: array
items:
type: object
properties:
product:
$ref: '#/definitions/product_id'
instrument_type:
type: string
enum: [future,option]
description: Product line, i.e. either future or option
clearing_house:
type: string
prod_name:
type: string
prod_isin:
type: string
underlying_isin:
type: string
currency:
$ref: '#/definitions/currency'
product_type:
type: string
extended_product_type:
type: string
description: refinement of product type, can be empty
margin_style_flag:
type: string
enum: [T,F]
description: T for traditional, F for future-style
exercise_style_flag:
$ref: '#/definitions/exercise_style_flag'
product_settlement_type:
type: string
enum: [PHYSICAL,CASH]
final_settlement_time:
type: string
product_tick_size:
type: number
product_tick_value:
type: number
liquidation_group:
$ref: '#/definitions/liquidation_group'
xm_eligibility:
type: boolean
required:
- product
- instrument_type
/series:
get:
summary: List Series of a Product
description: >-
List all series of exchange traded product(s).
Attributes upto `iid` are returned by default.
Remaining attributes (see response) are returned only if specified in `extrafields`.
parameters:
- $ref: '#/parameters/x_dbp_apikey'
- $ref: '#/parameters/extrafields'
- $ref: '#/parameters/business_date'
- $ref: '#/parameters/live'
- $ref: '#/parameters/live_timestamp'
- name: products
in: query
description: Product ID, there can be multiple instances of the parameter to request series for several products
required: true
type: string
- name: flex
in: query
description: Return also flex series? True or false. Default setting is false.
required: false
type: boolean
responses:
'200':
description: OK
headers: {}
examples:
application/json:
business_date: 20180809
live: false
live_timestamp: 0
list_series:
- product_id: OGBL
contract_date: 20190621
contract_maturity: 201906
expiry_maturity: 201906
call_put_flag: C
exercise_price: 160
version_number: '0'
iid: 18249016
schema:
type: object
properties:
business_date:
$ref: '#/definitions/business_date'
live:
$ref: '#/definitions/live'
live_timestamp:
$ref: '#/definitions/live_timestamp'
list_series:
type: array
items:
type: object
properties:
product_id:
$ref: '#/definitions/product_id'
contract_date:
$ref: '#/definitions/contract_date'
contract_maturity:
$ref: '#/definitions/contract_maturity'
expiry_maturity:
$ref: '#/definitions/expiry_maturity'
call_put_flag:
$ref: '#/definitions/call_put_flag'
exercise_price:
$ref: '#/definitions/exercise_price'
version_number:
$ref: '#/definitions/version_number'
iid:
$ref: '#/definitions/iid'
act_trade_unit_no:
type: number
days_to_expiration:
type: number
trade_unit_value:
type: number
exercise_style_flag:
$ref: '#/definitions/exercise_style_flag'
contract_frequency:
$ref: '#/definitions/contract_frequency'
required:
- product_id
- contract_date
- contract_maturity
- expiry_maturity
- version_number
- iid
/securities:
get:
summary: Get attributes of securities
description: >-
Get attributes of securities (equities, bonds, subscription rights) for
given ISIN, or all active securities known to the Risk system if ISIN is
not specified.
The margin class returned with the security is its default margin class and
the currency is the default margin class currency. Bonds always have only one
margin class, the default one. Equities may be assigned to multiple margin
classes based on settlement currency of the transaction - this is intended
for some ETFs.
parameters:
- $ref: '#/parameters/x_dbp_apikey'
- $ref: '#/parameters/business_date'
- $ref: '#/parameters/live'
- $ref: '#/parameters/live_timestamp'
- name: isin
in: query
type: string
description: Security ISIN
required: false
responses:
'200':
description: OK
headers: {}
examples:
application/json:
business_date: 20180809
live: false
live_timestamp: 0
securities:
- sec_id: DB1
sec_isin: DE0005810055
sec_type: SAKT
sec_name: DEUTSCHE BOERSE AG
iid: 1769
currency: EUR
security_mnemonic: DB1
standard_settlement_period: 2
price_unit: ABSOLUTE
security_subtype: EQUITY
margin_class_code: DB10
basket_isin: false
- sec_id:
sec_isin: CH0224397171
sec_type: BCNF
sec_name: EIDGENOSSENSCHAFT 15-30
iid: 13528248
currency: CHF
security_mnemonic:
standard_settlement_period: 3
price_unit: PERCENTAGE
security_subtype: BOND
margin_class_code: S0055
basket_isin: false
schema:
type: object
properties:
business_date:
$ref: '#/definitions/business_date'
live:
$ref: '#/definitions/live'
live_timestamp:
$ref: '#/definitions/live_timestamp'
securities:
type: array
items:
type: object
properties:
sec_id:
$ref: '#/definitions/sec_id'
sec_isin:
$ref: '#/definitions/sec_isin'
sec_type:
$ref: '#/definitions/sec_type'
sec_name:
$ref: '#/definitions/sec_name'
iid:
$ref: '#/definitions/iid'
currency:
$ref: '#/definitions/currency'
security_mnemonic:
$ref: '#/definitions/security_mnemonic'
standard_settlement_period:
$ref: '#/definitions/standard_settlement_period'
price_unit:
$ref: '#/definitions/price_unit'
security_subtype:
$ref: '#/definitions/security_subtype'
margin_class_code:
$ref: '#/definitions/margin_class_code'
basket_isin:
$ref: '#/definitions/basket_isin'
/clearing_currencies:
get:
summary: List All Clearing Currencies
description: List of clearing currencies that can be used in `estimator` request.
parameters:
- $ref: '#/parameters/x_dbp_apikey'
- $ref: '#/parameters/business_date'
- $ref: '#/parameters/live'
- $ref: '#/parameters/live_timestamp'
responses:
'200':
description: OK
headers: {}
examples:
application/json:
business_date: 20180809
live: false
live_timestamp: 0
clearing_currencies:
- EUR
- CHF
- USD
- GBP
schema:
type: object
properties:
business_date:
$ref: '#/definitions/business_date'
live:
$ref: '#/definitions/live'
live_timestamp:
$ref: '#/definitions/live_timestamp'
clearing_currencies:
type: array
items:
type: string
/estimator:
post:
summary: Margin Calculation Request
description: >-
# Margin Calculation
Portfolio is sent in the request and margin is returned as a response.
The request can contain exchange traded derivatives (ETD) portfolio or OTC portfolio or both:
- ETD is submitted as
- `etd_portfolio` JSON array, see request model
- or `etd_csv` with positions in CSV format
- or `etd_cp005`, i.e. using Eurex CP005 XML report
- OTC is submitted as
- `otc_csv` with trades in CSV format known from Margin Calculator or Prisma Margin Estimator, see description bellow
- or `otc_sensitivities` with sensitivities in CSV format
- or `otc_fpml`
- or `otc_cb202`, i.e. EurexOTC CB202 or CB207 report
## ETD portfolio as JSON array
`etd_portfolio` instruments are specified either by full key or by technical `iid`. The technical `iid` takes precedence if both keys are sent. The position always needs `line_no` and `net_ls_balance`.
The full key for series depends on instrument type, these are the mandatory fields:
- Future: `product`, `contract_date` as YYYYMMDD, `version_number` (defaults to 0)
- Option: `product`, `contract_date` as YYYYMMDD, `call_put_flag`, `exercise_price`, `version_number` (defaults to 0)
- Flex Future: `instrument_type`: "Flex Future", `product`, `contract_date` as YYYYMMDD, `version_number` (defaults to 0)
- Flex Option: `instrument_type`: "Flex Option", `product`, `contract_date` as YYYYMMDD, `call_put_flag`, `exercise_price`, `exercise_style`, `version_number` (defaults to 0)
Only already existing Flex Future or Flex Option can be submitted, not a new one (e.g. different strike or expiry day).
For backward compatibility `maturity` as YYYYMM (DD added for flex) can be used instead of `contract_date`, however it is not recommended as uniqueness is not guaranteed.
Example of minimal request with one future contract:
<pre>
curl --header 'X-DBP-APIKEY: your-key' \
https://api.developer.deutsche-boerse.com/prod/prisma-margin-estimator/1.0.0/estimator \
-d '{"etd_portfolio":[{"line_no":1,"product_id":"FEXD","contract_date":20301220,"net_ls_balance":1}]}'
</pre>
## ETD CSV format
See the example in [GUI](https://cpme.eurex.com) for simpler CSV format that does not support flexible instruments or use the CSV format known from Margin Calculator.
## OTC CSV format
The CSV describing all trades is submitted as one string in `csv` attribute of `otc_csv` structure starting with header.
Lines separated by `\n`.
One line contains all information for one trade, including both its legs.
All columns must be present, although some can be empty.
Mandatory columns are marked by asterisk *.
For certain trade types, even some optional columns must be filled, see the description.
If unsure about possible combinations of attribute values please refer to
[EurexOTC Clear IRS Product List](https://www.eurexclearing.com/resource/blob/227404/ff4638f2a3bfedbf511868ef54c6a153/data/ec15075e_Attach.pdf)
or the [OTC template description](https://github.com/Deutsche-Boerse-Risk/CloudPrismaMarginEstimator/raw/master/templates/otc/OTC_template_description.xls).
### Basic OTC trade attributes
- internalTradeID*: id of the trade to distinguish it in drilldown, must be unique
- tradeType*: IRS, Basis swap, OIS, FRA, VNS, ZCIS
- currency*: ISO code of currency, e.g. EUR, CHF, USD, GBP
- effectiveDate*: effective date as DD/MM/YYYY, e.g. 20/12/2018
- terminationDate*: termination date as DD/MM/YYYY, e.g. 20/12/2028
### Pay leg attributes
- payLegType*: fixedLeg or floatingLeg
- payLegSpread: rate for fixedLeg in %, or spread (optional) for floatingLeg in bp
- payLegIndex: index for floatingLeg, if empty, default index for the currency is selected
- payInterestFixedAmount: allowed for fixedLeg only, lump sum paid at maturity of zero coupon swap
- payNotional*: notional
- payPaymentPeriod*: 1M, 3M, 6M, 12M, 1Y, 1T (for zero-coupon); inflation swaps always use 1T no matter what period is given
- payPeriodStartVNS: fill only for VNS
- payCompounding: fill only for compounding swap, Flat or Straight
- payCompoundingIndexPeriod: period for compounding swap, 1M, 3M, 6M, 12M, 1Y
- payStub: fill only if the leg has a stub, LongFinal, LongInitial, ShortInitial, ShortFinal
- payFirstRate: first pre-defined rate
- payFirstInterpolationTenor: stub interpolation tenor for floatingLeg, 1W, 1M, 3M, 6M, ...
- paySecondInterpolationTenor: stub interpolation tenor for floatingLeg, 1W, 1M, 3M, 6M, ...
- payDayCountMethod*: 30/360, 30E/360, 30E/360.ISDA, ACT/360, ACT/365.FIXED, ACT/ACT.ISDA, ACT/365.ISDA, ACT/ACT.ICMA, ACT/ACT.ISMA, 1/1, ...
- payBusinessDayConvention: MODFOLLOWING, FOLLOWING, PRECEDING, ...
- payPaymentCalendar: EUTA, CHZU, GBLO, USNY, DEFR, ITMI, FRPA, ESMA, BEBR, JPTO, DKCO, NOOS, SEST, PLWA, ... calendars can be combined with "+"; unknown calendar is ignored
- payAdjustment: ADJUSTED, UNADJUSTED, MAT_UNADJUSTED, ...
- payRollMethod: Standard, IMM, EOM, ...
### Receive leg attributes
The receive leg has the same attributes as pay leg above, except prefix "pay" is replaced by "rcv".
## OTC sensitivities in CSV format
The whole portfolio is described by a table of DV01 sensitivities, submitted in CSV format known from Margin Calculator. The columns are curves and rows maturities - see the example in request model.
## OTC reports CB202, CB207
See Eurex OTC member documentation for CB202 and CB207 reports.
Only positions from one specified account or risk netting unit (ARNU) will be evaluated, see the attributes of `otc_cb202` structure below.
We recommend using gzip compression in the request, see above.
## OTC FpML
See the public definition for FpML format. It is submitted as `otc_fpml`.
The `party` attribute is mandatory, see below.
We recommend using gzip compression in the request, see above.
parameters:
- $ref: '#/parameters/x_dbp_apikey'
- name: body
in: body
schema:
type: object
example:
etd_portfolio:
- line_no: 1
product_id: FEXD
contract_date: 20301220
net_ls_balance: 10
- line_no: 2
product_id: OESD
contract_date: 20311222
call_put_flag: C
exercise_price: 90
net_ls_balance: -10
properties:
snapshot:
$ref: '#/definitions/snapshot'
clearing_currency:
$ref: '#/definitions/clearing_currency'
is_cross_margined:
type: boolean
description: enable cross-margining between OTC and Fixed Income
example: True
etd_portfolio:
$ref: '#/definitions/etd_portfolio'
etd_csv:
type: object
properties:
csv:
type: string
description: ETD portfolio as one string in CSV, in Margin Calculator GUI format or Margin Estimator GUI format
example: Product ID,Contract Date,Version Number,Call Put Flag,Exercise Price,Net LS Balance\nFEXD,20311219,0,,,100\nOESX,20311219,0,C,5000,-100
required:
- csv
etd_cp005:
type: object
properties:
member:
type: string
description: optional attribute to process only positions of the member, if not given the clearing member is used
account:
type: string
description: optional attribute to process only positions on that account, if not given "PP" account is used
xml:
type: string
description: exchange traded portfolio as Eurex report CP005
required:
- xml
otc_csv:
$ref: '#/definitions/otc_csv'
otc_sensitivities:
$ref: '#/definitions/otc_sensitivities'
otc_cb202:
$ref: '#/definitions/otc_cb202'
otc_fpml:
$ref: '#/definitions/otc_fpml'
responses:
'200':
description: OK
headers: {}
examples:
application/json:
business_date: 20180809
live: false
live_timestamp: 0
clearing_currency: EUR
errors:
- line_no: 2
error_msg: 'Line 1 instrument iid not recognized: 736947'
portfolio_margin:
- liquidation_group: PEQ01
liquidation_group_split: PFI01_HP2_T0-99999
initial_margin: 3161.708587
market_risk: 3155.266149
liquidity_addon: 6.442439
long_option_credit: 0
time_to_expiry_adjustment: 0
premium_margin: 0
market_risk_per_rms:
- rms_name: FILTERED_HISTORICAL_VAR_2
simulation_type: Historical
rms_market_risk: 4991.692879
weighting_factor: 0.51
rms_components:
- subsample_id: 1
risk_measure_value: 4481.692879
correlation_break_adjustment: 500.0
compression_adjustment: 10.0
drilldowns:
- line_no: 1
product_id: OEXD
call_put_flag: C
exercise_price: 90
version_number: '0'
iid: 18249016
contract_date: 20311222
maturity: 203112
net_ls_balance: 10
liquidation_group: PFI01
liquidation_group_split: PFI01_HP2_T0-99999
component_margin: 2382.083819
component_margin_currency: EUR
premium_margin: 0
premium_margin_currency: EUR
schema:
type: object
properties:
business_date:
$ref: '#/definitions/business_date'
live:
$ref: '#/definitions/live'
live_timestamp:
$ref: '#/definitions/live_timestamp'
clearing_currency:
$ref: '#/definitions/clearing_currency'
errors:
$ref: '#/definitions/errors'
portfolio_margin:
$ref: '#/definitions/portfolio_margin'
drilldowns:
type: array
description: Margin figures on position level. Full business key is used, it is not possible to map to input line_no one to one because positions may be aggregated or split
items:
type: object
properties:
line_no:
$ref: '#/definitions/line_no'
product_id:
$ref: '#/definitions/product_id'
contract_date:
$ref: '#/definitions/contract_date'
maturity:
$ref: '#/definitions/maturity'
call_put_flag:
$ref: '#/definitions/call_put_flag'
exercise_price:
$ref: '#/definitions/exercise_price'
version_number:
$ref: '#/definitions/version_number'
iid:
$ref: '#/definitions/iid'
instrument_type:
$ref: '#/definitions/instrument_type'
exercise_style:
$ref: '#/definitions/exercise_style'
net_ls_balance:
$ref: '#/definitions/net_ls_balance'
liquidation_group:
$ref: '#/definitions/liquidation_group'
liquidation_group_split:
$ref: '#/definitions/liquidation_group_split'
component_margin:
$ref: '#/definitions/component_margin'
component_margin_currency:
$ref: '#/definitions/component_margin_currency'
premium_margin:
type: number
description: Premium margin for the position
premium_margin_currency:
type: string
description: Currency of premium margin - currency of the product, can be different from clearing currency
otc_drilldowns:
type: array
description: Margin figures and short trade desription on OTC trade level. Internal Trade Id is used as a key.
items:
type: object
properties:
trade_id:
$ref: '#/definitions/trade_id'
liquidation_group:
$ref: '#/definitions/liquidation_group'
liquidation_group_split:
$ref: '#/definitions/liquidation_group_split'
npv:
type: number
description: Net Present Value of the trade in notional currency
dv01:
type: number
description: DV01 (interest rate) sensitivity of the trade in notional currency
ie01:
type: number
description: IE01 (inflation rate) sensitivity of the trade in notional currency - optional
component_margin:
$ref: '#/definitions/component_margin'
component_margin_currency:
$ref: '#/definitions/component_margin_currency'
type:
$ref: '#/definitions/otc_type'
pay:
$ref: '#/definitions/pay'
receive:
$ref: '#/definitions/receive'
notional:
$ref: '#/definitions/notional'
notional_currency:
$ref: '#/definitions/notional_currency'
maturity:
$ref: '#/definitions/otc_maturity'
/greeks:
post:
summary: Greek Calculation Request
description: >-
Calculate analytical greeks (sensitivities) for given exchange traded instruments.
The instruments are specified by a technical `iid` that can be obtained by `series` query.
Two types of greeks are offered:
- numerical derivative of change in instrument price in product currency w.r.t. change in given variable, e.g. DELTA is w.r.t. change in underlying price
- the above greek converted to EUR:
- EURO_DELTA, EURO_GAMMA: (_underlying price_ + _price offset_) \* _greek_ \* _fx conversion to EUR_
- EURO_RHO, EURO_THETA, EURO_VEGA: _greek_ \* _fx conversion to EUR_
Optionally, vector of relative underlying shifts can be supplied to calculate stress greeks (except DV01, there shifts are ignored) in scenarios where underlying price moved.
Note that the method of calculation is slightly different, therefore the result for request without shift may differ from result with zero shift.
To get a position greek, the instrument greek has to be multiplied by position size and trade unit value (TUV).
parameters:
- $ref: '#/parameters/x_dbp_apikey'
- name: body
in: body
schema:
type: object
example:
greek_types:
- EURO_DELTA
- EURO_VEGA
underlying_shifts_rel:
- -0.01
- 0.01
iids:
- 26807581
- 27471356
properties:
snapshot:
$ref: '#/definitions/snapshot'
greek_types:
$ref: '#/definitions/greek_types'
underlying_shifts_rel:
$ref: '#/definitions/underlying_shifts_rel'
iids:
$ref: '#/definitions/iids'
required:
- greek_types
- iids
responses:
'200':
description: OK
headers: {}
examples:
application/json:
business_date: 20180809
live: false
live_timestamp: 0
greek_types:
- EURO_DELTA
underlying_shifts_rel:
- -0.01
- 0.01
greeks:
- iid: 26807581
values: [[674.0,565.0]]
- iid: 27471356
values: [[0.65957,0.68090]]
schema:
type: object
properties:
business_date:
$ref: '#/definitions/business_date'
live:
$ref: '#/definitions/live'
live_timestamp:
$ref: '#/definitions/live_timestamp'
greek_types:
$ref: '#/definitions/greek_types'
underlying_shifts_rel:
$ref: '#/definitions/underlying_shifts_rel'
greeks:
type: array
items:
type: object
description: Array of arrays of greeks for given instrument per greek type and per underlying shift rel, in the order given by type and shift vectors
properties:
iid:
$ref: '#/definitions/iid'
values:
type: array
items:
type: array
items:
type: number
/stressmatrix:
post:
summary: Stress Matrix Request
description: >-
Calculate theoretical prices of given exchange traded instruments in stressed scenarios.
The scenario can have shifted underlying price and/or volatility.
In one request, vector of underlying price shifts and volatility shifts is specified
and the result then contains stress matrix with prices for each combination
of the underlying price and volatility shift.
The volatility shift can be either relative or absolute. For example, when current volatility is 20%:
- relative shift 0.1 means the stressed volatility is 20% \* (1+0.1) = 22%
- absolute shift 0.1 means stressed volatility is 20% + 0.1% = 20.1%
For futures, volatility shift has no effect and the underlying price shift changes
directly the future price, theoretical pricing model is not used.
parameters:
- $ref: '#/parameters/x_dbp_apikey'
- name: body
in: body
schema:
type: object
example:
underlying_shifts_rel:
- 0.01
volatility_shifts:
- -0.10
- 0.10
volatility_shift_type: ABSOLUTE
iids:
- 26807581
- 27471356
properties:
snapshot:
$ref: '#/definitions/snapshot'
underlying_shifts_rel:
$ref: '#/definitions/underlying_shifts_rel'
volatility_shifts:
$ref: '#/definitions/volatility_shifts'
volatility_shift_type:
$ref: '#/definitions/volatility_shift_type'
iids:
$ref: '#/definitions/iids'
required:
- iids
responses:
'200':
description: OK
headers: {}
examples:
application/json:
business_date: 20180809
live: false
live_timestamp: 0
underlying_shifts_rel:
- 0.01
volatility_shifts:
- -0.1
- 0.1
volatility_shift_type: RELATIVE
stress_matrix:
- iid: 26807581
values: [[0.65957],[0.68090]]
- iid: 27471356
values: [[0.65957],[0.68090]]
schema:
type: object
properties:
business_date:
$ref: '#/definitions/business_date'
live:
$ref: '#/definitions/live'
live_timestamp:
$ref: '#/definitions/live_timestamp'
underlying_shifts_rel:
$ref: '#/definitions/underlying_shifts_rel'
volatility_shifts:
$ref: '#/definitions/volatility_shifts'
volatility_shift_type:
$ref: '#/definitions/volatility_shift_type'
stress_matrix:
type: array
items:
type: object
description: Array of arrays of prices for given instrument per underlying price shift and volatility shift, in the order given by price and vola shift vectors
properties:
iid:
$ref: '#/definitions/iid'
values:
type: array
items:
type: array
items:
type: number
parameters:
x_dbp_apikey:
name: X-DBP-APIKEY
in: header
description: your key, obtain it by registering at [DBG Digital Business Platform](https://console.developer.deutsche-boerse.com/)
type: string
required: true
extrafields:
name: extrafields
in: query
description: comma-separated list of optional fields that should be returned in addition to the default set of response fields. Alternatively can be specified also as multiple parameter instances instead of comma-separated list.
required: false
collectionFormat: csv
type: array
items:
type: string
business_date:
name: business_date
in: query
type: number
description: Business date as of which the result is calculated, in YYYYMMDD format
live: