yggio 0.0.6 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/benchmarks/fix.js +27 -31
- package/benchmarks/types.js +3 -3
- package/binding.d.ts +177 -80
- package/binding.js +131 -79
- package/index.d.ts +2074 -510
- package/index.js +35 -8
- package/package.json +8 -4
- package/records.js +30 -0
package/benchmarks/fix.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// wrapper the answer is put in, and - for the two loads - the shard read the
|
|
8
8
|
// boundary only names. The generated registries are written to a temporary
|
|
9
9
|
// folder and removed on the way out, so the only tracked input is the seed
|
|
10
|
-
// dictionary
|
|
10
|
+
// dictionary `config/seeds/fix.parquet`.
|
|
11
11
|
|
|
12
12
|
const fs = require('node:fs')
|
|
13
13
|
const os = require('node:os')
|
|
@@ -53,7 +53,7 @@ function benchmarkLoad(name, operation) {
|
|
|
53
53
|
console.log(`${name}: ${rate.toLocaleString('en-US')} operations/second`)
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const SEED = path.join(__dirname, '..', '..', 'config', 'fix')
|
|
56
|
+
const SEED = path.join(__dirname, '..', '..', 'config', 'seeds', 'fix.parquet')
|
|
57
57
|
const WIDE_FIELDS = 200
|
|
58
58
|
const VENDOR_DIALECT = 'cme'
|
|
59
59
|
const VENDOR_FIELDS = 200
|
|
@@ -116,15 +116,11 @@ const order = fields.struct(
|
|
|
116
116
|
{ nullable: false },
|
|
117
117
|
)
|
|
118
118
|
// `PartyRole(452)` states a code set, so it holds its wire code as text.
|
|
119
|
-
const message = fix.MarketMessage.fromFixRecord(
|
|
120
|
-
order,
|
|
121
|
-
{
|
|
119
|
+
const message = fix.MarketMessage.fromFixRecord(order, {
|
|
122
120
|
symbol: 'AAPL',
|
|
123
121
|
orderqty: Scalar.decimal(100n * 10n ** 18n, 18),
|
|
124
122
|
parties: [{ partyid: 'BROKER', partyidsource: 'D', partyrole: '1' }],
|
|
125
|
-
},
|
|
126
|
-
registry,
|
|
127
|
-
)
|
|
123
|
+
}, new fix.MarketMessagesOptions(registry))
|
|
128
124
|
|
|
129
125
|
const catalog = new fix.FixRegistry()
|
|
130
126
|
const counter = Field.from('NoPartyIDs: int32')
|
|
@@ -157,8 +153,8 @@ arrivingField.fix.tag = 55
|
|
|
157
153
|
if (catalog.clone().addField(foldingField) !== false) throw new Error('party_id should fold')
|
|
158
154
|
if (catalog.clone().addField(arrivingField) !== true) throw new Error('Symbol should arrive')
|
|
159
155
|
const singleton = catalog.msgtype('D')
|
|
160
|
-
const
|
|
161
|
-
const
|
|
156
|
+
const catalogOptions = new fix.MarketMessagesOptions(catalog)
|
|
157
|
+
const snapshotOptions = new fix.MarketMessagesOptions(catalog, { snapshotNs: 1_000_000_000n })
|
|
162
158
|
|
|
163
159
|
function drain(values) {
|
|
164
160
|
let count = 0
|
|
@@ -168,14 +164,14 @@ function drain(values) {
|
|
|
168
164
|
|
|
169
165
|
// The stream and Arrow doors, over a capture of wide orders: what is measured
|
|
170
166
|
// is the crossing - one pull per line, one batch per pull - beside the parse.
|
|
171
|
-
const
|
|
167
|
+
const seedOptions = new fix.MarketMessagesOptions(registry)
|
|
172
168
|
const fixedSchema = fix.MarketMessage.field()
|
|
173
169
|
const encoder = new TextEncoder()
|
|
174
170
|
const LINES = Array.from({ length: 256 }, (_, index) =>
|
|
175
171
|
encoder.encode(`8=FIX.4.4|35=D|11=ORDER-${String(index).padStart(6, '0')}|55=AAPL|54=1|38=100|58=${'x'.repeat(200)}|10=0|`),
|
|
176
172
|
)
|
|
177
173
|
const capture = new arrow.Table({ body: arrow.vectorFromArray(LINES, new arrow.Binary()) })
|
|
178
|
-
const parsed =
|
|
174
|
+
const parsed = fix.MarketMessage.fromLine(Buffer.from(LINES[0]), seedOptions)
|
|
179
175
|
const orderType = registry.msgtype('D')
|
|
180
176
|
const orderDeclaration = orderType.asField()
|
|
181
177
|
if (parsed.identifiers.get('clordid') !== 'ORDER-000000') {
|
|
@@ -184,11 +180,11 @@ if (parsed.identifiers.get('clordid') !== 'ORDER-000000') {
|
|
|
184
180
|
if (orderType.identifierValues(parsed)[0][0].name !== 'clordid') {
|
|
185
181
|
throw new Error('the compiled selector must reach the stated order identifier')
|
|
186
182
|
}
|
|
187
|
-
if (orderType.marketdatakind !== '
|
|
183
|
+
if (orderType.marketdatakind !== 'OPER' || parsed.marketdatakind !== 'OPER' || snapshotCodec.snapshotNs !== 1_000_000_000n) {
|
|
188
184
|
throw new Error('FIX category and exact snapshot boundary mismatch')
|
|
189
185
|
}
|
|
190
186
|
const parsedRow = parsed.intoRow(fixedSchema)
|
|
191
|
-
const parsedIpc =
|
|
187
|
+
const parsedIpc = new fix.MarketMessages(seedOptions).fromTextArrowReader(capture).intoArrowReader().intoIpc()
|
|
192
188
|
// The line door, each line as a text reader answers it.
|
|
193
189
|
const TEXT_LINES = LINES.map((body, index) => new TextLine(BigInt(index), Buffer.from(body)))
|
|
194
190
|
// The same door with a `msgpluginid` capture on every line: the capture fills
|
|
@@ -203,14 +199,14 @@ const msgpluginidRegistry = (() => {
|
|
|
203
199
|
held.insert(venue)
|
|
204
200
|
return held
|
|
205
201
|
})()
|
|
206
|
-
const
|
|
202
|
+
const msgpluginidOptions = new fix.MarketMessagesOptions(msgpluginidRegistry, { captureNames: ['msgpluginid'] })
|
|
207
203
|
const MSGPLUGINID_LINES = LINES.map((body, index) =>
|
|
208
204
|
new TextLine(BigInt(index), Buffer.from(body), [index % 2 === 0 ? VENDOR_DIALECT : 'OMS_X1_TradeCapture']),
|
|
209
205
|
)
|
|
210
|
-
if (drain(
|
|
206
|
+
if (drain(new fix.MarketMessages(msgpluginidOptions).fromTextLines(MSGPLUGINID_LINES)) !== LINES.length) {
|
|
211
207
|
throw new Error('msgpluginid line cardinality mismatch')
|
|
212
208
|
}
|
|
213
|
-
if (drain(
|
|
209
|
+
if (drain(new fix.MarketMessages(seedOptions).fromLines(LINES)) !== LINES.length) throw new Error('line cardinality mismatch')
|
|
214
210
|
const sink = { write() {} }
|
|
215
211
|
|
|
216
212
|
try {
|
|
@@ -244,7 +240,7 @@ try {
|
|
|
244
240
|
benchmark('fix/field_msgcat', () => orderDeclaration.fix.msgcat)
|
|
245
241
|
benchmark('fix/msgtype_marketdatakind', () => orderType.marketdatakind)
|
|
246
242
|
benchmark('fix/message_marketdatakind', () => parsed.marketdatakind)
|
|
247
|
-
benchmark('fix/
|
|
243
|
+
benchmark('fix/options_snapshot_ns', () => snapshotOptions.snapshotNs)
|
|
248
244
|
benchmark('fix/identifier_values', () => orderType.identifierValues(parsed))
|
|
249
245
|
// The typed holders, each read once into the plain object it crosses as.
|
|
250
246
|
benchmark('fix/message_header', () => parsed.header())
|
|
@@ -262,7 +258,7 @@ try {
|
|
|
262
258
|
benchmark('fix/message_get_by_name', () => message.getByName('ticker'))
|
|
263
259
|
benchmark('fix/message_get_by_path', () => message.getByPath('Parties.0.PartyID'))
|
|
264
260
|
benchmark('fix/infer_fixml_protocol', () => MimeType.inferBytes(FIXML_LINE))
|
|
265
|
-
benchmark('fix/infer_ullink_msgtype', () => fix.
|
|
261
|
+
benchmark('fix/infer_ullink_msgtype', () => fix.MarketMessagesOptions.inferMsgtypeText(ULLINK_LINE))
|
|
266
262
|
benchmark('fix/fields_first', () => {
|
|
267
263
|
const iterator = catalog.keys()[Symbol.iterator]()
|
|
268
264
|
const first = iterator.next().value
|
|
@@ -302,41 +298,41 @@ try {
|
|
|
302
298
|
copy.insert(empty)
|
|
303
299
|
return copy.remove('NewMessage')
|
|
304
300
|
})
|
|
305
|
-
benchmark('fix/numeric_group_parse', () => drain(
|
|
301
|
+
benchmark('fix/numeric_group_parse', () => drain(new fix.MarketMessages(catalogOptions).fromLines([Buffer.from('35=D|453=2|448=ONE|448=TWO|')])))
|
|
306
302
|
benchmark('fix/message_into_row', () => message.intoRow(order))
|
|
307
303
|
benchmark('fix/message_into_bytes', () => message.intoBytes(124))
|
|
308
304
|
benchmark('fix/message_set', () => parsed.clone().set(55, 'MSFT'))
|
|
309
305
|
benchmark('fix/message_remove', () => parsed.clone().remove(55))
|
|
310
|
-
benchmark('fix/message_from_row', () => fix.MarketMessage.fromRow(fixedSchema, parsedRow,
|
|
306
|
+
benchmark('fix/message_from_row', () => fix.MarketMessage.fromRow(fixedSchema, parsedRow, seedOptions))
|
|
311
307
|
benchmark('fix/message_into_text', () => message.intoText('|'))
|
|
312
308
|
benchmark('fix/identified_message_arrow', () =>
|
|
313
|
-
|
|
309
|
+
new fix.MarketMessages(seedOptions).fromItems([parsed]).intoArrowReader(fixedSchema).intoTable().numRows,
|
|
314
310
|
)
|
|
315
311
|
const streams = Math.max(1, Math.round(iterations / 50))
|
|
316
|
-
benchmarkStreams(`fix/parse_lines_drain/${LINES.length}`, streams, () => drain(
|
|
312
|
+
benchmarkStreams(`fix/parse_lines_drain/${LINES.length}`, streams, () => drain(new fix.MarketMessages(seedOptions).fromLines(LINES)))
|
|
317
313
|
benchmarkStreams(`fix/parse_text_lines_drain/${LINES.length}`, streams, () =>
|
|
318
|
-
drain(
|
|
314
|
+
drain(new fix.MarketMessages(seedOptions).fromTextLines(TEXT_LINES)),
|
|
319
315
|
)
|
|
320
316
|
benchmarkStreams(`fix/parse_text_lines_msgpluginid_drain/${LINES.length}`, streams, () =>
|
|
321
|
-
drain(
|
|
317
|
+
drain(new fix.MarketMessages(msgpluginidOptions).fromTextLines(MSGPLUGINID_LINES)),
|
|
322
318
|
)
|
|
323
319
|
benchmarkStreams(`fix/parse_text_arrow_reader/${LINES.length}`, streams, () =>
|
|
324
|
-
|
|
320
|
+
new fix.MarketMessages(seedOptions).fromTextArrowReader(capture).intoArrowReader().intoTable().numRows,
|
|
325
321
|
)
|
|
326
322
|
benchmarkStreams(`fix/lifecycle_drain/${LINES.length}`, streams, () =>
|
|
327
|
-
drain(
|
|
323
|
+
drain(new fix.MarketMessages(seedOptions).fromLines(LINES).intoLifecycle()),
|
|
328
324
|
)
|
|
329
325
|
benchmarkStreams(`fix/lifecycle_arrow_reader/${LINES.length}`, streams, () =>
|
|
330
|
-
|
|
326
|
+
new fix.MarketMessages(seedOptions).fromArrowReader(BatchReader.fromIpc(parsedIpc)).intoLifecycle().intoArrowReader().intoTable().numRows,
|
|
331
327
|
)
|
|
332
328
|
benchmarkStreams(`fix/messages_drain/${LINES.length}`, streams, () =>
|
|
333
|
-
drain(
|
|
329
|
+
drain(new fix.MarketMessages(seedOptions).fromArrowReader(BatchReader.fromIpc(parsedIpc))),
|
|
334
330
|
)
|
|
335
331
|
benchmarkStreams(`fix/arrow_reader_over_parse_lines/${LINES.length}`, streams, () =>
|
|
336
|
-
|
|
332
|
+
new fix.MarketMessages(seedOptions).fromLines(LINES).intoArrowReader(fixedSchema).intoTable().numRows,
|
|
337
333
|
)
|
|
338
334
|
benchmarkStreams(`fix/write_arrow_reader/${LINES.length}`, streams, () =>
|
|
339
|
-
|
|
335
|
+
new fix.MarketMessages(seedOptions).fromArrowReader(BatchReader.fromIpc(parsedIpc)).intoWriter(sink),
|
|
340
336
|
)
|
|
341
337
|
benchmarkLoad('fix/from_handle_seed', () => fix.FixRegistry.fromHandle(SEED))
|
|
342
338
|
benchmarkLoad(`fix/from_handle_${WIDE_FIELDS}_fields`, () =>
|
package/benchmarks/types.js
CHANGED
|
@@ -111,7 +111,7 @@ const figiScalar = figi.scalar('BBG000BLNQ16')
|
|
|
111
111
|
const side = DataType.from('side')
|
|
112
112
|
const sideScalar = side.scalar('BUY')
|
|
113
113
|
const kind = DataType.from('marketdatakind')
|
|
114
|
-
const kindScalar = kind.scalar('
|
|
114
|
+
const kindScalar = kind.scalar('OPER')
|
|
115
115
|
|
|
116
116
|
benchmark('version/native_parts', () => new Version(5, 0, 300))
|
|
117
117
|
benchmark('version/native_parse', () => Version.fromStr('5.0.300'))
|
|
@@ -131,8 +131,8 @@ benchmark('figi/scalar_as_js', () => figiScalar.asJs())
|
|
|
131
131
|
benchmark('side/member_lookup', () => Side.SELL)
|
|
132
132
|
benchmark('side/into_scalar', () => side.scalar('SELL'))
|
|
133
133
|
benchmark('side/scalar_as_js', () => sideScalar.asJs())
|
|
134
|
-
benchmark('marketdatakind/member_lookup', () => MarketDataKind.
|
|
135
|
-
benchmark('marketdatakind/into_scalar', () => kind.scalar('
|
|
134
|
+
benchmark('marketdatakind/member_lookup', () => MarketDataKind.OPER)
|
|
135
|
+
benchmark('marketdatakind/into_scalar', () => kind.scalar('OPER'))
|
|
136
136
|
benchmark('marketdatakind/scalar_as_js', () => kindScalar.asJs())
|
|
137
137
|
|
|
138
138
|
benchmark('schema/from_fields', () => DataType.fromFields([id, name]))
|
package/binding.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export {
|
|
2
|
+
ai,
|
|
3
|
+
distance,
|
|
2
4
|
Arn,
|
|
3
5
|
BatchReader,
|
|
4
6
|
CellRange,
|
|
@@ -64,6 +66,9 @@ export {
|
|
|
64
66
|
type FixDirection,
|
|
65
67
|
type FixEntryView,
|
|
66
68
|
type FixHeaderView,
|
|
69
|
+
type FixReport,
|
|
70
|
+
type FixReportParameter,
|
|
71
|
+
type FixRule,
|
|
67
72
|
type FixSourceOptions,
|
|
68
73
|
type FixSourceView,
|
|
69
74
|
type HttpContentRange,
|
|
@@ -107,6 +112,8 @@ import type {
|
|
|
107
112
|
Field,
|
|
108
113
|
FieldPath,
|
|
109
114
|
Filter,
|
|
115
|
+
FixReport,
|
|
116
|
+
FixRule,
|
|
110
117
|
IOBase,
|
|
111
118
|
IOCursor,
|
|
112
119
|
IOResult,
|
|
@@ -173,10 +180,11 @@ import {
|
|
|
173
180
|
Compaction,
|
|
174
181
|
DataFile,
|
|
175
182
|
MarketMessage,
|
|
176
|
-
|
|
183
|
+
MarketMessagesOptions,
|
|
177
184
|
FixRegistry,
|
|
178
|
-
|
|
185
|
+
MarketMessages,
|
|
179
186
|
MsgType,
|
|
187
|
+
Underlyings,
|
|
180
188
|
IcebergOptions,
|
|
181
189
|
ManifestFile,
|
|
182
190
|
PartitionField,
|
|
@@ -322,10 +330,11 @@ export type {
|
|
|
322
330
|
Compaction,
|
|
323
331
|
DataFile,
|
|
324
332
|
MarketMessage,
|
|
325
|
-
|
|
333
|
+
MarketMessagesOptions,
|
|
326
334
|
FixRegistry,
|
|
327
|
-
|
|
335
|
+
MarketMessages,
|
|
328
336
|
MsgType,
|
|
337
|
+
Underlyings,
|
|
329
338
|
IcebergOptions,
|
|
330
339
|
ManifestFile,
|
|
331
340
|
PartitionField,
|
|
@@ -847,6 +856,12 @@ declare module './index' {
|
|
|
847
856
|
interface Plan extends ArrowAppliers, RecordAppliers {
|
|
848
857
|
/** Return the structural document for JavaScript JSON serialization. */
|
|
849
858
|
toJSON(): unknown
|
|
859
|
+
/**
|
|
860
|
+
* This plan with every parameter it names - in every section and every
|
|
861
|
+
* plan it holds - replaced by the value the record holds for it; the
|
|
862
|
+
* record names exactly the plan's parameters, ASCII case-insensitively.
|
|
863
|
+
*/
|
|
864
|
+
bind(parameters?: Readonly<Record<string, unknown>> | Scalar | null): Plan
|
|
850
865
|
}
|
|
851
866
|
|
|
852
867
|
interface Expression extends ArrowAppliers, RecordAppliers {
|
|
@@ -887,6 +902,11 @@ declare module './index' {
|
|
|
887
902
|
* order, then the components and the groups.
|
|
888
903
|
*/
|
|
889
904
|
[Symbol.iterator](): Generator<Field>
|
|
905
|
+
/**
|
|
906
|
+
* The plugin dictionary's rows: one `Serie` under `fixPluginField()`,
|
|
907
|
+
* in id order - what a store keeps as `plugins.json`. A copy.
|
|
908
|
+
*/
|
|
909
|
+
plugins(): Serie
|
|
890
910
|
}
|
|
891
911
|
|
|
892
912
|
interface MarketMessage {
|
|
@@ -894,54 +914,49 @@ declare module './index' {
|
|
|
894
914
|
[Symbol.iterator](): IterableIterator<FixEntryView>
|
|
895
915
|
}
|
|
896
916
|
|
|
897
|
-
interface
|
|
917
|
+
interface MarketMessages extends IterableIterator<MarketMessage> {
|
|
898
918
|
next(): IteratorResult<MarketMessage>
|
|
899
|
-
}
|
|
900
|
-
interface FixCodec {
|
|
901
919
|
/**
|
|
902
|
-
*
|
|
903
|
-
*
|
|
920
|
+
* The messages a stream of captured lines states, pulled one line at a
|
|
921
|
+
* time as the stream is read: each line's format sniffed and its
|
|
922
|
+
* messages split and placed. A line that is not a row at all is passed
|
|
923
|
+
* over with a warning; a failure of the iterable ends the stream after
|
|
924
|
+
* the messages before it, and `next` throws it as itself.
|
|
904
925
|
*/
|
|
905
|
-
|
|
906
|
-
/** A stream of lines, pulled one at a time; each as `
|
|
907
|
-
|
|
926
|
+
fromLines(lines: Iterable<string | ArrayBufferLike | ArrayBufferView>): MarketMessages
|
|
927
|
+
/** A stream of decoded lines, pulled one at a time; each as `MarketMessage.fromTextLine` reads it. */
|
|
928
|
+
fromTextLines(lines: Iterable<TextLine>): MarketMessages
|
|
929
|
+
/** The messages in hand, pulled one at a time. */
|
|
930
|
+
fromItems(messages: Iterable<MarketMessage>): MarketMessages
|
|
908
931
|
/**
|
|
909
|
-
* The
|
|
910
|
-
*
|
|
911
|
-
*
|
|
912
|
-
* its market data kind and cross hash code - holds, through
|
|
913
|
-
* `withPrevious` (its `prevuuid`, `prevtransunix` and `prevstate`), and
|
|
914
|
-
* yielded only where its content code or state moved; a copy folds into
|
|
915
|
-
* the held version by content code. The capture is collected and sorted
|
|
916
|
-
* whole, unless `sortedLifecycle` states it arrives in instant order:
|
|
917
|
-
* then it is read as it comes, one epoch hour held at a time.
|
|
932
|
+
* The messages a stream of batches of rows holds, each row one message
|
|
933
|
+
* rebuilt with no line parsed again, under `field`, else the reader's
|
|
934
|
+
* own root. The source is whatever `BatchReader.from` accepts.
|
|
918
935
|
*/
|
|
919
|
-
|
|
936
|
+
fromArrowReader(source: BatchSource, field?: FieldLike | null): MarketMessages
|
|
937
|
+
/** A stream of batches of capture rows, each row read as a line, its own columns carried. */
|
|
938
|
+
fromTextArrowReader(source: BatchSource): MarketMessages
|
|
939
|
+
/** The stream as batches of rows under `field`, else under its own root. */
|
|
940
|
+
intoArrowReader(field?: FieldLike | null): BatchReader
|
|
941
|
+
/** The stream's messages as rows, a `Serie` read lazily, under `field`, else its own root. */
|
|
942
|
+
intoSerie(field?: FieldLike | null): Serie
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
interface Underlyings {
|
|
920
946
|
/**
|
|
921
|
-
*
|
|
922
|
-
*
|
|
923
|
-
*
|
|
947
|
+
* Every row the table holds now, in code order: the seed's and every
|
|
948
|
+
* row a parse given the table filled or created, under
|
|
949
|
+
* `fixUnderlyingField()`.
|
|
924
950
|
*/
|
|
925
|
-
|
|
951
|
+
rows(): Serie
|
|
926
952
|
/**
|
|
927
|
-
*
|
|
928
|
-
*
|
|
929
|
-
*
|
|
930
|
-
*
|
|
931
|
-
*
|
|
932
|
-
* message type, `MarketMessage.field()`, the message row, or any Struct
|
|
933
|
-
* root a caller built. Each column binds as a
|
|
934
|
-
* lookup binds its name, so a column the message does not state is
|
|
935
|
-
* null, and a message leaving a column that cannot be null empty is
|
|
936
|
-
* passed over with a warning.
|
|
953
|
+
* The one message search: `text` read against this table, the plugins
|
|
954
|
+
* of `options.registry` where one is given and the root `field` - any
|
|
955
|
+
* `FieldLike` - into one plan over the message rows, the window
|
|
956
|
+
* `[since, until)` on `markettimestamp` at the top, newest first; `null` for
|
|
957
|
+
* a blank text.
|
|
937
958
|
*/
|
|
938
|
-
|
|
939
|
-
/** The batch twins take whatever `BatchReader.from` accepts. */
|
|
940
|
-
parseTextArrowReader(source: BatchSource): BatchReader
|
|
941
|
-
lifecycleArrowReader(source: BatchSource): BatchReader
|
|
942
|
-
formatArrowReader(source: BatchSource, field: Field): BatchReader
|
|
943
|
-
messages(source: BatchSource): FixMessages
|
|
944
|
-
writeArrowReader(source: BatchSource, sink: { write(chunk: Uint8Array): unknown }): number
|
|
959
|
+
messageSearch(text: string, field: FieldLike, options?: MessageSearchOptions): Plan | null
|
|
945
960
|
}
|
|
946
961
|
|
|
947
962
|
interface Field {
|
|
@@ -3501,9 +3516,10 @@ export type StateName = keyof typeof State
|
|
|
3501
3516
|
/**
|
|
3502
3517
|
* What kind of market data an element is: FIX's MsgCat code set, each
|
|
3503
3518
|
* member's four-letter name under the `uint8` code a `marketdatakind`
|
|
3504
|
-
* column stores - an
|
|
3505
|
-
* trade `TRAD`, a book `BOOK`,
|
|
3506
|
-
* `TRDB`, and `UKNW` for a type the dictionary files
|
|
3519
|
+
* column stores - an operation `OPER` (an order, a quote or an execution,
|
|
3520
|
+
* which its `marketdatatype` tells apart), a trade `TRAD`, a book `BOOK`,
|
|
3521
|
+
* the batches `OPEB` and `TRDB`, and `UKNW` for a type the dictionary files
|
|
3522
|
+
* under none; the codes 8, 14, 23 and 24 name no member.
|
|
3507
3523
|
*/
|
|
3508
3524
|
export declare const MarketDataKind: Readonly<{
|
|
3509
3525
|
UKNW: 0
|
|
@@ -3514,13 +3530,11 @@ export declare const MarketDataKind: Readonly<{
|
|
|
3514
3530
|
COLL: 5
|
|
3515
3531
|
COMM: 6
|
|
3516
3532
|
CONF: 7
|
|
3517
|
-
EXEC: 8
|
|
3518
3533
|
MKST: 9
|
|
3519
|
-
|
|
3534
|
+
OPER: 10
|
|
3520
3535
|
PAYM: 11
|
|
3521
3536
|
POSN: 12
|
|
3522
3537
|
PRTY: 13
|
|
3523
|
-
QUOT: 14
|
|
3524
3538
|
REGI: 15
|
|
3525
3539
|
RISK: 16
|
|
3526
3540
|
SECU: 17
|
|
@@ -3528,9 +3542,7 @@ export declare const MarketDataKind: Readonly<{
|
|
|
3528
3542
|
SETL: 19
|
|
3529
3543
|
STRM: 20
|
|
3530
3544
|
TRAD: 21
|
|
3531
|
-
|
|
3532
|
-
QUOB: 23
|
|
3533
|
-
EXEB: 24
|
|
3545
|
+
OPEB: 22
|
|
3534
3546
|
TRDB: 25
|
|
3535
3547
|
}>
|
|
3536
3548
|
|
|
@@ -3805,29 +3817,29 @@ export declare const enums: {
|
|
|
3805
3817
|
/**
|
|
3806
3818
|
* The six element column names every generated schema opens with, in
|
|
3807
3819
|
* schema order: `uuid`, `crossuuid`, `crosscode`, `hashcode`,
|
|
3808
|
-
* `crosshashcode`, `
|
|
3820
|
+
* `crosshashcode`, `sourceuuids`.
|
|
3809
3821
|
*/
|
|
3810
3822
|
readonly elementColumns: readonly string[]
|
|
3811
3823
|
/**
|
|
3812
3824
|
* The ten event column names that follow them, in schema order:
|
|
3813
|
-
* `
|
|
3814
|
-
* `
|
|
3825
|
+
* `markettimestamp`, `creationtimestamp`, `technicaltimestamp`, `expirytimestamp`, `previousmarkettimestamp`,
|
|
3826
|
+
* `snapshottimestamp`, `sequencenumber`, `previousuuid`, `state`, `previousstate`.
|
|
3815
3827
|
*/
|
|
3816
3828
|
readonly eventColumns: readonly string[]
|
|
3817
3829
|
/**
|
|
3818
3830
|
* The forty-two market column names, in schema order:
|
|
3819
|
-
* `marketdatakind`, `marketdatatype`, `
|
|
3820
|
-
* `securityids`, `
|
|
3821
|
-
* `
|
|
3822
|
-
* `
|
|
3831
|
+
* `marketdatakind`, `marketdatatype`, `acknowledgement`, `conversationid`,
|
|
3832
|
+
* `securityids`, `cficode`, `mic`, `underlyingcode`, `underlyingcategory`, `side`, `quantity`,
|
|
3833
|
+
* `previousquantity`, `displayqty`, `hiddenqty`, `unitofmeasure`, `roundlot`, `currency`,
|
|
3834
|
+
* `origincurrency`, `price`, `previousprice`, `stoppx`, `strikeprice`, `lastexecutiontimestamp`,
|
|
3823
3835
|
* `lastpx`, `lastqty`, `avgpx`, `cumqty`, `leavesqty`, `cxlqty`,
|
|
3824
|
-
* `
|
|
3825
|
-
* `
|
|
3826
|
-
* `
|
|
3836
|
+
* `lastspotrate`, `lastforwardpoints`, `bidpx`, `bidsize`, `bidcurrency`, `offerpx`,
|
|
3837
|
+
* `offersize`, `offercurrency`, `bidspotrate`, `bidforwardpoints`, `offerspotrate`,
|
|
3838
|
+
* `offerforwardpoints`, `targetfxrates`.
|
|
3827
3839
|
*/
|
|
3828
3840
|
readonly marketColumns: readonly string[]
|
|
3829
3841
|
/**
|
|
3830
|
-
* The four operation column names, in schema order: `
|
|
3842
|
+
* The four operation column names, in schema order: `orderqty`,
|
|
3831
3843
|
* `timeinforce`, `tradable`, `identifiers`.
|
|
3832
3844
|
*/
|
|
3833
3845
|
readonly operationColumns: readonly string[]
|
|
@@ -4516,10 +4528,19 @@ declare module './index' {
|
|
|
4516
4528
|
streamBytes(batchSize?: number | null): ByteIterator
|
|
4517
4529
|
}
|
|
4518
4530
|
|
|
4519
|
-
/**
|
|
4520
|
-
|
|
4531
|
+
/**
|
|
4532
|
+
* Iterating a reader yields one Apache Arrow JS record batch at a time:
|
|
4533
|
+
* `for...of` pulls each on the calling thread, `for await` on the libuv
|
|
4534
|
+
* pool - one stream, read once by either.
|
|
4535
|
+
*/
|
|
4536
|
+
interface BatchReader extends Iterable<ArrowRecordBatch>, AsyncIterable<ArrowRecordBatch> {
|
|
4521
4537
|
/** Drain every remaining batch into one Apache Arrow JS table. */
|
|
4522
4538
|
intoTable(): ArrowTable
|
|
4539
|
+
/**
|
|
4540
|
+
* Each batch as its own Arrow IPC stream (schema, batch, end of stream),
|
|
4541
|
+
* pulled on the libuv pool, for a server to forward without decoding.
|
|
4542
|
+
*/
|
|
4543
|
+
ipcBatches(): AsyncIterableIterator<Buffer>
|
|
4523
4544
|
}
|
|
4524
4545
|
namespace BatchReader {
|
|
4525
4546
|
/** Build a reader from a reader, an Arrow JS value, or Arrow IPC bytes. */
|
|
@@ -5194,9 +5215,42 @@ export type FixValueInput =
|
|
|
5194
5215
|
* built by a factory, never by `new`.
|
|
5195
5216
|
*/
|
|
5196
5217
|
export interface MarketMessageStatic extends Function {
|
|
5218
|
+
/**
|
|
5219
|
+
* The one message a captured line states, its format sniffed, under
|
|
5220
|
+
* `options`, `MarketMessagesOptions.fromEnv()` when none are given. A
|
|
5221
|
+
* line stating no message, and a line carrying a second frame, throws:
|
|
5222
|
+
* `MarketMessages.fromLines` reads a line's every message.
|
|
5223
|
+
*/
|
|
5224
|
+
fromLine(
|
|
5225
|
+
row: string | ArrayBufferLike | ArrayBufferView,
|
|
5226
|
+
options?: MarketMessagesOptions | null,
|
|
5227
|
+
): MarketMessage
|
|
5228
|
+
/**
|
|
5229
|
+
* The one message a line a text reader answered states: its body and its
|
|
5230
|
+
* row-header captures, named by the options' `captureNames`.
|
|
5231
|
+
*/
|
|
5232
|
+
fromTextLine(line: TextLine, options?: MarketMessagesOptions | null): MarketMessage
|
|
5233
|
+
/** One numeric FIX frame, read by the pairs it states. */
|
|
5234
|
+
fromFixMessage(
|
|
5235
|
+
body: string | ArrayBufferLike | ArrayBufferView,
|
|
5236
|
+
options?: MarketMessagesOptions | null,
|
|
5237
|
+
): MarketMessage
|
|
5238
|
+
/** One bridge frame, whose keys are names rather than tags. */
|
|
5239
|
+
fromUllinkLine(
|
|
5240
|
+
body: string | ArrayBufferLike | ArrayBufferView,
|
|
5241
|
+
options?: MarketMessagesOptions | null,
|
|
5242
|
+
): MarketMessage
|
|
5243
|
+
/** One FIXML message, whose fields are XML attributes. */
|
|
5244
|
+
fromFixmlMessage(
|
|
5245
|
+
body: string | ArrayBufferLike | ArrayBufferView,
|
|
5246
|
+
options?: MarketMessagesOptions | null,
|
|
5247
|
+
): MarketMessage
|
|
5248
|
+
/** Pairs a caller already holds, in the order they arrived. */
|
|
5249
|
+
fromPairs(pairs: Array<[string, string]>, options?: MarketMessagesOptions | null): MarketMessage
|
|
5197
5250
|
/**
|
|
5198
5251
|
* A FIX record - a struct root and its row - read as the parse reads one,
|
|
5199
|
-
* under
|
|
5252
|
+
* under `options`, `MarketMessagesOptions.fromEnv()` when none are given.
|
|
5253
|
+
* A child stating
|
|
5200
5254
|
* a typed fact - one of the FIX fields a message lifts, a crate column -
|
|
5201
5255
|
* fills the fact that owns it and keeps its statement at its place;
|
|
5202
5256
|
* `SendingTime` reads the Unix epoch when the value states none, and the
|
|
@@ -5205,19 +5259,20 @@ export interface MarketMessageStatic extends Function {
|
|
|
5205
5259
|
fromFixRecord(
|
|
5206
5260
|
field: Field,
|
|
5207
5261
|
value: FixValueInput,
|
|
5208
|
-
|
|
5262
|
+
options?: MarketMessagesOptions | null,
|
|
5209
5263
|
): MarketMessage
|
|
5210
5264
|
/**
|
|
5211
5265
|
* The message a row holds: the inverse of `intoRow`, each column bound as
|
|
5212
5266
|
* a lookup binds its name and the residual `entries` restored without a
|
|
5213
5267
|
* parse. No clock is read, and a supplied row identity is retained.
|
|
5214
5268
|
*/
|
|
5215
|
-
fromRow(schema: Field, row: FixValueInput,
|
|
5269
|
+
fromRow(schema: Field, row: FixValueInput, options?: MarketMessagesOptions | null): MarketMessage
|
|
5216
5270
|
/**
|
|
5217
5271
|
* The one message row, `fixmsg`: the element, event, market, operation,
|
|
5218
5272
|
* source and session columns, the `trdregtimestamps` and `parties`
|
|
5219
|
-
* holders,
|
|
5220
|
-
*
|
|
5273
|
+
* holders, then `metadata` and `entries` - every stated entry no column
|
|
5274
|
+
* of the row holds, an identifier's statement among them, keyed
|
|
5275
|
+
* `tag:name` in lower case.
|
|
5221
5276
|
*/
|
|
5222
5277
|
field(): Field
|
|
5223
5278
|
readonly prototype: MarketMessage
|
|
@@ -5229,7 +5284,7 @@ export interface Fix {
|
|
|
5229
5284
|
* The row header a ULBridge log writes in front of every line, as a
|
|
5230
5285
|
* `rowheader` for a text read. Its clock is `mtime`, so the header dates
|
|
5231
5286
|
* each line it matches: the capture is consumed into the line's
|
|
5232
|
-
* `
|
|
5287
|
+
* `markettimestamp` - the `technicaltimestamp` of its messages and the sending clock of one
|
|
5233
5288
|
* stating no `SendingTime(52)` - read at nanoseconds UTC under the text
|
|
5234
5289
|
* options' `timezone`, never the file's modification time. The other
|
|
5235
5290
|
* captures are `msgthreadid`, `msgeventkey` - the bracket's session,
|
|
@@ -5260,18 +5315,37 @@ export interface Fix {
|
|
|
5260
5315
|
*/
|
|
5261
5316
|
readonly MarketMessage: MarketMessageStatic
|
|
5262
5317
|
/**
|
|
5263
|
-
*
|
|
5264
|
-
*
|
|
5265
|
-
* codec, a stage is a call.
|
|
5318
|
+
* The options a message stream reads under: one dictionary and every pin
|
|
5319
|
+
* a parse, a walk and a sink read. They hold no stream.
|
|
5266
5320
|
*/
|
|
5267
|
-
readonly
|
|
5321
|
+
readonly MarketMessagesOptions: typeof MarketMessagesOptions
|
|
5268
5322
|
/**
|
|
5269
5323
|
* Immutable registry-owned message definitions; `identifierValues` returns
|
|
5270
5324
|
* independent mutable declaration Fields beside native Scalar values.
|
|
5271
5325
|
*/
|
|
5272
5326
|
readonly MsgType: abstract new () => MsgType
|
|
5273
|
-
/**
|
|
5274
|
-
|
|
5327
|
+
/**
|
|
5328
|
+
* The handler over a stream of messages: `new MarketMessages(options?)`
|
|
5329
|
+
* is idle; a source (`fromLines`, `fromTextLines`, `fromItems`,
|
|
5330
|
+
* `fromArrowReader`, `fromTextArrowReader`) answers a new handler over its
|
|
5331
|
+
* stream, a stage (`intoLifecycle`, `intoLineage`) the handler over what
|
|
5332
|
+
* it makes of it, and a sink (`intoArrowReader`, `intoSerie`,
|
|
5333
|
+
* `intoWriter`) drains it.
|
|
5334
|
+
*/
|
|
5335
|
+
readonly MarketMessages: typeof MarketMessages
|
|
5336
|
+
/**
|
|
5337
|
+
* The table of underlyings, its essential doors: `Underlyings.seeded()`,
|
|
5338
|
+
* `get(code)` - a code, an instrument key, an index key `{key}={value}` or
|
|
5339
|
+
* a bare identity value, a one-row `Serie`, else `null` -
|
|
5340
|
+
* `search(text, limit = 20)` - the rows a text names, strongest first,
|
|
5341
|
+
* each once: the exact code, an identifier the key index answers (an ISIN,
|
|
5342
|
+
* a FIGI, a RIC, a Bloomberg code, `{ticker}@{MIC}`, `{MIC}:{ticker}`, a
|
|
5343
|
+
* currency pair in any spelling), then a ticker, a name or an alias,
|
|
5344
|
+
* exact, prefix, substring - as a `Serie` under `underlyingField()`,
|
|
5345
|
+
* `messageSearch(text, field, { registry, limit = 20, since, until })` -
|
|
5346
|
+
* the one plan over message rows a text names - and `length`.
|
|
5347
|
+
*/
|
|
5348
|
+
readonly Underlyings: { seeded(): Underlyings; readonly prototype: Underlyings }
|
|
5275
5349
|
/**
|
|
5276
5350
|
* The crate's own definitions in tag order, above every tag FIX or a
|
|
5277
5351
|
* venue publishes: the event's instants, the identities, the cross code
|
|
@@ -5287,18 +5361,41 @@ export interface Fix {
|
|
|
5287
5361
|
crateFields(): Field[]
|
|
5288
5362
|
/**
|
|
5289
5363
|
* The row an `Underlyings` table stores, `underlying`: one instrument on
|
|
5290
|
-
* one market or across every market, partitioned by `
|
|
5291
|
-
* by `code`.
|
|
5364
|
+
* one market or across every market, partitioned by `months(endtimestamp)` - no
|
|
5365
|
+
* column of its own, a row with no end in the null partition - and sorted by `code`.
|
|
5292
5366
|
*/
|
|
5293
5367
|
underlyingField(): Field
|
|
5368
|
+
/**
|
|
5369
|
+
* The row a FIX dictionary is laid out as, `fixdefinition`: one per scalar
|
|
5370
|
+
* field, named definition, code set and source, and one for the plugin
|
|
5371
|
+
* dictionary, keyed by `category`, `tag` and `name`.
|
|
5372
|
+
*/
|
|
5373
|
+
registryField(): Field
|
|
5294
5374
|
/** The row of the ISO 10383 register, `mic`: one market identifier code ever assigned, sorted by `mic`. */
|
|
5295
5375
|
micEntryField(): Field
|
|
5296
5376
|
/** The row of GLEIF's register, `legalentity`: one LEI's Level 1 record with its parents, partitioned by `country`. */
|
|
5297
5377
|
legalEntityField(): Field
|
|
5298
|
-
/** The row a rate table stores, `fxrate`: the element and event columns, `buy`, `sell
|
|
5378
|
+
/** The row a rate table stores, `fxrate`: the element and event columns, `buy`, `sell` and `rate`, partitioned by `months(markettimestamp)`. */
|
|
5299
5379
|
fxRateField(): Field
|
|
5300
5380
|
/** The row of the plugin dictionary, `plugin`: one plugin a bridge logs through, its `side` the side kind's code. */
|
|
5301
5381
|
pluginField(): Field
|
|
5382
|
+
/**
|
|
5383
|
+
* Every audit report `yggio_market::reports` lists, in the order a page
|
|
5384
|
+
* lists them - `otr`, `cancels`, `rate`, `concentration`, `execution`,
|
|
5385
|
+
* `completeness`, `trail` - each a fresh plain object: its `name`,
|
|
5386
|
+
* `title`, `description`, the `plan` naming no location, which the
|
|
5387
|
+
* engine opens over the table it is asked of, and the `parameters` it
|
|
5388
|
+
* binds, each `default` absent where the caller states the value.
|
|
5389
|
+
*/
|
|
5390
|
+
reports(): FixReport[]
|
|
5391
|
+
/**
|
|
5392
|
+
* Every rule the crate applies to a FIX message, in the order
|
|
5393
|
+
* `yggio_market::fix::rules` lists them, each a fresh plain object: its
|
|
5394
|
+
* `id`, `class`, `authority` (`spec` or `crate`) and the `reference` it
|
|
5395
|
+
* names, the `sources` it reads and `targets` it fills as tags, and an
|
|
5396
|
+
* `example` FIX line, `""` where none is kept.
|
|
5397
|
+
*/
|
|
5398
|
+
rules(): FixRule[]
|
|
5302
5399
|
}
|
|
5303
5400
|
|
|
5304
5401
|
export declare const fix: Fix
|