Supported corax¶
There are 2 event types of supported CorAx reference data for adjustments: splitRecord and stockDiv. These are the event types that determine the actions taken when adjustCorAx is applied to a getTicks or getStats API call.
splitRecord
- Also known as a bonus share, divides the value of each of the outstanding shares of a company. Depending on the stock split value, it can be anything from 2-to-1, 3-to-1 and even higher. These splits cause the value per stock to be reduced but the volume per shareholder increases by the same amount, keeping the overall value to be the same. This will allow for a shares values to increase over time leading to current shareholders to be rewarded and creates more interest for potential buyers.
stockDiv
- Dividends are issued from the company typically paid out at specific periods, usually quarterly or annually. These are essentially a share of the company's profits that are paid to owners of the stock. Stock dividends specifically is distributed stock given to the shareholders as payment instead of cash. If stock dividends are at 10% and a shareholder has 10 shares, then they receive 1 stock from the dividends.
How adjustCorAx works¶
When the adjustCorAx parameter is set to true (1b), this parameter applies the adjustmentFactor to the volume and price as follows depending on the corporate action: - If the corporate action is a stock split, the volume gets divided by the adjustmentFactor and the price gets multiplied by the adjustmentFactor and results in the normalised price (the price recorded for that day). - If the event type is a stock dividend, just the volume is changed as more stock has been generated by the company as part of a payment to the shareholders.
Default schemas¶
These are the default reference data table YAML files that store the corAx adjustment values for both types of adjustment.
coraxCapChange
table:
name: coraxCapChange
id-col: sym
time-col: time
taxonomy:
-
region: global
data-source: all
data-class: referenceData
-
region: emea
data-source: tr
data-class: marketData
sub-class: equity
-
region: emea
data-source: tr
data-class: marketData
sub-class: moneyMarket
intra-persist-type: none
end-persist-type: date-partition
columns:
-
name: sym
data-type: symbol
-
name: exDate
data-type: date
-
name: adjustmentFactor
data-type: float
-
name: eventType
-
name: eventTypeNum
data-type: symbol
-
name: description
-
name: coraxID
data-type: long
-
name: date
data-type: date
coraxDividends
table:
name: coraxDividends
id-col: sym
time-col: time
taxonomy:
-
region: global
data-source: all
data-class: referenceData
-
region: emea
data-source: tr
data-class: marketData
sub-class: equity
-
region: emea
data-source: tr
data-class: marketData
sub-class: moneyMarket
intra-persist-type: none
end-persist-type: date-partition
columns:
-
name: sym
data-type: symbol
-
name: exDate
data-type: date
-
name: dividendRate
data-type: float
-
name: eventType
-
name: description
-
name: coraxID
data-type: long
-
name: date
data-type: date
Client file uploader - where to upload new reference data to¶
The Client Upload is a default dashboard that is pre-installed with Refinery finance domain. The client file-upload system allows you to upload CSV files to a specified location in Refinery.
Info
Check out Client Data Upload for more on how to upload data files.
Alternatively, reference data files can directly be placed in the filesystem for the Client File Upload process to pick up. For corporate actions the directory is <DELTA_DATA>/refinery/DaaSData/trth/downloads/CorporateActionsStandard.
Reference data¶
Upload the reference data by selecting the Reference Data option; this will then load the file into the secMaster directory where the Client File Upload process will then load the file into the secMaster HDB and into the appropriate table. The reference data will be immediately available to query from the secmaster HDB via a getRef API call after file load. If relevant, reference data will also be distributed to other processes. In the context of this guide, corporate actions reference data is distributed to the equity HDB.
How the secMaster works¶
- The secMaster (security master) is a static HDB that can be directly queried.
- It has a subscription method (.refd.subscribe in lib/refd.q & .refdc.conAndSub in lib/refdc.q) for the Equity HDB to subscribe and poll reference data.
- Reference data inside the secMaster HDB is available via API call getRef.
Custom reference data table¶
It is possible to load reference data that is of different format to the default corAx schemas. Providing that the minimum required set of columns used for adjustments are provided, the default YAML file schemas can be modified to house the data. To do this, the YAML files can be modified directly.
Note
For corAx adjustments to work, the reference data table files require one of the taxonomy sub-classes to be equity. This shows the API calls which tables to call for corAx adjustments.
Minimum column requirement¶
There are certain column headers that are to be left as is in the YAML files as shown below:
| Parameters | Type | Example arguments | Descriptions |
|---|---|---|---|
`sym |
symbol | `BNPP.PA |
Name of the market |
`exDate |
date | 2000.01.01 |
Date it was executed on |
`adjustmentRate`dividendRate |
float | 0.5 |
Value of the adjustment |
`coraxID |
long | 123456 |
Corporate Action ID |
`date |
date | 2000.01.01 |
Date added to table |
The table(s) being modified to work with the loading of the reference data tables require these column headers as they get called directly in the source code.
FATVAR modification¶
For data loading through the clientFileUploader, a modification to the .daas.cfg.FATVAR:corax.csv will be required to complement the YAML changes; this configuration is a kxControl entity. Ensure that the data types correspond with the appropriate columns in the YAML file(s) and that the minimum columns required have a corresponding column.
Corresponding columns example¶
These are examples of the possible corresponding parameters that are needed when matching up the modified table YAML file and the FATVAR table.
| YAML table columns | FATVAR table columns |
|---|---|
| sym | sym |
| exDate | coraxDate |
| eventTypeName | typeName |
| eventID | ID |
| description | notes |
| coraxID | refID |
| adjustmentRate | adjustmentMultiplier |
| date | date |
Info
Don't forget to include a source/ corAx type to the FATVAR file; this field is also required to be a symbol.
fwTargetDB modification¶
For ingestion via clientFileUpload, make the following adjustments to the .daas.cfg.fwTargetDB:corax.csv kxControl configuration entity. Change the whereClause to contain the new source/ corAx type column and the variable that determines the corporate action. Change the updateCols function that maps the columns inputted in the FATVAR to the columns in the corAx table YAML file(s).
Event codes¶
To differentiate the different types of capChange and dividend actions, you can use an eventType and eventTypeNum/eventID. These eventTypeNums are available in the coraxCapChangeEvents.csv. To create a new eventType relationship, change the eventColumn to that column name and the eventIDs to the corresponding values. If there is no differentiation factor, remove the IDs from the eventIDs column; this will then assign a blank schema, thus allowing the adjustments to still work.
Note
Make sure that the eventColumn and eventID is a symbol when changing it to be the new differentiation factor.
coraxCapChangeEvents.csv¶
Default setup for the coraxCapChangeEvents.csv
| coraxType | eventColumn | eventID |
|---|---|---|
| splitRecord | eventTypeNum | 11 12 13 14 15 16 21 22 23 31 32 41 42 43 44 61 71 72 73 75 76 77 78 80 81 83 84 |
| stockDiv | eventTypeNum | 33 74 82 |
How to do corAx adjustments without using a secMaster¶
Using the secMaster is the recommended route for using reference data in the system as it supports the getRef API. However, the only requirement for being able to use corporate action adjustments is that the coraxCapChange table is populated on the equity HDB. However, reference data can be uploaded to the system without using the secMaster or the Client Upload dashboard.
- By creating or editing an existing table YAML file for coraxCapChange, with taxonomy matching the equity pipeline.
- Publishing the corAx reference data through the Tickerplant, in the same way the market data comes through.
Note
Be aware that this method means that the corAx adjustments won't be available until after EOD using new reference data, as it must be co-located to the HDB to work.
Example of adjustments¶
Example reference data¶
.gwClient.query.sync[`getRef;`symList`dataType`startDate`endDate`identifier`corAxType!(`BNPP.PA;`corAx;.z.d-10000;.z.d;`instrument;`capChange)]
| sym | exDate | adjustmentFactor | eventType | eventTypeNum | description | coraxID | date |
|---|---|---|---|---|---|---|---|
| BNPP.PA | 2002.02.20 | 0.5 | "Stock split" | 21 | "" | 2001753 | 2022.05.04 |
Calling getStats without adjustCorAx being called (0b)¶
.gwClient.query.sync[`getStats; `symList`assetClass`dataType`startDate`endDate`adjustCorAx`analytics`granularityUnit!(`BNPP.PA;`equity;`trade;.z.d-10000;.z.d;0b;`avgPrice`avgVolume;`day)]
| time | sym | avgPrice | avgVolume |
|---|---|---|---|
| 2002.02.18D00:00:00.000000000 | BNPP.PA | 105.91327800829865 | 389.65809128630707 |
| 2002.02.19D00:00:00.000000000 | BNPP.PA | 103.7722293538725 | 949.99529311082586 |
| 2002.02.20D00:00:00.000000000 | BNPP.PA | 50.787905405405368 | 803.40777027027025 |
| 2002.02.21D00:00:00.000000000 | BNPP.PA | 52.350337301587317 | 963.19047619047615 |
Calling getStats with adjustCorAx being called (1b)¶
.gwClient.query.sync[`getStats; `symList`assetClass`dataType`startDate`endDate`adjustCorAx`analytics`granularityUnit!(`BNPP.PA;`equity;`trade;.z.d-10000;.z.d;1b;`avgPrice;`day)]
| time | sym | avgPrice | avgVolume |
|---|---|---|---|
| 2002.02.18D00:00:00.000000000 | BNPP.PA | 52.956639004149345 | 779.31618257261414 |
| 2002.02.19D00:00:00.000000000 | BNPP.PA | 51.886114676936224 | 1899.9905862216517 |
| 2002.02.20D00:00:00.000000000 | BNPP.PA | 50.787905405405368 | 803.40777027027025 |
| 2002.02.21D00:00:00.000000000 | BNPP.PA | 52.350337301587317 | 963.19047619047615 |