Skip to content

Commit 8b6405e

Browse files
BryanBryan
authored andcommitted
Route all cmdty to getQuote, Route c3 to JERQ, get c3 profile extensions from OnDemand
1 parent f924fc1 commit 8b6405e

File tree

8 files changed

+599
-479
lines changed

8 files changed

+599
-479
lines changed

docs/content/releases/5.3.0.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
**New Features**
2+
3+
* Added ```SymbolParser.getIsPlatts``` function.
4+
* Added ```SymbolParser.getIsC3``` function.
5+
6+
**Bug Fixes**
7+
8+
* Price formatting for [cmdty](https://www.barchart.com/cmdty) instruments has been corrected.
9+
10+
**Configuration Changes**
11+
12+
* Quotes for [Commodity3](https://www.commodity3.com/) instruments are sourced from JERQ instead of OnDemand.
13+
* Quotes for [cmdty](https://www.barchart.com/cmdty) instruments are now sourced from a different OnDemand endpoint.

example/browser/js/startup.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ module.exports = (() => {
202202
symbols = C3_OLD;
203203
} else if (symbol === '#CMDTY') {
204204
symbols = CMDTY;
205-
} else if (symbol === '#CMDTY_OLD') {
206-
symbols = CMDTY_OLD;
207205
} else if (symbol === '#PLATTS') {
208206
symbols = PLATTS;
209207
} else if (symbol === '#BOTH') {
@@ -464,9 +462,8 @@ module.exports = (() => {
464462

465463
const SP_500 = [ 'ABT', 'ABBV', 'ACN', 'ATVI', 'AYI', 'ADBE', 'AMD', 'AAP', 'AES', 'AET', 'AMG', 'AFL', 'A', 'APD', 'AKAM', 'ALK', 'ALB', 'ARE', 'ALXN', 'ALGN', 'ALLE', 'AGN', 'ADS', 'LNT', 'ALL', 'GOOGL', 'GOOG', 'MO', 'AMZN', 'AEE', 'AAL', 'AEP', 'AXP', 'AIG', 'AMT', 'AWK', 'AMP', 'ABC', 'AME', 'AMGN', 'APH', 'APC', 'ADI', 'ANDV', 'ANSS', 'ANTM', 'AON', 'AOS', 'APA', 'AIV', 'AAPL', 'AMAT', 'ADM', 'ARNC', 'AJG', 'AIZ', 'T', 'ADSK', 'ADP', 'AZO', 'AVB', 'AVY', 'BHGE', 'BLL', 'BAC', 'BK', 'BCR', 'BAX', 'BBT', 'BDX', 'BRK.B', 'BBY', 'BIIB', 'BLK', 'HRB', 'BA', 'BWA', 'BXP', 'BSX', 'BHF', 'BMY', 'AVGO', 'BF.B', 'CHRW', 'CA', 'COG', 'CDNS', 'CPB', 'COF', 'CAH', 'CBOE', 'KMX', 'CCL', 'CAT', 'CBG', 'CBS', 'CELG', 'CNC', 'CNP', 'CTL', 'CERN', 'CF', 'SCHW', 'CHTR', 'CHK', 'CVX', 'CMG', 'CB', 'CHD', 'CI', 'XEC', 'CINF', 'CTAS', 'CSCO', 'C', 'CFG', 'CTXS', 'CLX', 'CME', 'CMS', 'COH', 'KO', 'CTSH', 'CL', 'CMCSA', 'CMA', 'CAG', 'CXO', 'COP', 'ED', 'STZ', 'COO', 'GLW', 'COST', 'COTY', 'CCI', 'CSRA', 'CSX', 'CMI', 'CVS', 'DHI', 'DHR', 'DRI', 'DVA', 'DE', 'DLPH', 'DAL', 'XRAY', 'DVN', 'DLR', 'DFS', 'DISCA', 'DISCK', 'DISH', 'DG', 'DLTR', 'D', 'DOV', 'DWDP', 'DPS', 'DTE', 'DRE', 'DUK', 'DXC', 'ETFC', 'EMN', 'ETN', 'EBAY', 'ECL', 'EIX', 'EW', 'EA', 'EMR', 'ETR', 'EVHC', 'EOG', 'EQT', 'EFX', 'EQIX', 'EQR', 'ESS', 'EL', 'ES', 'RE', 'EXC', 'EXPE', 'EXPD', 'ESRX', 'EXR', 'XOM', 'FFIV', 'FB', 'FAST', 'FRT', 'FDX', 'FIS', 'FITB', 'FE', 'FISV', 'FLIR', 'FLS', 'FLR', 'FMC', 'FL', 'F', 'FTV', 'FBHS', 'BEN', 'FCX', 'GPS', 'GRMN', 'IT', 'GD', 'GE', 'GGP', 'GIS', 'GM', 'GPC', 'GILD', 'GPN', 'GS', 'GT', 'GWW', 'HAL', 'HBI', 'HOG', 'HRS', 'HIG', 'HAS', 'HCA', 'HCP', 'HP', 'HSIC', 'HSY', 'HES', 'HPE', 'HLT', 'HOLX', 'HD', 'HON', 'HRL', 'HST', 'HPQ', 'HUM', 'HBAN', 'IDXX', 'INFO', 'ITW', 'ILMN', 'IR', 'INTC', 'ICE', 'IBM', 'INCY', 'IP', 'IPG', 'IFF', 'INTU', 'ISRG', 'IVZ', 'IRM', 'JEC', 'JBHT', 'SJM', 'JNJ', 'JCI', 'JPM', 'JNPR', 'KSU', 'K', 'KEY', 'KMB', 'KIM', 'KMI', 'KLAC', 'KSS', 'KHC', 'KR', 'LB', 'LLL', 'LH', 'LRCX', 'LEG', 'LEN', 'LUK', 'LLY', 'LNC', 'LKQ', 'LMT', 'L', 'LOW', 'LYB', 'MTB', 'MAC', 'M', 'MRO', 'MPC', 'MAR', 'MMC', 'MLM', 'MAS', 'MA', 'MAT', 'MKC', 'MCD', 'MCK', 'MDT', 'MRK', 'MET', 'MTD', 'MGM', 'KORS', 'MCHP', 'MU', 'MSFT', 'MAA', 'MHK', 'TAP', 'MDLZ', 'MON', 'MNST', 'MCO', 'MS', 'MOS', 'MSI', 'MYL', 'NDAQ', 'NOV', 'NAVI', 'NTAP', 'NFLX', 'NWL', 'NFX', 'NEM', 'NWSA', 'NWS', 'NEE', 'NLSN', 'NKE', 'NI', 'NBL', 'JWN', 'NSC', 'NTRS', 'NOC', 'NCLH', 'NRG', 'NUE', 'NVDA', 'ORLY', 'OXY', 'OMC', 'OKE', 'ORCL', 'PCAR', 'PKG', 'PH', 'PDCO', 'PAYX', 'PYPL', 'PNR', 'PBCT', 'PEP', 'PKI', 'PRGO', 'PFE', 'PCG', 'PM', 'PSX', 'PNW', 'PXD', 'PNC', 'RL', 'PPG', 'PPL', 'PX', 'PCLN', 'PFG', 'PG', 'PGR', 'PLD', 'PRU', 'PEG', 'PSA', 'PHM', 'PVH', 'QRVO', 'PWR', 'QCOM', 'DGX', 'Q', 'RRC', 'RJF', 'RTN', 'O', 'RHT', 'REG', 'REGN', 'RF', 'RSG', 'RMD', 'RHI', 'ROK', 'COL', 'ROP', 'ROST', 'RCL', 'CRM', 'SBAC', 'SCG', 'SLB', 'SNI', 'STX', 'SEE', 'SRE', 'SHW', 'SIG', 'SPG', 'SWKS', 'SLG', 'SNA', 'SO', 'LUV', 'SPGI', 'SWK', 'SBUX', 'STT', 'SRCL', 'SYK', 'STI', 'SYMC', 'SYF', 'SNPS', 'SYY', 'TROW', 'TGT', 'TEL', 'FTI', 'TXN', 'TXT', 'TMO', 'TIF', 'TWX', 'TJX', 'TMK', 'TSS', 'TSCO', 'TDG', 'TRV', 'TRIP', 'FOXA', 'FOX', 'TSN', 'UDR', 'ULTA', 'USB', 'UA', 'UAA', 'UNP', 'UAL', 'UNH', 'UPS', 'URI', 'UTX', 'UHS', 'UNM', 'VFC', 'VLO', 'VAR', 'VTR', 'VRSN', 'VRSK', 'VZ', 'VRTX', 'VIAB', 'V', 'VNO', 'VMC', 'WMT', 'WBA', 'DIS', 'WM', 'WAT', 'WEC', 'WFC', 'HCN', 'WDC', 'WU', 'WRK', 'WY', 'WHR', 'WMB', 'WLTW', 'WYN', 'WYNN', 'XEL', 'XRX', 'XLNX', 'XL', 'XYL', 'YUM', 'ZBH', 'ZION', 'ZTS' ];
466464
const C3 = [ 'AL79MRM1.C3', 'BSP9WGQ1.C3', 'RA10BGM1.C3' ];
467-
const CMDTY = [ 'BC5L09YB.CS', 'EI3E06EI.CS', 'EI3E06EJ.CS', 'USDA-CORN-COND-EXC-AL-2528.CS', 'EURS-BEET-PRICE-SELL-GBR-33877.CS', 'EUJU0Q51.CS' ];
468465
const C3_OLD = [ 'C3:AL79MRM1', 'C3:BSP9WGQ1', 'C3:RA10BGM1' ];
469-
const CMDTY_OLD = [ 'BC5L09YB.CM', 'EI3E06EI.CM', 'EI3E06EJ.CM', 'USDA-CORN-COND-EXC-AL-2528.CM', 'EURS-BEET-PRICE-SELL-GBR-33877.CM', 'EUJU0Q51.CM' ];
466+
const CMDTY = [ 'EUJU0Q51.CS', 'BC5L09YB.CS', 'EI3E06EI.CS', 'EI3E06EJ.CS' ];
470467
const PLATTS = [ 'PLATTS:RD52017', 'PLATTS:RD5MA17', 'PLATTS:RD52018' ];
471468
const AG = [ 'ZCPAIA.CM', 'ZCPAIL.CM', 'ZCPAIN.CM', 'ZCPAKS.CM', 'ZCPAMI.CM' ];
472469
const BOTH = [ 'ESZ19', 'ESZ9' ];

lib/connection/Connection.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,6 @@ module.exports = (() => {
4646
const _RECONNECT_INTERVAL = 5000;
4747
const _WATCHDOG_INTERVAL = 10000;
4848

49-
const regex = {};
50-
51-
regex.cmdty = {};
52-
regex.cmdty.short = /^(AE|BC|BE|BH|BL|CA|CB|EI|EU|CF|UD)(.*)(\.CS)$/i;
53-
regex.cmdty.long = /^(BCSD-|BEA-|BLS-|CANS-|EIA-|EURS-|CFTC-|USCB-|USDA-)/i;
54-
regex.cmdty.alias = /^(AE|BC|BE|BL|CA|CB|EI|EU|CF|UD|BCSD-|BEA-|BH-|BLS-|CANS-|EIA-|EURS-|CFTC-|USCB-|USACE-|USDA-)(.*)(\.CM)$/i;
55-
56-
regex.other = /:/i;
57-
5849
function ConnectionInternal(marketState, instance) {
5950
const __logger = LoggerFactory.getLogger('@barchart/marketdata-api-js');
6051

@@ -1411,7 +1402,7 @@ module.exports = (() => {
14111402
return;
14121403
}
14131404

1414-
retrieveProfileExtensions(symbols)
1405+
retrieveProfileExtensions(symbols, __loginInfo.username, __loginInfo.password)
14151406
.then((extensions) => {
14161407
if (__connectionState !== state.authenticated) {
14171408
return;
@@ -1575,7 +1566,7 @@ module.exports = (() => {
15751566
* @returns {Boolean}
15761567
*/
15771568
function getIsSnapshotSymbol(symbol) {
1578-
return regex.cmdty.long.test(symbol) || regex.cmdty.short.test(symbol) || regex.cmdty.alias.test(symbol) || regex.other.test(symbol);
1569+
return SymbolParser.getIsPlatts(symbol) || SymbolParser.getIsCmdty(symbol);
15791570
}
15801571

15811572
/**
@@ -1588,7 +1579,7 @@ module.exports = (() => {
15881579
* @returns {Boolean}
15891580
*/
15901581
function getIsExtendedSymbol(symbol) {
1591-
return SymbolParser.getIsFuture(symbol) || SymbolParser.getIsC3(symbol);
1582+
return SymbolParser.getIsFuture(symbol) || SymbolParser.getIsC3(symbol) || SymbolParser.getIsCmdty(symbol);
15921583
}
15931584

15941585
/**

lib/connection/snapshots/profiles/retrieveProfileExtensions.js

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ const array = require('@barchart/common-js/lang/array'),
77

88
const SymbolParser = require('./../../../utilities/parsers/SymbolParser');
99

10+
const LoggerFactory = require('./../../../logging/LoggerFactory');
11+
1012
module.exports = (() => {
1113
'use strict';
1214

13-
const regex = {};
14-
15-
regex.dates = {};
16-
regex.dates.expire = /^([0-9]{4}-[0-9]{2}-[0-9]{2})T/;
15+
let logger = null;
1716

1817
/**
1918
* Executes an HTTP request for "extended" profile data for an array
@@ -27,14 +26,18 @@ module.exports = (() => {
2726
function retrieveProfileExtensions(symbols, username, password) {
2827
return Promise.resolve()
2928
.then(() => {
29+
if (logger === null) {
30+
logger = LoggerFactory.getLogger('@barchart/marketdata-api-js');
31+
}
32+
3033
assert.argumentIsArray(symbols, 'symbols', String);
3134

3235
const symbolsForOnDemand = symbols.filter(SymbolParser.getIsC3);
3336
const symbolsForExtras = symbols.filter(SymbolParser.getIsFuture);
3437

3538
return Promise.all([
3639
retrieveProfileExtensionsFromExtras(symbolsForExtras),
37-
retrieveProfileExtensionsFromOnDemand(symbolsForOnDemand)
40+
retrieveProfileExtensionsFromOnDemand(symbolsForOnDemand, username, password)
3841
]).then((results) => {
3942
return array.flatten(results);
4043
});
@@ -86,17 +89,83 @@ module.exports = (() => {
8689
});
8790
}
8891

89-
function retrieveProfileExtensionsFromOnDemand(symbols) {
92+
function retrieveProfileExtensionsFromOnDemand(symbols, username, password) {
9093
return Promise.resolve()
9194
.then(() => {
9295
if (symbols.length === 0) {
9396
return Promise.resolve([ ]);
9497
}
9598

96-
return Promise.resolve([ ]);
99+
const options = {
100+
url: `https://webapp-proxy.aws.barchart.com/v1/proxies/ondemand/getQuote.json?username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}&symbols=${encodeURIComponent(symbols.join())}`,
101+
method: 'GET'
102+
};
103+
104+
return Promise.resolve(axios(options))
105+
.then((response) => {
106+
const results = response.data.results || [];
107+
108+
return results.reduce((accumulator, result) => {
109+
try {
110+
const extension = {};
111+
112+
extension.symbol = result.symbol.toUpperCase();
113+
114+
if (SymbolParser.getIsC3(extension.symbol)) {
115+
const c3 = { };
116+
117+
c3.currency = null;
118+
c3.delivery = null;
119+
120+
if (result.commodityDataCurrency) {
121+
c3.currency = getC3Currency(result.commodityDataCurrency);
122+
}
123+
124+
if (result.commodityDataDelivery) {
125+
c3.delivery = result.commodityDataDelivery;
126+
}
127+
128+
extension.c3 = c3;
129+
}
130+
131+
accumulator.push(extension);
132+
} catch (e) {
133+
logger.warn(`Snapshot: Failed to process symbol`);
134+
}
135+
136+
return accumulator;
137+
}, [ ]);
138+
});
97139
});
98140
}
99141

142+
143+
const regex = {};
144+
145+
regex.dates = {};
146+
regex.dates.expire = /^([0-9]{4}-[0-9]{2}-[0-9]{2})T/;
147+
148+
regex.c3 = {};
149+
regex.c3.currencies = {};
150+
regex.c3.currencies.eur = /^(EUR)\/(.*)$/i;
151+
regex.c3.currencies.rub = /^(RUB)\/(.*)$/i;
152+
regex.c3.currencies.uah = /^(UAH)\/(.*)$/i;
153+
regex.c3.currencies.usd = /^(USD|Usc|\$|)\/(.*)$/i;
154+
155+
function getC3Currency(lotSizeFix) {
156+
if (regex.c3.currencies.eur.test(lotSizeFix)) {
157+
return 'EUR';
158+
} else if (regex.c3.currencies.rub.test(lotSizeFix)) {
159+
return 'RUB';
160+
} else if (regex.c3.currencies.uah.test(lotSizeFix)) {
161+
return 'UAH';
162+
} else if (regex.c3.currencies.usd.test(lotSizeFix)) {
163+
return 'USD';
164+
} else {
165+
return null;
166+
}
167+
}
168+
100169
/**
101170
* Extended profile information.
102171
*

lib/connection/snapshots/quotes/retrieveSnapshots.js

Lines changed: 17 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,17 @@ const axios = require('axios');
33
const array = require('@barchart/common-js/lang/array'),
44
is = require('@barchart/common-js/lang/is');
55

6-
const convertDateToDayCode = require('../../../utilities/convert/dateToDayCode'),
7-
convertDayCodeToNumber = require('../../../utilities/convert/dayCodeToNumber'),
8-
convertBaseCodeToUnitCode = require('../../../utilities/convert/baseCodeToUnitCode');
6+
const convertDateToDayCode = require('./../../../utilities/convert/dateToDayCode'),
7+
convertDayCodeToNumber = require('./../../../utilities/convert/dayCodeToNumber'),
8+
convertBaseCodeToUnitCode = require('./../../../utilities/convert/baseCodeToUnitCode');
9+
10+
const SymbolParser = require('./../../../utilities/parsers/SymbolParser');
911

1012
const LoggerFactory = require('./../../../logging/LoggerFactory');
1113

1214
module.exports = (() => {
1315
'use strict';
1416

15-
const regex = {};
16-
17-
regex.day = /^([0-9]{4}).?([0-9]{2}).?([0-9]{2})$/;
18-
19-
regex.cmdty = {};
20-
regex.cmdty.short = /^(AE|BC|BE|BH|BL|CA|CB|EI|EU|CF|UD)(.*)(\.CS)$/i;
21-
regex.cmdty.long = /^(BCSD-|BEA-|BLS-|CANS-|EIA-|EURS-|CFTC-|USCB-|USDA-)/i;
22-
regex.cmdty.alias = /^(AE|BC|BE|BL|CA|CB|EI|EU|CF|UD|BCSD-|BEA-|BH-|BLS-|CANS-|EIA-|EURS-|CFTC-|USCB-|USACE-|USDA-)(.*)(\.CM)$/i;
23-
24-
regex.c3 = {};
25-
regex.c3.symbol = /(\.C3)$/i;
26-
regex.c3.alias = /^(C3:)(.*)$/i;
27-
28-
regex.c3.currencies = {};
29-
regex.c3.currencies.eur = /^(EUR)\/(.*)$/i;
30-
regex.c3.currencies.rub = /^(RUB)\/(.*)$/i;
31-
regex.c3.currencies.uah = /^(UAH)\/(.*)$/i;
32-
regex.c3.currencies.usd = /^(USD|Usc|\$|)\/(.*)$/i;
33-
3417
let logger = null;
3518

3619
/**
@@ -80,25 +63,17 @@ module.exports = (() => {
8063
const getQuoteSymbols = [];
8164

8265
symbolsToUse.forEach((symbol) => {
83-
const concrete = getConcreteSymbol(symbol);
66+
const concrete = SymbolParser.getProducerSymbol(symbol);
8467

8568
if (concrete !== symbol) {
8669
aliases[concrete] = symbol;
8770
}
8871

89-
if (regex.cmdty.long.test(concrete) || regex.cmdty.short.test(concrete)) {
90-
getCmdtySymbols.push(concrete);
91-
} else {
92-
getQuoteSymbols.push(concrete);
93-
}
72+
getQuoteSymbols.push(concrete);
9473
});
9574

9675
const promises = [];
9776

98-
if (getCmdtySymbols.length !== 0) {
99-
promises.push(retrieveSnapshotsUsingGetCmdtyStats(getCmdtySymbols, username, password));
100-
}
101-
10277

10378
if (getQuoteSymbols.length !== 0) {
10479
promises.push(retrieveSnapshotsUsingGetQuote(getQuoteSymbols, username, password));
@@ -200,7 +175,7 @@ module.exports = (() => {
200175

201176
message.lastUpdate = message.tradeTime;
202177

203-
if (regex.c3.symbol.test(message.symbol)) {
178+
if (SymbolParser.getIsC3(message.symbol)) {
204179
const c3 = {};
205180

206181
c3.currency = null;
@@ -219,7 +194,7 @@ module.exports = (() => {
219194

220195
accumulator.push(message);
221196
} catch (e) {
222-
logger.warn(`Snapshot: Failed to process for symbol`);
197+
logger.warn(`Snapshot: Failed to process symbol`);
223198
}
224199

225200
return accumulator;
@@ -230,67 +205,16 @@ module.exports = (() => {
230205
});
231206
}
232207

233-
function retrieveSnapshotsUsingGetCmdtyStats(symbols, username, password) {
234-
return Promise.resolve()
235-
.then(() => {
236-
const options = {
237-
url: `https://webapp-proxy.aws.barchart.com/v1/proxies/ondemand/getCmdtyQuotes.json?username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}&symbols=${encodeURIComponent(symbols.join(','))}`,
238-
method: 'GET'
239-
};
240-
241-
return Promise.resolve(axios(options))
242-
.then((response) => {
243-
const results = response.data.results || [];
244-
245-
const messages = symbols.reduce((accumulator, symbol) => {
246-
try {
247-
const result = results.find(result => result.symbol === symbol || result.shortSymbol === symbol);
248-
249-
if (!result) {
250-
return accumulator;
251-
}
252-
253-
const match = result.tradeTimestamp.match(regex.day);
254-
const date = new Date(parseInt(match[1]), parseInt(match[2]) - 1, parseInt(match[3]));
255-
const dayCode = convertDateToDayCode(date);
256-
257-
const message = {};
258-
259-
message.type = 'REFRESH_QUOTE';
260-
261-
if (regex.cmdty.long.test(symbol)) {
262-
message.symbol = result.symbol.toUpperCase();
263-
} else {
264-
message.symbol = result.shortSymbol.toUpperCase();
265-
}
266-
267-
message.name = result.shortName;
268-
message.exchange = 'CSTATS';
269-
message.unitcode = '2';
270-
271-
message.day = dayCode;
272-
message.dayNum = convertDayCodeToNumber(dayCode);
273-
274-
message.lastPrice = result.lastPrice;
275-
276-
if (result.previousClose) {
277-
message.previousPrice = result.previousClose;
278-
}
279-
280-
message.lastUpdate = date;
281-
282-
accumulator.push(message);
283-
} catch (e) {
284-
logger.warn(`Snapshot: Failed to process response for cmdtyStats symbol [ ${symbol} ]`);
285-
}
208+
const regex = {};
286209

287-
return accumulator;
288-
}, []);
210+
regex.day = /^([0-9]{4}).?([0-9]{2}).?([0-9]{2})$/;
289211

290-
return messages;
291-
});
292-
});
293-
}
212+
regex.c3 = {};
213+
regex.c3.currencies = {};
214+
regex.c3.currencies.eur = /^(EUR)\/(.*)$/i;
215+
regex.c3.currencies.rub = /^(RUB)\/(.*)$/i;
216+
regex.c3.currencies.uah = /^(UAH)\/(.*)$/i;
217+
regex.c3.currencies.usd = /^(USD|Usc|\$|)\/(.*)$/i;
294218

295219
function getC3Currency(lotSizeFix) {
296220
if (regex.c3.currencies.eur.test(lotSizeFix)) {
@@ -306,15 +230,5 @@ module.exports = (() => {
306230
}
307231
}
308232

309-
function getConcreteSymbol(symbol) {
310-
if (regex.cmdty.alias.test(symbol)) {
311-
return symbol.replace(regex.cmdty.alias, '$1$2.CS');
312-
} else if (regex.c3.alias.test(symbol)) {
313-
return symbol.replace(regex.c3.alias, '$2.C3');
314-
} else {
315-
return symbol;
316-
}
317-
}
318-
319233
return retrieveSnapshots;
320234
})();

lib/marketState/MarketState.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ module.exports = (() => {
138138
if (extension.firstNotice) {
139139
profile.firstNotice = extension.firstNotice;
140140
}
141+
142+
if (extension.c3) {
143+
profile.c3 = extension.c3;
144+
}
141145
};
142146

143147
const _createProfile = (symbol, name, exchange, unitCode, pointValue, tickIncrement, additional) => {

0 commit comments

Comments
 (0)