constituent bonds of a certain CDS

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

Best Answer

  • aramyan.h
    aramyan.h admin
    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