Retrieve EUR IRS in Python

Hi Dev team,


I am trying to retrieve EURAB3EIRS= using codebook. Using syntax below, I am only getting n/a as output


df, err = ek.get_data('EURAB3EIRS=',['GV4_TEXT','MATUR_DATE','PRIMACT_1','SEC_ACT_1'])


display(df)


eurirs.png


Note that this syntax works for 0#EURABSEZ=R

Best Answer

  • pf
    pf
    Answer ✓

    Hi @lian.fernandez ,

    Always with refinitv.data lib but another way using chain API and rd.get_data function :

    import refinitiv.data as rd

    session = rd.session.desktop.Definition(app_key=APP_KEY).get_session()
    session.open()
    rd.session.set_default(session)

    EURAB3EIRS_chain = rd.content.pricing.chain.Definition(name='EURAB3EIRS=').get_stream()
    EURAB3EIRS_chain.open(False)
    print('EURAB3EIRS= constituents :', EURAB3EIRS_chain.constituents)

    euro = rd.get_data(universe=EURAB3EIRS_chain.constituents, fields=['GV4_TEXT', 'MATUR_DATE', 'PRIMACT_1', 'SEC_ACT_1'])
    print(euro)

    outputs:

    EURAB3EIRS= constituents : ['EURAB3E6M=', 'EURAB3E9M=', 'EURAB3E1Y=', 'EURAB3E18M=', 'EURAB3E2Y=', 'EURAB3E3Y=', 'EURAB3E4Y=', 'EURAB3E5Y=', 'EURAB3E6Y=', 'EURAB3E7Y=', 'EURAB3E8Y=', 'EURAB3E9Y=', 'EURAB3E10Y=', 'EURAB3E11Y=', 'EURAB3E12Y=', 'EURAB3E13Y=', 'EURAB3E14Y=', 'EURAB3E15Y=', 'EURAB3E16Y=', 'EURAB3E17Y=', 'EURAB3E18Y=', 'EURAB3E19Y=', 'EURAB3E20Y=', 'EURAB3E25Y=', 'EURAB3E30Y=', 'EURAB3E40Y=', 'EURAB3E50Y=']

    Instrument GV4_TEXT MATUR_DATE PRIMACT_1 SEC_ACT_1
    0 EURAB3E6M= 6M 2023-06-28 2.673 2.703
    1 EURAB3E9M= 9M 2023-09-28 3.019 3.049
    2 EURAB3E1Y= 1Y 2023-12-28 3.188 3.238
    3 EURAB3E18M= 18M 2024-06-28 3.324 3.334
    4 EURAB3E2Y= 2Y 2024-12-30 3.318 3.324
    5 EURAB3E3Y= 3Y 2025-12-29 3.192 3.232
    6 EURAB3E4Y= 4Y 2026-12-28 3.079 3.12
    7 EURAB3E5Y= 5Y 2027-12-28 3.04 3.081
    8 EURAB3E6Y= 6Y 2028-12-28 3.014 3.055
    9 EURAB3E7Y= 7Y 2029-12-28 2.997 3.038
    10 EURAB3E8Y= 8Y 2030-12-30 2.993 3.034
    11 EURAB3E9Y= 9Y 2031-12-29 3.0 3.041
    12 EURAB3E10Y= 10Y 2032-12-28 3.014 3.055
    13 EURAB3E11Y= 11Y 2033-12-28 3.027 3.068
    14 EURAB3E12Y= 12Y 2034-12-28 3.033 3.074
    15 EURAB3E13Y= 13Y 2035-12-28 3.062 3.072
    16 EURAB3E14Y= 14Y 2036-12-29 3.044 3.054
    17 EURAB3E15Y= 15Y 2037-12-28 3.007 3.048
    18 EURAB3E16Y= 16Y 2038-12-28 2.87 2.88
    19 EURAB3E17Y= 17Y 2039-12-28 2.987 2.997
    20 EURAB3E18Y= 18Y 2040-12-28 2.499 2.509
    21 EURAB3E19Y= 19Y 2041-12-30 2.901 2.941
    22 EURAB3E20Y= 20Y 2042-12-29 2.833 2.874
    23 EURAB3E25Y= 25Y 2047-12-30 2.633 2.674
    24 EURAB3E30Y= 30Y 2052-12-30 2.464 2.505
    25 EURAB3E40Y= 40Y 2062-12-28 2.276 2.31
    26 EURAB3E50Y= 50Y 2072-12-28 2.04 2.081

Answers

  • Hi @lian.fernandez ,


    My understanding is that 'EURAB3EIRS=' is a swap and '0#EURABSEZ=R' is a chain of RICs made by Refinitiv showing instruments that (when put together) showcases insights that cannot be seen on an individual RIC basis (e.g.: Yield Curve). These are two different types of instruments, so their fields will also be different. Please use the DIB to find the fields relevent to any one instrument.

    Looking at EURAB3EIRS=, I can see that it constitutes of several other RICs:

    1672053496713.png

    I looked into the fields you were after for these constituents:


    df1 = rd.get_data('EURAB3EIRS=',[f'LONGLINK{i}' for i in range(4, 8)])

    df2 = rd.get_data(

    df1.loc[0].to_list(),

    ['GV4_TEXT','MATUR_DATE','PRIMACT_1','SEC_ACT_1'])


    1672053813182.png


    Does this result in the data you were after?