@adaptic/utils 0.0.985 → 0.0.986
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/dist/index.cjs +24 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -1
- package/dist/types/trading-policy/defaults/default-trading-policy.d.ts.map +1 -1
- package/dist/types/trading-policy/schemas/effective-policy.schema.d.ts +24 -0
- package/dist/types/trading-policy/schemas/effective-policy.schema.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-trading-policy.d.ts","sourceRoot":"","sources":["../../../../src/trading-policy/defaults/default-trading-policy.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"default-trading-policy.d.ts","sourceRoot":"","sources":["../../../../src/trading-policy/defaults/default-trading-policy.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,EAAE,sBAwDjC,CAAC"}
|
|
@@ -32,6 +32,26 @@ export declare const EffectiveTradingPolicySchema: z.ZodObject<{
|
|
|
32
32
|
perTradeEquityAllocationPct: z.ZodNumber;
|
|
33
33
|
/** Percentage of the crypto allocation slice of account equity allocated per crypto trade. Canonical replacement for legacy AlpacaAccount.cryptoTradeAllocationPct. */
|
|
34
34
|
perTradeCryptoAllocationPct: z.ZodNumber;
|
|
35
|
+
/**
|
|
36
|
+
* Wash-trade cooldown period in milliseconds for equities. Defines the
|
|
37
|
+
* minimum elapsed time between opposing-side fills on the same symbol per
|
|
38
|
+
* FINRA Rule 5210, mirroring the 30s default already enforced for crypto.
|
|
39
|
+
* Mirrors `TradingPolicy.equityWashTradeCooldownMs` in backend-legacy.
|
|
40
|
+
* Optional so that legacy snapshots that pre-date this field continue to
|
|
41
|
+
* parse cleanly; consumers should fall back to a 30_000ms static default
|
|
42
|
+
* when undefined.
|
|
43
|
+
*/
|
|
44
|
+
equityWashTradeCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
/**
|
|
46
|
+
* Maximum daily portfolio loss as a fraction of account equity, evaluated
|
|
47
|
+
* intraday from the broker's `equity` vs `last_equity` delta. Breach
|
|
48
|
+
* activates a 24h `BLOCK_NEW_OPENS` halt per Reg-T daily-loss-limit
|
|
49
|
+
* controls. Optional so legacy snapshots parse cleanly; consumers
|
|
50
|
+
* should fall back to the static default in `defaultRiskConfig.dailyLossLimits.maxDailyLossPercent`
|
|
51
|
+
* (3%) when undefined. Range constrained to [0, 1) — a 100% daily-loss
|
|
52
|
+
* threshold would be nonsensical.
|
|
53
|
+
*/
|
|
54
|
+
maxDailyLossPercent: z.ZodOptional<z.ZodNumber>;
|
|
35
55
|
macroOverlayEnabled: z.ZodBoolean;
|
|
36
56
|
sectorOverlayEnabled: z.ZodBoolean;
|
|
37
57
|
volatilityOverlayEnabled: z.ZodBoolean;
|
|
@@ -1349,6 +1369,8 @@ export declare const EffectiveTradingPolicySchema: z.ZodObject<{
|
|
|
1349
1369
|
newsEventRiskOverlayEnabled: boolean;
|
|
1350
1370
|
exchangeHealthOverlayEnabled: boolean;
|
|
1351
1371
|
dataQualitySentinelEnabled: boolean;
|
|
1372
|
+
equityWashTradeCooldownMs?: number | undefined;
|
|
1373
|
+
maxDailyLossPercent?: number | undefined;
|
|
1352
1374
|
}, {
|
|
1353
1375
|
maxLeverage: number;
|
|
1354
1376
|
perTradeCryptoAllocationPct: number;
|
|
@@ -1673,6 +1695,8 @@ export declare const EffectiveTradingPolicySchema: z.ZodObject<{
|
|
|
1673
1695
|
retainDecisionArtifactsDays?: number | undefined;
|
|
1674
1696
|
tradeConfirmEmail?: "all" | "none" | undefined;
|
|
1675
1697
|
} | undefined;
|
|
1698
|
+
equityWashTradeCooldownMs?: number | undefined;
|
|
1699
|
+
maxDailyLossPercent?: number | undefined;
|
|
1676
1700
|
}>;
|
|
1677
1701
|
/** Inferred TypeScript type for a fully-resolved effective trading policy. */
|
|
1678
1702
|
export type EffectiveTradingPolicy = z.infer<typeof EffectiveTradingPolicySchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effective-policy.schema.d.ts","sourceRoot":"","sources":["../../../../src/trading-policy/schemas/effective-policy.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAYrD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;IAuBvC,oJAAoJ;;IAEpJ,uKAAuK
|
|
1
|
+
{"version":3,"file":"effective-policy.schema.d.ts","sourceRoot":"","sources":["../../../../src/trading-policy/schemas/effective-policy.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAYrD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;IAuBvC,oJAAoJ;;IAEpJ,uKAAuK;;IAEvK;;;;;;;;OAQG;;IAEH;;;;;;;;OAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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