Using Bloomberg DLPS Luminesce providers to import data

Prev Next

LUSID offers the following Luminesce providers that enable you to build bespoke Bloomberg DLPS data import flows:

  • Bloomberg.DataLicensePerSecurity.Request.BloombergValuation

  • Bloomberg.DataLicensePerSecurity.Request.CorporateActions

  • Bloomberg.DataLicensePerSecurity.Request.CurrentData

  • Bloomberg.DataLicensePerSecurity.Request.EntityData

  • Bloomberg.DataLicensePerSecurity.Request.HistoricalData

  • Bloomberg.DataLicensePerSecurity.Request.PricingSnapshot

  • Bloomberg.DataLicensePerSecurity.Request.TickHistory

Once you trigger a request to Bloomberg using the above providers, you can use the following providers to retrieve the data from the request in LUSID:

  • Bloomberg.DataLicensePerSecurity.DownloadableResponse

  • Bloomberg.DataLicensePerSecurity.DownloadableResponse.Data

Additionally, you can use the following supporting providers for instrument creation:

  • Bloomberg.Instrument.Mapping.RequiredFields: Retrieves the set of Bloomberg fields that LUSID requires to create a particular instrument type using Bloomberg.Instrument.Mapping.

  • Bloomberg.Instrument.Mapping: Maps instrument data retrieved from Bloomberg to a LUSID instrument definition; you can then pass this definition into Lusid.Instrument.Writer to create the instrument in LUSID.

  • Bloomberg.InstrumentEvent.Mapping: Maps corporate action data retrieved from Bloomberg to a LUSID instrument event definition. LUSID currently supports the following Bloomberg Action Event Types:

    • DVD_CASH

    • DVD_STOCK

    • SPIN

    • STOCK_SPLT

See how to use the Integrations dashboard to enrich existing instruments.

Setting up credentials for Luminesce data providers

Before getting started with the Luminesce data providers, you must supply your Bloomberg credentials in LUSID.

Step 1: Obtain Bloomberg application credentials

If you haven’t previously done so, follow these steps to obtain your Bloomberg application client_id and client_secret.

Step 2: Add your credentials to the Configuration Store

  1. Sign in to LUSID and navigate to System Settings > Configuration Store.

  2. Select the Shared keys tab.

  3. Locate and Edit the configuration set with scope Luminesce-Provider and code Bloomberg.

  4. Provide your ClientId and ClientSecret values from step 1.

  5. Click Save.

You can check your credentials are correct by navigating to Data Virtualisation > Query Editor and sending the following query:

@@requestId = select 'Test' || substr(generate_hash('SHA1', datetime('now')), 0, 10);
@instruments = select 'ISIN' as IdentifierType,'INVALID_ISIN' as IdentifierValue;
select *
from Bloomberg.DataLicensePerSecurity.Request.CurrentData
where Universe = @instruments
  and FieldList = 'NAME'
  and Identifier = @@requestId
  and Title = 'Test Connection'
  and SubmitImmediately = true
  and NotificationWaitSecs = 30;

You should receive a response containing a RequestId and ErrorCode of 0; this confirms your connection is working.

Running the integration

You can use Luminesce to build custom queries and bespoke data imports using the relevant data providers. Each custom query should follow this basic outline:

  1. Use the Bloomberg.DataLicensePerSecurity.Request.<x> providers to request data from Bloomberg.

  2. Use Bloomberg.DataLicensePerSecurity.DownloadableResponse to retrieve the Bloomberg RequestId and Key.

  3. Once Bloomberg produces your requested data, use Bloomberg.DataLicensePerSecurity.DownloadableResponse.Data to retrieve the data for onward processing in LUSID. Note we recommend scheduling a separate query for this step to guarantee Bloomberg has had time to process your request; see example A.

Example A: Daily price refresh

For example, to refresh pricing data for some instruments using the Bloomberg.DataLicensePerSecurity.Request.HistoricalData provider:

Step 1: Request data from Bloomberg

The following example sets up a daily recurring request for the PX_MID and PX_LAST fields for some specified instrument holdings:

-- Define the instruments you want to request data for
@instruments_table =
select LusidInstrumentId, Scope as InstrumentScope, 'ISIN' as IdentifierType, Isin as IdentifierValue 
from Lusid.Instrument
where scope = 'Finbourne-Examples'
  and LusidInstrumentId = 'LUID_00003DJO';

@portfolio_table = 
select i.LusidInstrumentId, i.InstrumentScope, i.IdentifierType, i.IdentifierValue
from @instruments_table i 
inner join Lusid.Portfolio.Holding h 
  on h.LusidInstrumentId = i.LusidInstrumentId
    and h.InstrumentScope = i.InstrumentScope
where h.PortfolioScope = 'Finbourne-Examples-Int'
  and h.PortfolioCode = 'EU';

-- Specify a friendly name and unique RequestId for the scheduled request
@@requestName = select 'RefreshPrice';   
@@requestId = select 'DailyPriceRefresh123';

-- Send the request to Bloomberg, specifying your recurring schedule
select c.*
from Bloomberg.DataLicensePerSecurity.Request.HistoricalData c
where c.Universe = @portfolio_table
  and c.FieldList = 'PX_MID,PX_LAST'
  and c.Identifier = @@requestId
  and c.Name = @@requestName
  and c.Title = 'Refresh Prices'
  and c.StartDate = '2025-09-18'
  and c.StartTime = '16:00:00'
  and c.Frequency = 'Daily'

Note the following:

  • You should specify a unique RequestId and keep a note of the value; you can use this to update or delete your recurring scheduled request.

  • You can define how often the schedule recurs by setting Frequency to one of the following:

    • once

    • daily

    • weekday

    • weekend

    • weekly

    • monthly

  • Specify a StartDate and StartTime to define when the schedule should come into effect.

  • For FieldList, you should specify a comma-separated list of values corresponding to the Mnemonic values in Bloomberg.

Step 2: Schedule a query to retrieve the data from Bloomberg

Once you’ve set up your recurring request schedule, create a second query that retrieves the data requested from Bloomberg.

Note

You should schedule this query to run at least 15 minutes after your scheduled request (step 1) to allow time for request batching in Bloomberg.

@@requestId = select 'DailyPriceRefresh123';
@@today = select Date('now');

@@responseKey =
select Key
from Bloomberg.DataLicensePerSecurity.DownloadableResponse
where RequestId = @@requestId
  and SnapshotStartTime > @@today
limit 1;

-- parse JSON file returned by BBG
@bbgData =
use Bloomberg.DataLicensePerSecurity.DownloadableResponse.Data with @@requestId, @@responseKey
--RequestId={@@requestId}
--ResponseKey={@@responseKey}
enduse;

select *
from @bbgData;

You can then choose to save the data to Drive with Drive.SaveAs, or immediately process the data using the relevant LUSID provider.

Update the instruments in a Bloomberg scheduled request

@instruments_table =
select LusidInstrumentId,
  Scope as InstrumentScope,
  'ISIN' as IdentifierType,
  Isin as IdentifierValue 
from Lusid.Instrument
where Scope = 'Finbourne-Examples'
  and LusidInstrumentId = 'LUID_00003DJO';

@portfolio_table = 
select i.LusidInstrumentId,
  i.InstrumentScope,
  i.IdentifierType,
  i.IdentifierValue
from @instruments_table i
inner join Lusid.Portfolio.Holding h 
  on h.LusidInstrumentId = i.LusidInstrumentId
    and h.InstrumentScope = i.InstrumentScope
where h.PortfolioScope = 'Finbourne-Examples-Int'
  and h.PortfolioCode = 'EU';

@@requestId = select 'DailyPriceRefresh';

select *
from Bloomberg.DataLicensePerSecurity.Request.HistoricalData
where Identifier = @@requestId
  and Universe = @PortfolioTable
  and WriteAction = 'Update'

Delete a Bloomberg scheduled request

@@requestName = select 'RefreshPrice';   
@@requestId = select 'DailyPriceRefresh';

select *
from Bloomberg.DataLicensePerSecurity.Request.HistoricalData
where Identifier = @@requestId
  and WriteAction = 'Delete'

Example B: Instrument creation

To create LUSID instruments using the Bloomberg.DataLicensePerSecurity.Request.CurrentData provider:

  1. Use Bloomberg.Instrument.Mapping.RequiredFields to retrieve the list of Bloomberg fields you’ll need to request for your desired instrument type.

  2. Send your request to Bloomberg, passing in the list of fields.

    Note

    The example below specifies cd.SubmitImmediately = true and cd.NotificationWaitSecs = 200 to request data from Bloomberg immediately as a one-time request, rather than waiting for batch processing.


    If you want to create instruments on a recurring schedule, set up this request on a schedule to help manage cost, as shown in example A. Read more on cost management.

  3. Retrieve the data from Bloomberg and map it to the corresponding fields in LUSID using Bloomberg.Instrument.Mapping.

  4. Create the instruments in LUSID using Lusid.Instrument.Writer.

The following example creates a cash dividend instrument event in LUSID:

@@requestId = select 'InstrumentCreation1';
@instruments_to_create = select 'ISIN' as IdentifierType,'GB00BZ4TGS74' as IdentifierValue;

-- 1. Retrieve the list of Bloomberg fields you'll need to request for your desired instrument type:
@@fields =
select AllRequiredFieldsForInstrumentType
from Bloomberg.Instrument.Mapping.RequiredFields
where NormaliseFields = false
  and InstrumentType = 'Bond'
limit 1;

-- 2. Send your request to Bloomberg, passing in the list of fields:
@@responseKey =
select dr.[Key]
from Bloomberg.DataLicensePerSecurity.Request.CurrentData cd
join Bloomberg.DataLicensePerSecurity.DownloadableResponse dr 
  on dr.RequestId = cd.RequestId
where cd.Universe = @instruments_to_create
  and cd.FieldList = @@fields
  and cd.Identifier = @@requestId
  and cd.Title = 'Bond instrument creation'
  and cd.SubmitImmediately = true
  and cd.NotificationWaitSecs = 200;

-- 3. Retrieve the data from Bloomberg and map it to the corresponding LUSID fields:
@x =
use Bloomberg.DataLicensePerSecurity.DownloadableResponse.Data with @@requestId, @@responseKey
--RequestId={@@requestId}
--ResponseKey={@@responseKey}
enduse;

@lusidDefs = 
select * from Bloomberg.Instrument.Mapping where ToMap = @x;

-- 4. Create the instruments in LUSID.
@@scope = select 'Finbourne-Examples-Ints';
@instruments =
select @@scope as Scope,
  'BbgDLPS' || Identifier as ClientInternal,
  Identifier as Isin,
  'Bond: ' || Identifier as DisplayName,
  DefinitionJson,
  SettlementCycleBusinessDayOffset,
  SettlementCycleCalendars
from @lusidDefs;

select * from Lusid.Instrument.Writer where ToWrite = @instruments;

Example C: Instrument events

To map instrument events using the Bloomberg.InstrumentEvent.Mapping provider:

  1. Define the instruments you want to retrieve corporate actions data for.

  2. Send the request to Bloomberg using Bloomberg.DataLicensePerSecurity.Request.CorporateActions, passing in a list of Bloomberg ActionsFilterActionMnemonics (Bloomberg fields) data points.

    Note

    The example below specifies c.SubmitImmediately = true and c.NotificationWaitSecs = 200 to request data from Bloomberg immediately as a one-time request, rather than waiting for batch processing.


    If you want to create instruments on a recurring schedule, set up this request on a schedule to help manage cost, as shown in example A. Read more on cost management.

  3. Retrieve the data from Bloomberg and map the responses using Bloomberg.InstrumentEvent.Mapping.

  4. Create the instrument events in LUSID using Lusid.InstrumentEvent.<x>.Writer.

The following example maps instrument events from Bloomberg corporate actions data:

-- 1. Define the instruments you want to request data for:
@instruments_table =
select LusidInstrumentId,
  Scope as InstrumentScope,
  'ISIN' as IdentifierType,
  Isin as IdentifierValue 
from Lusid.Instrument
where Scope = 'Finbourne-Examples'
  and LusidInstrumentId = 'LUID_00003DX1';

@portfolio_table = 
select i.LusidInstrumentId,
  i.InstrumentScope,
  i.IdentifierType,
  i.IdentifierValue
from @instruments_table i
inner join Lusid.Portfolio.Holding h 
  on h.LusidInstrumentId = i.LusidInstrumentId
    and h.InstrumentScope = i.InstrumentScope
where h.PortfolioScope = 'Finbourne-Examples'
  and h.PortfolioCode = 'InstrumentEvents';

@@requestId = select 'CorporateActions1';

-- 2. Send the request to Bloomberg, passing in a string list of fields (Mnemonics):
@@responseKey = 
select dr.[Key]
from Bloomberg.DataLicensePerSecurity.Request.CorporateActions c
join Bloomberg.DataLicensePerSecurity.DownloadableResponse dr
   on dr.RequestId = c.RequestId
where c.Universe = @portfolio_table
  and c.ActionsFilterActionMnemonics = 'DVD_CASH'
  and c.SubmitImmediately = True
  and c.NotificationWaitSecs = 200
  and c.Identifier = @@requestId
  and c.Title = 'Corporate Actions 1'
  and RuntimeOptionsDateRangeStartDate = DateTime('now', '-5 day')
  and RuntimeOptionsDateRangeEndDate = DateTime('now')
  and RuntimeOptionsActionsDate = 'Entry';

-- Define corporate action source if you haven't already done so:
@@CASourceScope = select 'Finbourne-Examples';
@@CASourceCode = select 'CASH_DVD';

@corporateActionSource = 
select @@CASourceScope as CorporateActionSourceScope,
  @@CASourceCode as CorporateActionSourceCode,
  'InstrumentEventMapping' as DisplayName,
  'Insert' as WriteAction;

@writeSource = 
select * from Lusid.CorporateAction.Source.Writer WAIT
where ToWrite = @corporateActionSource;

-- 3. Retrieve the data from Bloomberg and map it to the corresponding LUSID fields:
@bbgData =
use Bloomberg.DataLicensePerSecurity.DownloadableResponse.Data with @@requestId, @@responseKey
--RequestId={@@requestId}
--ResponseKey={@@responseKey}
enduse;

@mappedInstrEvents = 
select * from Bloomberg.InstrumentEvent.Mapping WAIT 
where ToMap = @bbgData; 

-- 4. Create the instrument events in LUSID:
@instrEventsToWrite = 
select @@CASourceScope as CorporateActionSourceScope,
  @@CASourceCode as CorporateActionSourceCode,
  REPLACE(Identifier, ' ', '_') || @@requestId as InstrumentEventId,
  SequenceNumber as SequenceNumber,
  ParticipationType as ParticipationType,
  DefinitionJson as DefinitionJson
from @mappedInstrEvents; 

@writeInstrEvents = 
select * from Lusid.InstrumentEvent.CashDividendEvent.Writer WAIT
where ToWrite = @instrEventsToWrite;

select * from Lusid.InstrumentEvent WAIT
where CorporateActionSourceScope = @@CASourceScope
  and CorporateActionSourceCode = @@CASourceCode;

Troubleshooting connection issues

unauthorized-client error

The following error indicates you are missing an IP address from your whitelisted IPs within the Bloomberg Enterprise Console LUSID application you created in step 1:

Failed when calling Bloomberg HAPI:
...
Errored with : Unauthorized
Details : {"errors":[{...
                      "errorCode":"unauthorized-client",
                      "status":401,
                      "detail":"Invalid IP, IP 123.12.123.12 not whitelisted"}],
                      "error":"unauthorized_client"}

No config found error

Query Execution failed.
'No config found in the Configuration Store under 'Bloomberg''

If you experience this error, verify that you’ve entered your Bloomberg credentials in the correct configuration set:

  • Scope: Luminesce-Provider

  • Code: Bloomberg

ClientId/ClientSecret has not been set error

Invalid configuration. ClientId has not been set.
Invalid configuration. ClientSecret has not been set.

If you experience this error, check that you’ve entered your Bloomberg credentials correctly in the Configuration Store.

403 (Forbidden) error

Response status code does not indicate success: 403 (Forbidden).

If you experience this error, check the values you’ve entered for your Bloomberg credentials in the Configuration Store are correct.