Instrument Pricing Analytics - Pricing THB IRS gives only errors

I used to be able to price an IRS like this:
def get_thb_legs(fixed_rate_pct:float=None, floating_spread_bps:float=None, receive_fixed:bool=True, notional_amount:float=100): fixed_dir, float_dir = ('Received', 'Paid') if receive_fixed else ('Paid', 'Received')
fixed_leg = { 'legTag':'Fixed', 'direction':fixed_dir, 'interestType':'Fixed', 'notionalCcy':'THB', 'notionalAmount':notional_amount, 'interestPaymentFrequency':'SemiAnnual', 'interestCalculationMethod':'Dcb_Actual_365', } if fixed_rate_pct is not None: fixed_leg['fixedRatePercent'] = fixed_rate_pct float_leg = { 'legTag':'Floating', 'direction':float_dir, 'interestType':'Float', 'interestPaymentFrequency':'SemiAnnual', 'interestCalculationMethod':'Dcb_Actual_365', 'notionalCcy':'THB', 'notionalAmount':notional_amount, 'indexName':'THBFIX', 'indexTenor':'6M' } if floating_spread_bps is not None: float_leg['spreadBp'] = floating_spread_bps return [fixed_leg, float_leg]
return { 'fields': flds, 'universe': [{ 'instrumentType': 'Swap', 'instrumentDefinition': { 'instrumentTag': instr_tag, 'startDate': start_date.strftime('%Y-%m-%d'), 'tenor': tenor, 'legs': legs, #'settlementCcy': settlement_currency , could not get this to work. } }], 'pricingParameters': { 'valuationDate': valuation_date.strftime('%Y-%m-%d'), 'discounting_ccy': deal_currency, 'discounting_tenor': 'OIS' }, 'outputs': ['Data', 'Headers'], }
But now I just get errors:
'Invalid market data input for interest rate curve. No curve points could be determined to build discount rate model.'
How can we price THB IRS ?
Best Answer
-
The solution is to use:
'pricingParameters': {'valuationDate': valuation_date.strftime('%Y-%m-%d'),
'useCurveBuilder': True, # THB fails if not using the curve build
'discounting_ccy': deal_currency, # could not get settlement currency to work.
'discounting_tenor': 'OIS'
},
in the call.0
Answers
-
Hi @mikael.ohman ,
I had simillar issues in the past, and wrote this article as a result:
Troubleshooting IPA & RD Python Library: https://developers.lseg.com/en/article-catalog/article/troubleshooting-ipa-and-the-data-library-api-in-python
The way I found the culprit in my body was through trial and error. I would suggest the same here. I wrote about just this at the end of the article:I recently came uppon a second error returned from IPA, ''ErrorMessage" `Unable to calculate the Implied Volatility` and "ErrorCode" `QPS-Pricer.4011`.
I went through the technique above, and found the folowing test call totry out on the API Playground:
{
"universe": [
{
"instrumentType": "Option",
"instrumentDefinition": {
"buySell": "Buy",
"callPut": "Call",
"underlyingType": "Eti",
"instrumentCode": "STXE45500N4.EX",
"strike": 4550
},
"pricingParameters": {
"pricingModelType": "BlackScholes",
"underlyingTimeStamp": "Default",
"volatilityType": "Implied",
"marketValueInDealCcy": 4534.61,
"reportCcy": "EUR",
"riskFreeRatePercent": 3.938,
"underlyingPrice": 4534.61,
"valuationDate": "2023-12-18T11:10:00Z"
}
}
],
"fields": [
"ErrorMessage",
"ErrorCode",
"MarketValueInDealCcy",
"RiskFreeRatePercent",
"UnderlyingPrice",
"Volatility",
"DeltaPercent",
"GammaPercent",
"RhoPercent",
"ThetaPercent",
"VegaPercent"
]
}
What I then did, on the Playground, was remove one (and only one) argument. I found out, through this trial and error proccess that the the culprit was "marketValueInDealCcy".
Removing this argument showed that this option was trading at a much lower rate, making Greeks imposible to calculate.
Please do let me know if you did not find the culprit argument in the body after going through the above.
0 -
Thank you for your participation in the forum.
Is the reply above satisfactory in answering your question?
If yes please click 'Yes' next to the text ‘Did this answer the question?’, and then close the question. This will guide all community members who have a similar question.
Otherwise please post again offering further insight into your question.
Thanks,
AHS
0 -
Thank you for your reply. Leaving the answer after finding it yourself is very appreciated; it helps anyone else using this API to find the answer quickly on this Forum in the future.
Thank you!
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 249 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛