question

Upvotes
Accepted
5 0 1 2

Finding the ultimate parent of a participant bank from deal screener (loans), when no identifier is possible?

Hi there, I am using a combination of the Eikon API and the RDP API, in Python on a Mac (Ventura). I am searching for all deals relating to the following ISINS (['BRJBSSACNOR8', 'BRMRFGACNOR0', 'BRBEEFACNOR6']) and would like to eventually map these to the ultimate parent of each bank that participated in each deal. From the Data Library, it seems not possible to return a PermID, RIC, or ISIN for the managers on a deal. Therefore, I need to search them by name to find either a) their ultimate parents directly or b) their ISIN, RIC, or PermID, which I can then search for their ultimate parents. Are you able to help me do this with either RDP or Eikon API? Thanks in advance for any help.

import pandas as pd
import eikon as ek
import refinitiv.data as rd

isins = ['BRJBSSACNOR8', 'BRMRFGACNOR0', 'BRBEEFACNOR6']

# convert ISINs to PermIDs to search deal screener
permids = ek.get_symbology(isins, from_symbol_type='ISIN', to_symbol_type='OAPermID
permids = ','.join(permids['OAPermID'])

# pulling loans data

fields = ["TR.LNSdcDealNum,TR.LNSDCTrancheId,TR.LNAnnouncementDate,TR.LNTrancheClosingDatePrint,TR.LNMaturityDate,TR.LNFinalMaturityDate,TR.LNIssuerUltParent,TR.LNIssuerUltParentPERMID,TR.LNIssuerUltParentNation,TR.LNIssuerUltParentSubRegion,TR.LNIssuer,TR.LNIssuerSDCCusip,TR.LNIssuerPERMID,TR.LNIssuerNation,TR.LNIssuerSubRegion,TR.LNTotalFacilityAmount(Scale=6),TR.LNTrancheAmount(Scale=6,Curn=USD),TR.LNOriginalTrancheCurrency,TR.LNTargetMarketNation,TR.LNUseOfProceeds(Concat='|'),TR.LNTrancheType,TR.LNYieldType,TR.LNStatusOfLoan,TR.LNBookRunnerParentCount,TR.LNLeadCoLeadIntCoManagerCount,TR.LNIsBookRunner(Concat='|'),TR.LNManagerRole(Concat='|'),TR.LNLeadCoLeadIntCoManagerLong(Concat='|'),TR.LNLeadCoLeadIntCoManagerParentLong(Concat='|'),TR.LNPrincipalAmountPerBookRunnerThisMarket(Scale=6),TR.LNCommitmentAmount(Scale=6,Curn=USD,Concat='|')"]


df_loans,e = ek.get_data("SCREEN(U(IN(DEALS)/*UNV:DEALSLOAN*/),IN(TR.LNParticipant(LNPartRole=LNBUP)," + permids + "))", fields, {"Curn":"USD"})

# find unique parents
unique_names = df_loans['Book, Co-Manager, Participant Parent (Full Name)'].str.split('|').explode().unique()
df_unique_names = pd.DataFrame(unique_names, columns=['Unique Names'])

## next step - find ultimate parents of each of these unique parents??
refinitiv-dataplatform-eikon#content
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@l.marsden

Hi,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question?

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS

Upvotes
Accepted
5.8k 21 2 6

Hi @l.marsden,

I believe the best way forward here would be (i) using the RD Lib. because the EDAPI one will be deprecated soon, and (ii) using Search. I give an example as to how you may look into using it below. Please do let me know if it gives you enough of the building blocks needed for you to use in your solution:

import pandas as pd
import refinitiv.data as rd
session = rd.open_session(
    config_name="C:\\Example.DataLibrary.Python-main\\Configuration\\refinitiv-data.config.json",
    name="platform.jllsegrdp")
    # name="desktop.workspace")

isins = ['BRJBSSACNOR8', 'BRMRFGACNOR0', 'BRBEEFACNOR6']

ric_df = rd.content.symbol_conversion.Definition(
    symbols=isins,
    from_symbol_type=rd.content.symbol_conversion.SymbolTypes.ISIN,
    to_symbol_types=[
        rd.content.symbol_conversion.SymbolTypes.RIC,
        rd.content.symbol_conversion.SymbolTypes.OA_PERM_ID
    ]).get_data().data.df
permids = ','.join(list(ric_df.IssuerOAPermID))

# pulling loans data
flds = ["RIC", "TR.LNSdcDealNum", "TR.LNSDCTrancheId", "TR.LNAnnouncementDate", "TR.LNTrancheClosingDatePrint",
          "TR.LNMaturityDate", "TR.LNFinalMaturityDate", "TR.LNIssuerUltParent",
          "TR.LNIssuerUltParentPERMID", "TR.LNIssuerUltParentNation", "TR.LNIssuerUltParentSubRegion",
          "TR.LNIssuer", "TR.LNIssuerSDCCusip", "TR.LNIssuerPERMID", "TR.LNIssuerNation",
          "TR.LNIssuerSubRegion", "TR.LNTotalFacilityAmount(Scale=6)",
          "TR.LNTrancheAmount(Scale=6,Curn=USD)", "TR.LNOriginalTrancheCurrency",
          "TR.LNTargetMarketNation", "TR.LNUseOfProceeds(Concat='|')", "TR.LNTrancheType",
          "TR.LNYieldType", "TR.LNStatusOfLoan", "TR.LNBookRunnerParentCount", "TR.LNLeadCoLeadIntCoManagerCount",
          "TR.LNIsBookRunner(Concat='|')", "TR.LNManagerRole(Concat='|')",
          "TR.LNLeadCoLeadIntCoManagerLong(Concat='|')", "TR.LNLeadCoLeadIntCoManagerParentLong(Concat='|')",
          "TR.LNPrincipalAmountPerBookRunnerThisMarket(Scale=6)", "TR.LNCommitmentAmount(Scale=6,Curn=USD,Concat='|')"]

df_loans = rd.get_data(
    universe=["SCREEN(U(IN(DEALS)/*UNV:DEALSLOAN*/)," +
              "IN(TR.LNParticipant(LNPartRole=LNBUP)," + permids + "))"],
    fields=flds,
    parameters={"Curn":"USD"})

# find unique parents
unique_names = df_loans['Book, Co-Manager, Participant Parent (Full Name)'].str.split('|').explode().unique()
df_unique_names = pd.DataFrame(unique_names, columns=['Unique Names'])

## next step - find ultimate parents of each of these unique parents??
single_undrlyng_srch = rd.discovery.search(
    view = rd.discovery.Views.SEARCH_ALL,
    query=df_unique_names.values[61][0],  # "Banco Bilbao Vizcaya Argentaria SA",  # "Mizuho Financial Group",
    top = 2,
    # filter = ,
    select = "RIC, CommonName, UltimateParentCompanyOAPermID, UltimatelyCompanyPrimaryRIC, " +
            #   "AcquirerImmediateParentCidgen, AcquirerImmediateParentName, " +
            #   "AcquirerImmediateParentOAPermID, AcquirerUltimateParentCidgen, " +
            #   "AcquirerUltimateParentName, AcquirerUltimateParentOAPermID, " +
            #   "CdsUltimateParentCount, DBSParentTicker, GuarantorImmediateParentOrgId, " +
            #   "GuarantorUltimateParentOrgId, InvestorParentType, " +
            #   "IssuersUltimateParentHasCDS, IssuersUltimateParentIssuerID, " +
            #   "IssuersUltimateParentREC, LegacyUltimateParentId, MnaParentAcquirerCount, " +
            #   "MnaParentTargetCount, ParentAccountID, ParentCompanyGEMPermID, " +
            #   "ParentCompanyNDAPI, ParentCompanyOAPermID, ParentCompanyPI, " +
            #   "ParentImmedIndustrySector, ParentImmedIssuerID, ParentImmedIssuerName, " +
            #   "ParentImmedIssuerOrganization, ParentImmedLongName, ParentImmedOAPermID, " +
            #   "ParentImmedOrgID, ParentImmedSPIndustry, ParentImmedSPIndustryDescription, " +
            #   "ParentImmedTicker, ParentIndustrySector, ParentIssuerID, ParentIssuerName, " +
            #   "ParentIssuerOrganization, ParentLongName, ParentOAPermID, " +
            #   "ParentOrganisationName, ParentOrganisationNameJaHani, ParentOrganisationOrgid, " +
            #   "ParentOrgID, ParentPortId, ParentPortRIC, ParentSPIndustry, " +
            #   "ParentSPIndustryDescription, ParentTicker, ParentType, ParentURL, " +
            #   "PrimaryCompanyUltimateParentOrgid, PrimaryParentPageRIC, RCSParentDomicile, " +
            #   "RCSParentDomicileGenealogy, RCSParentDomicileLeaf, RCSParentDomicileLeafML, " +
            #   "RCSParentDomicileName, RCSParentDomicileNameML, RefEntityImmediateParentCommonName, " +
            #   "RefEntityImmediateParentCommonNameJaHani, RefEntityImmediateParentCommonNameJaHira, " +
            #   "RefEntityImmediateParentCommonNameJaKana, RefEntityImmediateParentCommonNameZhHans, " +
            #   "RefEntityImmediateParentCommonNameZhHant, RefEntityImmediateParentCountry, " +
            #   "RefEntityImmediateParentCountryName, RefEntityImmediateParentFitchIssuerRating, " +
            #   "RefEntityImmediateParentFitchIssuerRatingRank, RefEntityImmediateParentGics, " +
            #   "RefEntityImmediateParentGicsName, RefEntityImmediateParentIssueValuationRic, " +
            #   "RefEntityImmediateParentLegalName, RefEntityImmediateParentLegalNameJaHani, " +
            #   "RefEntityImmediateParentLegalNameJaHira, RefEntityImmediateParentLegalNameJaKana, " +
            #   "RefEntityImmediateParentLegalNameZhHans, RefEntityImmediateParentLegalNameZhHant, " +
            #   "RefEntityImmediateParentMarkItShortName, RefEntityImmediateParentMoodysIssuerRating, " +
            #   "RefEntityImmediateParentMoodysIssuerRatingRank, RefEntityImmediateParentOrgId, " +
            #   "RefEntityImmediateParentPi, RefEntityImmediateParentRbss, RefEntityImmediateParentRbssName, " +
            #   "RefEntityImmediateParentRed6Code, RefEntityImmediateParentShortName, " +
            #   "RefEntityImmediateParentSPIndustry, RefEntityImmediateParentSPIndustryDescription, " +
            #   "RefEntityImmediateParentSPIssuerRating, RefEntityImmediateParentSPIssuerRatingRank, " +
            #   "RefEntityImmediateParentTicker, RefEntityUltimateParentCommonName, " +
            #   "RefEntityUltimateParentCommonNameJaHani, RefEntityUltimateParentCommonNameJaHira, " +
            #   "RefEntityUltimateParentCommonNameJaKana, RefEntityUltimateParentCommonNameZhHans, " +
            #   "RefEntityUltimateParentCommonNameZhHant, RefEntityUltimateParentCountry, " +
            #   "RefEntityUltimateParentCountryName, RefEntityUltimateParentFitchIssuerRating, " +
            #   "RefEntityUltimateParentFitchIssuerRatingRank, RefEntityUltimateParentGics, " +
            #   "RefEntityUltimateParentGicsName, RefEntityUltimateParentIssueValuationRic, " +
            #   "RefEntityUltimateParentLegalName, RefEntityUltimateParentLegalNameJaHani, " +
            #   "RefEntityUltimateParentLegalNameJaHira, RefEntityUltimateParentLegalNameJaKana, " +
            #   "RefEntityUltimateParentLegalNameZhHans, RefEntityUltimateParentLegalNameZhHant, " +
            #   "RefEntityUltimateParentMarkItShortName, RefEntityUltimateParentMoodysIssuerRating, " +
            #   "RefEntityUltimateParentMoodysIssuerRatingRank, RefEntityUltimateParentOrgId, " +
            #   "RefEntityUltimateParentPi, RefEntityUltimateParentRbss, RefEntityUltimateParentRbssName, " +
            #   "RefEntityUltimateParentRed6Code, RefEntityUltimateParentShortName, " +
            #   "RefEntityUltimateParentSPIndustry, RefEntityUltimateParentSPIndustryDescription, " +
            #   "RefEntityUltimateParentSPIssuerRating, RefEntityUltimateParentSPIssuerRatingRank, " +
            #   "RefEntityUltimateParentTicker, SourceParentAccountID, TargetImmediateParentCidgen, " +
            #   "TargetImmediateParentName, TargetImmediateParentOAPermID, TargetUltimateParentCidgen, " +
            #   "TargetUltimateParentName, TargetUltimateParentOAPermID, UltimateParentCompanyGEMPermID, " +
            #   "UltimateParentCompanyNDAPI, UltimateParentCompanyOAPermID, UltimateParentCompanyPI, " +
            #   "UltimateParentId, UltimateParentIssuerEquityPrimaryRIC, UltimateParentOrganisationName, " +
            #   "UltimateParentOrganisationNameJaHani, " +
              "UltimateParentOrganisationOrgid, UltimateParentOrganizationID",
    # order_by = "AvgVol5D desc"
    )

rd.discovery.search(
    view = rd.discovery.Views.SEARCH_ALL,
    query=single_undrlyng_srch.UltimateParentCompanyOAPermID[0],  # "4295889577"
    top = 30,
    # filter = ,
    select = "PrimaryRIC" # DelayedQuoteRIC, DTCCVolumeRIC, ExpiredRIC, GEMAlphaNumericID, " +
            #   "IssuerEquityPrimaryRIC, LiquidityRIC, OldRIC, OriginalRIC, " +
            #   "PercentageIndexRIC, PrimaryIssueRIC, PrimaryRIC, " +
            #   "PrimaryRICCinCUSIP, PrimaryRICCUSIP, PrimaryRICExchangeCode, " +
            #   "PrimaryRICExchangeName, PrimaryRICISIN, PrimaryRICPI, " +
            #   "PrimaryRICRCSAssetCategory, PrimaryRICRCSAssetCategoryLeaf, " +
            #   "PrimaryRICRICAcctsCount, PrimaryRICRICUsageCount, PrimaryRICSEDOL, " +
            #   "PrimaryRICTickerSymbol, QuoteRICs, RIC, SpotCurrencyRIC, SpotRIC, " +
            #   "SucceededCompanyPrimaryRIC, UltimateParentIssuerEquityPrimaryRIC, " +
            #   "YearHighToday2RIC, YearLowToday2RIC",
    )


1705326640189.png


You may often end up with the same 'underlying' and 'parent' because the company in `df_unique_names` may already be the Ultimate Parent and have no parent company. With that said, I am not a content expert and can hardly tell if a company is parent or not, so don't hesitate to let us know if the above gives you enough to go forward with.



1705326640189.png (2.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
5 0 1 2

Hi @jonathan.legrand, thank you very much for this, I didn't realise EDAPI was being depreceated. This search seems to do what it is intended to, I tested with a different company that is not its ultimate parent (BMO Capital Markets, index [4], since BBVA example is actually it's ultimate parent). This matched with the front end of Refinitiv.

Could you explain your second search step using the PermIDs? The first step is sufficient for my needs, I now need to run this through a loop to do this for all 61 banks.

I noticed that incorporating a reference and [0] does not actually include two banks as you stated in your comment, instead it seems to convert one bank (in the first reference) from an array to just text. Do you know why this might be the case?

df_unique_names.values[0] # returns array(['JP Morgan & Co Inc'], dtype=object)
df_unique_names.values[61][0] # returns 'Banco Bilbao Vizcaya Argentaria SA'
df_unique_names.values[61] # returns array(['Banco Bilbao Vizcaya Argentaria SA'], dtype=object)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @l.marsden, I was just looking for one example among the results to focus on. I thought that JPMorgan already was an ultimate parent company and would not be owned by another company; and I didn't think that was the case for 'Banco Bilbao Vizcaya Argentaria SA' who I hadn't heard of before.
The `[0]` after `[61]` was only there to get the string out of the list.

FYI: I think it may be possible to get results for more than one search at a time, either through parallel calls or natively in Search. For more information on that, please read "Leveraging Parallel Programming in Python for Optimized Server Data Retrieval" & "Building Search into your Application Workflow".

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.