feat(research): run trusted SMA strategies through native workers
This commit is contained in:
parent
4f6e44a853
commit
ca5abdde0e
16 changed files with 1682 additions and 28 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { z } from 'zod';
|
||||
import { replayTraceSchema } from '../contracts/native-replay';
|
||||
import { strategyReplayRequestSchema } from '../contracts/strategy-replay';
|
||||
import { BacktestConfigSchema } from '../types';
|
||||
|
||||
const finite = z.number().finite();
|
||||
|
|
@ -21,7 +22,11 @@ const legacyRequestSchema = z.object({
|
|||
),
|
||||
});
|
||||
|
||||
export const nativeWorkerRequestSchema = z.union([legacyRequestSchema, replayTraceSchema]);
|
||||
export const nativeWorkerRequestSchema = z.union([
|
||||
legacyRequestSchema,
|
||||
replayTraceSchema,
|
||||
strategyReplayRequestSchema,
|
||||
]);
|
||||
|
||||
export const nativeWorkerMessageSchema = z.discriminatedUnion('type', [
|
||||
z.object({ type: z.literal('progress'), progress: finite.min(0).max(100), message: z.string() }),
|
||||
|
|
@ -29,5 +34,5 @@ export const nativeWorkerMessageSchema = z.discriminatedUnion('type', [
|
|||
z.object({ type: z.literal('error'), message: z.string() }),
|
||||
]);
|
||||
|
||||
export type NativeWorkerRequest = z.infer<typeof nativeWorkerRequestSchema>;
|
||||
export type NativeWorkerRequest = z.input<typeof nativeWorkerRequestSchema>;
|
||||
export type NativeWorkerMessage = z.infer<typeof nativeWorkerMessageSchema>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue