constituent bonds of a certain CDS

How to retrieve the constituent bonds of a certain CDS through python API?

Best Answer

  • aramyan.h
    Answer ✓

    Hi @oriana.xfu ,


    Please check the following workflow to get ref obligations for the singe name CDS

    1. get constituent bond ISINs:

    df, err = ek.get_data('AAPL5YUSAX=R', fields = ["TR.BondISIN"])
    df

    screenshot-2024-05-03-at-125850.png


    2. Request CDS related fields and filter the results to show the bonds with Metrkit ref Obligation name:

    ref_obligations, err = ek.get_data(df['Bond ISIN'].to_list(), fields = ["TR.CDSRED9", "TR.FiCurrency", "TR.CPTYPE", "TR.ADF_COUPON", "TR.FIMaturityDate", "TR.FiIsConvertible", "TR.CDSMarkitOBName", "TR.CDSMarkitSeniority"])
    ref_obligations[ref_obligations['Markit Ref Oblig. Name'] != 'NA']


    screenshot-2024-05-03-at-130910.pngBest regards,

    Haykaz

Answers

  • Hi @oriana.xfu ,


    If I got your question right and ITAIG5Y40= is a type of CDS RIC you might be after, then you can perhaps use the following code:

    df, err = ek.get_data('ITAIG5Y40=', fields = [ "TR.CDSConstWeight", "TR.CDSConstFITIID", "TR.CDSConstOrgName", "TR.CDSConstCUSIP", "TR.CDSConstRED6"])
    df

    screenshot-2024-04-09-at-110313.png

    Hope this helps.


    Best regards,

    Haykaz

  • Thank you for your help @aramyan.h. I note that your example (ITAIG5Y40=) refers to an index CDS. What I'm trying to retrieve are the reference obligations of specific single-name CDS instruments (e.g., AAPL5YUSAX=R), while Eikon returns nothing on the above-mentioned code. Is there any way to achieve this?

  • Hi @aramyan.h, the code works well, thanks for your help.