@senpi/runtime 3.0.243 → 3.0.244
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/integrity-manifest.json +25 -21
- package/dist/runtime/pending-opens-ledger.d.ts +29 -4
- package/dist/runtime/pending-opens-ledger.d.ts.map +1 -1
- package/dist/runtime/pending-opens-ledger.js +38 -12
- package/dist/runtime/pending-opens-ledger.js.map +1 -1
- package/dist/runtime/resting-entry-cancel.d.ts +41 -0
- package/dist/runtime/resting-entry-cancel.d.ts.map +1 -0
- package/dist/runtime/resting-entry-cancel.js +148 -0
- package/dist/runtime/resting-entry-cancel.js.map +1 -0
- package/dist/runtime/runtime.d.ts +8 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +36 -0
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/senpi/client.d.ts +7 -1
- package/dist/senpi/client.d.ts.map +1 -1
- package/dist/senpi/client.js +39 -1
- package/dist/senpi/client.js.map +1 -1
- package/dist/senpi/index.d.ts +1 -1
- package/dist/senpi/index.d.ts.map +1 -1
- package/dist/senpi/types.d.ts +13 -0
- package/dist/senpi/types.d.ts.map +1 -1
- package/dist/utils/event-catalog.d.ts +17 -0
- package/dist/utils/event-catalog.d.ts.map +1 -1
- package/dist/utils/event-catalog.js +5 -0
- package/dist/utils/event-catalog.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -934,10 +934,10 @@
|
|
|
934
934
|
"dist/runtime/parse-interval.d.ts.map": "5db0181bec37fe364b9bb219ea127f82e52b7dd9c413f4416db1cce65ad8027e",
|
|
935
935
|
"dist/runtime/parse-interval.js": "41847bc402fd554af39026314c89025ab2b68c956bd553be1fc33479a46cb225",
|
|
936
936
|
"dist/runtime/parse-interval.js.map": "83c8e8bfa6b88c91c195e12ba20aabb578031b3c207962de0b3fb8470f103c5f",
|
|
937
|
-
"dist/runtime/pending-opens-ledger.d.ts": "
|
|
938
|
-
"dist/runtime/pending-opens-ledger.d.ts.map": "
|
|
939
|
-
"dist/runtime/pending-opens-ledger.js": "
|
|
940
|
-
"dist/runtime/pending-opens-ledger.js.map": "
|
|
937
|
+
"dist/runtime/pending-opens-ledger.d.ts": "12c0cccdd33f71054a01c39dee68edf12277433ccfae3a71d6e2eec8fced7f2b",
|
|
938
|
+
"dist/runtime/pending-opens-ledger.d.ts.map": "04635e56c5f3ee8018d2ffec18b5205bd21b1d9cb57f1f8de10a1a990966be5c",
|
|
939
|
+
"dist/runtime/pending-opens-ledger.js": "8d7def0978302ff1c903a2aedae46d7b6dc3eb65f1476c053c4b761cb42d4fc2",
|
|
940
|
+
"dist/runtime/pending-opens-ledger.js.map": "f20d551062038957099f656245cc88e84d6b67f315ad38404ea655005467f06b",
|
|
941
941
|
"dist/runtime/position-id-registry.d.ts": "7062aaadb44078878157acbf6da65d4201c7d560674cde4b327f5bb2704e00ef",
|
|
942
942
|
"dist/runtime/position-id-registry.d.ts.map": "c95e08df76ec594a70de6fa25b36c8b133ba589d609360028a8b4a3bdf3844ba",
|
|
943
943
|
"dist/runtime/position-id-registry.js": "ae4bf329a65cd8e7067b31877d82eeece12493f80e6effdedb3535501e1d2235",
|
|
@@ -970,6 +970,10 @@
|
|
|
970
970
|
"dist/runtime/reconcile-state.d.ts.map": "65f47ad1d9b3128adfdf262e67c65664a5620df0145b308bf9e411650ddd9aac",
|
|
971
971
|
"dist/runtime/reconcile-state.js": "dcf95e7fbde99e75d417a2df0ddd35683075551f0da610097b8d015c29c5240c",
|
|
972
972
|
"dist/runtime/reconcile-state.js.map": "93a0e96c270d7a95b6e7c03495e392413ba7c305dd093188ac6580a9f368bd73",
|
|
973
|
+
"dist/runtime/resting-entry-cancel.d.ts": "5067d57c224340b1906b92fb57e3dbb5904cf6c556836a84cd59fb76bd353446",
|
|
974
|
+
"dist/runtime/resting-entry-cancel.d.ts.map": "1c60f1f5bb96617e4d437de3847cafb66c8b65c5271608adc18318dacfe83833",
|
|
975
|
+
"dist/runtime/resting-entry-cancel.js": "cee99f4f4780617db09520e23b19542513fb8b8bb1ea9f137348c266b1651652",
|
|
976
|
+
"dist/runtime/resting-entry-cancel.js.map": "9d80dbaa5e501799b52fecc50ab0a5af8e01b0ce7a832003b2833587bacae3e6",
|
|
973
977
|
"dist/runtime/risk-guard.d.ts": "e5f89479971d90fb011ade5389a6a1a2c65e4685380659c0d0f68dc84385ade4",
|
|
974
978
|
"dist/runtime/risk-guard.d.ts.map": "c24b151e2c067787cc95fcad026f4480bfec946eddbdf0e50ac7d9aa7fea0f8f",
|
|
975
979
|
"dist/runtime/risk-guard.js": "9a01f6f5ac594c4d85f1dcb12ee7a2085fe295fd64d1826f97bddece2cd1482a",
|
|
@@ -994,10 +998,10 @@
|
|
|
994
998
|
"dist/runtime/runtime-version.d.ts.map": "2646400bd507a9c70da607215d137573ec4458936abe353eadc21fc1e7c55abf",
|
|
995
999
|
"dist/runtime/runtime-version.js": "fefbb0364e36e7d77a154e7fe87c09ebd6a77b9dfaec42cc585986de9a20fa33",
|
|
996
1000
|
"dist/runtime/runtime-version.js.map": "dc54d4f1c6df38761155149237513dee5556cda7cfc038ffacee27cec37d46cb",
|
|
997
|
-
"dist/runtime/runtime.d.ts": "
|
|
998
|
-
"dist/runtime/runtime.d.ts.map": "
|
|
999
|
-
"dist/runtime/runtime.js": "
|
|
1000
|
-
"dist/runtime/runtime.js.map": "
|
|
1001
|
+
"dist/runtime/runtime.d.ts": "96ab8873471562b69b49cceaf5644263801801c97c1d15d20999c362e43a4df8",
|
|
1002
|
+
"dist/runtime/runtime.d.ts.map": "7281f03382995011d11b763179ccd064575175b2d7b60d6583ea6b89df1e51b2",
|
|
1003
|
+
"dist/runtime/runtime.js": "c8963ab4d4e772e26e39d5aae1ac19c6b2faefbc76ca36caeb80bcc1b28c0211",
|
|
1004
|
+
"dist/runtime/runtime.js.map": "4c888944bd76c938e297786bb3c0a4bc553152f5fb0649e8870a06d90a693ef6",
|
|
1001
1005
|
"dist/runtime/scanner-composition.d.ts": "ead28210fd7b563611170c6c08d077e19a389edb82ad9fe4a3b7e1433fbaa185",
|
|
1002
1006
|
"dist/runtime/scanner-composition.d.ts.map": "443e3fb78319fa7c56636b96cf49f4e421b09586c3d66f4c3217f8a25a307e0b",
|
|
1003
1007
|
"dist/runtime/scanner-composition.js": "8b1d23380a1ca907476e61657ee09f15744cab58fcb575f9767b9b18f55ebf8b",
|
|
@@ -1312,16 +1316,16 @@
|
|
|
1312
1316
|
"dist/senpi/__tests__/helpers/fake-simulation-mcp.d.ts.map": "501d24f809723a1d4c14e220e4edc7c5f213945efed9f14881d6880c43bbecd7",
|
|
1313
1317
|
"dist/senpi/__tests__/helpers/fake-simulation-mcp.js": "62c7eb0f0d2ffa2ee83205ccaf35536ead39b89adcb5f95a1a894ca24177910a",
|
|
1314
1318
|
"dist/senpi/__tests__/helpers/fake-simulation-mcp.js.map": "e2f82c05dc94590333d6dd558c8edc0522473daab4cf5bc55cf8722d201fd1d9",
|
|
1315
|
-
"dist/senpi/client.d.ts": "
|
|
1316
|
-
"dist/senpi/client.d.ts.map": "
|
|
1317
|
-
"dist/senpi/client.js": "
|
|
1318
|
-
"dist/senpi/client.js.map": "
|
|
1319
|
+
"dist/senpi/client.d.ts": "b33c4a5c5f2193ef7a3c7989a91afe89d743251bd98424f557475f973edfae36",
|
|
1320
|
+
"dist/senpi/client.d.ts.map": "71237e725fd2b06366e405fe58cc509c2ea2f19a3b3b69039d4bc000f3564221",
|
|
1321
|
+
"dist/senpi/client.js": "28f130fe52484cd1be28e96871b76c17f8ae113cd69197ddf54f59ab26b036a3",
|
|
1322
|
+
"dist/senpi/client.js.map": "8158214a6b8dd39a8fe74952cf4be05e978eb449d39fcd080a9e19a82d030177",
|
|
1319
1323
|
"dist/senpi/constants.d.ts": "e37360cfe354470fdf945a620d3bd800e1f9c9ecced137b3746c79f1cca4db21",
|
|
1320
1324
|
"dist/senpi/constants.d.ts.map": "57b9949c97061bbff1b93af701180614bd4888dd041efc900cc01d28ae4085d2",
|
|
1321
1325
|
"dist/senpi/constants.js": "d5b1cc1e6b1a09687d076aeec023e17a288debb4fc5a83e7fdc49cc4ea0c3cfc",
|
|
1322
1326
|
"dist/senpi/constants.js.map": "7eaba24071837239df95d0c2cae7a77e9871310caa553e75808baf19a9d36ae5",
|
|
1323
|
-
"dist/senpi/index.d.ts": "
|
|
1324
|
-
"dist/senpi/index.d.ts.map": "
|
|
1327
|
+
"dist/senpi/index.d.ts": "11967e8724f390d8c07471179dd6e4bd5054432ce9ca498307594f394dfdd7c8",
|
|
1328
|
+
"dist/senpi/index.d.ts.map": "aedb1bac15364e9bd9607b7a6921e6b3ae0d09829f9b777291356e256ea728d9",
|
|
1325
1329
|
"dist/senpi/index.js": "c03d7dfc7a6cbc32421df2da0fc6697efff16e66064fdf3e04a312a0e6dab291",
|
|
1326
1330
|
"dist/senpi/index.js.map": "03e2f7dd5185f6fac06050d4fc4cf82cf515d1d96fbc07e4768a02347b714718",
|
|
1327
1331
|
"dist/senpi/simulation.d.ts": "96512eea65a7c7dc29b6de5670129fc05124a5cd232ffb8358398e4b1d6784c6",
|
|
@@ -1336,8 +1340,8 @@
|
|
|
1336
1340
|
"dist/senpi/tool-errors.d.ts.map": "74cea973b34bd8d2e5689e32f4a02eae1f2705577d42f7d019512fc0f9f68393",
|
|
1337
1341
|
"dist/senpi/tool-errors.js": "16bd4bf6fc0de64e36f94766e2bd537df00c86bd9b9fbc9c20fdaf685ddff790",
|
|
1338
1342
|
"dist/senpi/tool-errors.js.map": "eb0fcd23fd1538dcf5322e2058b29ddd30d0e0b4f359b87a61d15542532893ad",
|
|
1339
|
-
"dist/senpi/types.d.ts": "
|
|
1340
|
-
"dist/senpi/types.d.ts.map": "
|
|
1343
|
+
"dist/senpi/types.d.ts": "1cea0d49677d3582d9cf24f592e9985eb7f8675c2ef185127ca1f642637f9fe2",
|
|
1344
|
+
"dist/senpi/types.d.ts.map": "56e1738daa6f232fde7653e61aa2785d148f699f7a122f137e2a71dda7d9f626",
|
|
1341
1345
|
"dist/senpi/types.js": "01ae2a5b120382f9a648ced7ee8507493a134f216d100fc61600c6c9738235d2",
|
|
1342
1346
|
"dist/senpi/types.js.map": "559745a28518645d68c937240fa4d890936086950cd1aaf0cb268c5afcc616f4",
|
|
1343
1347
|
"dist/skill-router/catalog.d.ts": "2f99c03e8907469966233d1dedaf48c87d159093a36cb9368e58128b313840e2",
|
|
@@ -1589,10 +1593,10 @@
|
|
|
1589
1593
|
"dist/utils/clearing-house-staleness.d.ts.map": "7a9d5deb50d37c2ad901cced20bdef02754fc652afd16935ee2f5e40292aba37",
|
|
1590
1594
|
"dist/utils/clearing-house-staleness.js": "9612955070f84ce9d9f09f83ec7baf8bd51ac54a2f32f42fa02fcca9c14e89bc",
|
|
1591
1595
|
"dist/utils/clearing-house-staleness.js.map": "5022eb6e1211b7a1f192af0c9703326b68e62f37436329ca710149230fb4c7b9",
|
|
1592
|
-
"dist/utils/event-catalog.d.ts": "
|
|
1593
|
-
"dist/utils/event-catalog.d.ts.map": "
|
|
1594
|
-
"dist/utils/event-catalog.js": "
|
|
1595
|
-
"dist/utils/event-catalog.js.map": "
|
|
1596
|
+
"dist/utils/event-catalog.d.ts": "ba6956f4d7897cee8ec8d22036e4c20720df24de9ef5e44834abcf7ba6903386",
|
|
1597
|
+
"dist/utils/event-catalog.d.ts.map": "f8714a599dddf26968ab11e56db6443219b750a823cab90b9d2a5075bde2c035",
|
|
1598
|
+
"dist/utils/event-catalog.js": "7ba2515de758e44ce60c8d009ad90a3a9924c02cf62aee73ff8a7efe75450f74",
|
|
1599
|
+
"dist/utils/event-catalog.js.map": "3e3b24c9d9390a486e2180e82de71fe307d6f1078f6201f0f60a6d92f9830d5b",
|
|
1596
1600
|
"dist/utils/keyed-mutex.d.ts": "0f7b21d5d90366669a83ab5aa5946767f97a984fb3661bfa0bc93f18efdbaf03",
|
|
1597
1601
|
"dist/utils/keyed-mutex.d.ts.map": "bd7fec3be0d45c963942df2ebf05d214192c36e263c62d2ab4b05655f9d470c3",
|
|
1598
1602
|
"dist/utils/keyed-mutex.js": "5e173b70d410c51b8d445c627054518f85145a0969414bb9004b1c424227d90f",
|
|
@@ -1749,6 +1753,6 @@
|
|
|
1749
1753
|
"dist/widgets/widgets/quant-desk-recommendations.d.ts.map": "410c41d3d2b37a1d8329aa888424f920424cc3afa1abd6acc64989093cbba24a",
|
|
1750
1754
|
"dist/widgets/widgets/quant-desk-recommendations.js": "91018c50913ace64ca1941c22e3de17549130a3370132b7f2ccc0477ee6d2aa0",
|
|
1751
1755
|
"dist/widgets/widgets/quant-desk-recommendations.js.map": "80b24b605271cff9acd56800f7c098c2335136e5362055c349e622b8751714c2",
|
|
1752
|
-
"openclaw.plugin.json": "
|
|
1756
|
+
"openclaw.plugin.json": "9f9c2d2feb889a216edca8837c3d2dab60f3800a12c40f5f698a80f3ce9ef8aa"
|
|
1753
1757
|
}
|
|
1754
1758
|
}
|
|
@@ -35,6 +35,14 @@ import type { OpenPosition } from "../types/strategy.js";
|
|
|
35
35
|
* (the provisional kind a reservation starts as, before `createPosition` returns).
|
|
36
36
|
*/
|
|
37
37
|
export type PendingOpenKind = "filled" | "resting" | "ambiguous";
|
|
38
|
+
/**
|
|
39
|
+
* - `open` — counting on its kind's TTL.
|
|
40
|
+
* - `cancelDue` — a resting entry past its TTL whose order the runtime must cancel. It keeps
|
|
41
|
+
* counting until {@link PendingOpensLedger.resolveCancel} settles what happened to the order.
|
|
42
|
+
*/
|
|
43
|
+
export type PendingOpenState = "open" | "cancelDue";
|
|
44
|
+
/** What the cancel sweep learned about a `cancelDue` entry's order. */
|
|
45
|
+
export type CancelOutcome = "cancelled" | "not_open" | "failed";
|
|
38
46
|
/** One submitted-but-unconfirmed open. */
|
|
39
47
|
export interface PendingOpenEntry {
|
|
40
48
|
/** Normalized `coin|dex` key — the same key a snapshot row reduces to. */
|
|
@@ -44,6 +52,7 @@ export interface PendingOpenEntry {
|
|
|
44
52
|
/** Margin the submit committed, subtracted from the free-margin budget while unseen. */
|
|
45
53
|
readonly marginAmount: number;
|
|
46
54
|
readonly kind: PendingOpenKind;
|
|
55
|
+
readonly state: PendingOpenState;
|
|
47
56
|
/** When the entry last changed kind (the TTL clock). */
|
|
48
57
|
readonly ts: number;
|
|
49
58
|
/**
|
|
@@ -91,12 +100,17 @@ export declare const PENDING_FILLED_TTL_MS = 60000;
|
|
|
91
100
|
*/
|
|
92
101
|
export declare const PENDING_AMBIGUOUS_TTL_MS: number;
|
|
93
102
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* the
|
|
103
|
+
* How long a resting entry order may sit unfilled. At this TTL the entry turns `cancelDue` and
|
|
104
|
+
* the runtime's sweep cancels the order by its oid, so a late fill can never land after the
|
|
105
|
+
* entry stopped counting. Mirroring {@link PENDING_OPEN_STALE_MS} keeps it in step with the other
|
|
106
|
+
* place the runtime gives up on an unobserved open (the position-id registry).
|
|
98
107
|
*/
|
|
99
108
|
export declare const PENDING_RESTING_TTL_MS: number;
|
|
109
|
+
/** A resting entry past its TTL, waiting for the sweep to cancel the order it names. */
|
|
110
|
+
export type DueCancel = PendingOpenEntry & {
|
|
111
|
+
readonly state: "cancelDue";
|
|
112
|
+
readonly orderId: string;
|
|
113
|
+
};
|
|
100
114
|
export interface PendingOpensLedger {
|
|
101
115
|
/**
|
|
102
116
|
* Record an open about to be submitted. Call this SYNCHRONOUSLY before awaiting
|
|
@@ -108,6 +122,17 @@ export interface PendingOpensLedger {
|
|
|
108
122
|
settle(key: string, kind: PendingOpenKind, orderId?: string): void;
|
|
109
123
|
/** Drop a reservation the venue rejected outright — it holds neither slot nor margin. */
|
|
110
124
|
release(key: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Resting entries past their TTL whose order must be cancelled. They count toward slots,
|
|
127
|
+
* margin and the daily cap until {@link resolveCancel} settles them.
|
|
128
|
+
*/
|
|
129
|
+
dueCancels(): DueCancel[];
|
|
130
|
+
/**
|
|
131
|
+
* Settle a `cancelDue` entry: `cancelled` drops it, `not_open` lands it (it filled, or
|
|
132
|
+
* someone else cancelled it, so it counts toward the daily cap until a row shows it), and
|
|
133
|
+
* `failed` leaves it due for the next sweep. No-op unless the entry is `cancelDue`.
|
|
134
|
+
*/
|
|
135
|
+
resolveCancel(key: string, outcome: CancelOutcome): void;
|
|
111
136
|
/** Drop every entry the snapshot now confirms, plus anything past its TTL. */
|
|
112
137
|
reconcile(positions: readonly OpenPosition[] | undefined): void;
|
|
113
138
|
/** Live entries this snapshot does NOT show — what the caller must add to the snapshot's own count. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-opens-ledger.d.ts","sourceRoot":"","sources":["../../src/runtime/pending-opens-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"pending-opens-ledger.d.ts","sourceRoot":"","sources":["../../src/runtime/pending-opens-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOzD;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,CAAC;AAEpD,uEAAuE;AACvE,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEhE,0CAA0C;AAC1C,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,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AE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;OAGG;IACH,UAAU,IAAI,SAAS,EAAE,CAAC;IAC1B;;;;OAIG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IACzD,8EAA8E;IAC9E,SAAS,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC;IAChE,uGAAuG;IACvG,MAAM,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,GAAG,gBAAgB,EAAE,CAAC;IAC3E;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAC;CACpF;AAED,MAAM,WAAW,yBAAyB;IACxC,gCAAgC;IAChC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,kFAAkF;IAClF,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;CACxD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAGjE;AAOD,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,yBAA8B,GACtC,kBAAkB,CAwHpB"}
|
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
* opened at or after its reservation and not closed before it, shows it.
|
|
27
27
|
*/
|
|
28
28
|
import { normalizeDslCoinDex } from "../utils/perp-coin.js";
|
|
29
|
+
import { createLogger } from "../utils/logger.js";
|
|
29
30
|
import { PENDING_OPEN_STALE_MS } from "./position-id-registry.js";
|
|
31
|
+
const logger = createLogger("[senpi-core][pending-opens]");
|
|
30
32
|
/**
|
|
31
33
|
* How far a row's venue-stamped open time may sit before the box's reservation clock and
|
|
32
34
|
* still be this open's fill. The venue fills after the submit, so only clock skew and the
|
|
@@ -50,10 +52,10 @@ export const PENDING_FILLED_TTL_MS = 60_000;
|
|
|
50
52
|
*/
|
|
51
53
|
export const PENDING_AMBIGUOUS_TTL_MS = 10 * 60_000;
|
|
52
54
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* the
|
|
55
|
+
* How long a resting entry order may sit unfilled. At this TTL the entry turns `cancelDue` and
|
|
56
|
+
* the runtime's sweep cancels the order by its oid, so a late fill can never land after the
|
|
57
|
+
* entry stopped counting. Mirroring {@link PENDING_OPEN_STALE_MS} keeps it in step with the other
|
|
58
|
+
* place the runtime gives up on an unobserved open (the position-id registry).
|
|
57
59
|
*/
|
|
58
60
|
export const PENDING_RESTING_TTL_MS = PENDING_OPEN_STALE_MS;
|
|
59
61
|
/** Trade history reports times in whole seconds, so a close inside the reservation's own second reads as that second's start. */
|
|
@@ -75,6 +77,9 @@ const DEFAULT_TTL_BY_KIND = {
|
|
|
75
77
|
resting: PENDING_RESTING_TTL_MS,
|
|
76
78
|
ambiguous: PENDING_AMBIGUOUS_TTL_MS,
|
|
77
79
|
};
|
|
80
|
+
function isDueCancel(entry) {
|
|
81
|
+
return entry.state === "cancelDue" && entry.orderId !== undefined;
|
|
82
|
+
}
|
|
78
83
|
/**
|
|
79
84
|
* The ledger key for a market: base coin + dex bucket, with `main` and the `xyz:` coin
|
|
80
85
|
* prefix normalized away so one market never occupies two keys.
|
|
@@ -97,20 +102,27 @@ export function createPendingOpensLedger(options = {}) {
|
|
|
97
102
|
entries.delete(entry.key);
|
|
98
103
|
landed.push(entry);
|
|
99
104
|
}
|
|
100
|
-
/**
|
|
101
|
-
* Drop everything past its kind's TTL. Runs before every read so no caller sees a stale
|
|
102
|
-
* claim. An expired `filled` entry still happened, so it lands; resting and ambiguous ones
|
|
103
|
-
* were never known to fill and are forgotten.
|
|
104
|
-
*/
|
|
105
105
|
function pruneExpired() {
|
|
106
106
|
const t = now();
|
|
107
107
|
for (const entry of [...entries.values()]) {
|
|
108
|
-
if (t - entry.ts < ttlFor(entry.kind))
|
|
108
|
+
if (entry.state === "cancelDue" || t - entry.ts < ttlFor(entry.kind))
|
|
109
109
|
continue;
|
|
110
|
-
if (entry.kind === "filled")
|
|
110
|
+
if (entry.kind === "filled") {
|
|
111
111
|
land(entry);
|
|
112
|
-
|
|
112
|
+
}
|
|
113
|
+
else if (entry.kind === "resting" && entry.orderId !== undefined) {
|
|
114
|
+
entries.set(entry.key, { ...entry, state: "cancelDue" });
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
if (entry.kind === "resting") {
|
|
118
|
+
logger.warn("resting entry expired with no order id to cancel; dropping it", {
|
|
119
|
+
coin: entry.coin,
|
|
120
|
+
dex: entry.dex,
|
|
121
|
+
ageMs: t - entry.reservedAt,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
113
124
|
entries.delete(entry.key);
|
|
125
|
+
}
|
|
114
126
|
}
|
|
115
127
|
const d = new Date(t);
|
|
116
128
|
const dayStart = Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate());
|
|
@@ -129,6 +141,7 @@ export function createPendingOpensLedger(options = {}) {
|
|
|
129
141
|
// exactly what `ambiguous` means, and starting anywhere else would under-count a
|
|
130
142
|
// reservation whose caller never got to settle it (a crash mid-submit).
|
|
131
143
|
kind: "ambiguous",
|
|
144
|
+
state: "open",
|
|
132
145
|
ts: now(),
|
|
133
146
|
reservedAt: now(),
|
|
134
147
|
});
|
|
@@ -148,6 +161,19 @@ export function createPendingOpensLedger(options = {}) {
|
|
|
148
161
|
release(key) {
|
|
149
162
|
entries.delete(key);
|
|
150
163
|
},
|
|
164
|
+
dueCancels() {
|
|
165
|
+
pruneExpired();
|
|
166
|
+
return [...entries.values()].filter(isDueCancel);
|
|
167
|
+
},
|
|
168
|
+
resolveCancel(key, outcome) {
|
|
169
|
+
const entry = entries.get(key);
|
|
170
|
+
if (entry?.state !== "cancelDue")
|
|
171
|
+
return;
|
|
172
|
+
if (outcome === "cancelled")
|
|
173
|
+
entries.delete(key);
|
|
174
|
+
else if (outcome === "not_open")
|
|
175
|
+
land(entry);
|
|
176
|
+
},
|
|
151
177
|
reconcile(positions) {
|
|
152
178
|
pruneExpired();
|
|
153
179
|
if (!positions)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-opens-ledger.js","sourceRoot":"","sources":["../../src/runtime/pending-opens-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"pending-opens-ledger.js","sourceRoot":"","sources":["../../src/runtime/pending-opens-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,MAAM,GAAG,YAAY,CAAC,6BAA6B,CAAC,CAAC;AA0D3D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,GAAG,MAAM,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAE5D,iIAAiI;AACjI,SAAS,aAAa,CAAC,EAAU;IAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AACtC,CAAC;AAED;;;;;;GAMG;AACH,SAAS,WAAW,CAAC,GAA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C,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC;YACpE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;YAC/B,MAAM,UAAU,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;iBAChD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,IAAI,OAAO,CAAC;iBAC9C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC;YAC/C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;gBACjC,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CACtB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CACX,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;oBACd,GAAG,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG;oBACrB,GAAG,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,GAAG,kBAAkB;oBACvD,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC,CACrC,CAAC;gBACF,IAAI,CAAC,GAAG,CAAC;oBAAE,OAAO,IAAI,CAAC;gBACvB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACZ,OAAO,KAAK,CAAC;YACf,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cancels the runtime's own resting entry orders once their pending window ends.
|
|
3
|
+
*
|
|
4
|
+
* A resting entry counts toward slots, margin and the daily-entry cap only for
|
|
5
|
+
* {@link PENDING_RESTING_TTL_MS}. Left on the book past that, a late fill would land after it
|
|
6
|
+
* stopped counting and push the strategy one over all three. The ledger hands such an entry over
|
|
7
|
+
* as `cancelDue`; this sweep cancels its order and tells the ledger what happened.
|
|
8
|
+
*
|
|
9
|
+
* Only the exact oid the open path stored is ever cancelled. Runtime entries and agent manual
|
|
10
|
+
* orders both carry `AGT:` cloids, so the cloid cannot tell them apart. The guards around the oid
|
|
11
|
+
* are the coin, the order not being an exit leg, and the cloid not being a user's (`USR:`).
|
|
12
|
+
*/
|
|
13
|
+
import type { VenueOpenOrder } from "../senpi/types.js";
|
|
14
|
+
import type { Logger } from "../utils/logger.js";
|
|
15
|
+
import { type PendingOpensLedger } from "./pending-opens-ledger.js";
|
|
16
|
+
/** How often the sweep runs, so an entry is cancelled within this long of its TTL. */
|
|
17
|
+
export declare const RESTING_ENTRY_SWEEP_INTERVAL_MS = 30000;
|
|
18
|
+
/**
|
|
19
|
+
* How long one read or cancel may take before the sweep counts it failed. The gateway transport
|
|
20
|
+
* has no time limit of its own, and stop and rebuild wait for an in-flight sweep.
|
|
21
|
+
*/
|
|
22
|
+
export declare const RESTING_ENTRY_CALL_TIMEOUT_MS = 45000;
|
|
23
|
+
export interface RestingEntryCancelDeps {
|
|
24
|
+
wallet: string;
|
|
25
|
+
ledger: PendingOpensLedger;
|
|
26
|
+
readOpenOrders(wallet: string, dex: string): Promise<VenueOpenOrder[]>;
|
|
27
|
+
cancelOrder(wallet: string, oid: number): Promise<unknown>;
|
|
28
|
+
logger: Logger;
|
|
29
|
+
now?: () => number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Whether a cloid carries the engine's user marker. On the venue the engine's mode-tagged id is
|
|
33
|
+
* hex-encoded into a 128-bit cloid, so the marker is read from the decoded bytes; a raw id is
|
|
34
|
+
* accepted too. The simulation venue hashes its cloids, and some rows carry none, so only a
|
|
35
|
+
* provable user order is refused: the oid, taken from this runtime's own create reply, is what
|
|
36
|
+
* makes the order ours.
|
|
37
|
+
*/
|
|
38
|
+
export declare function isUserCloid(cloid: string | undefined): boolean;
|
|
39
|
+
/** One pass over every `cancelDue` entry. Never throws: a failure leaves the entry due. */
|
|
40
|
+
export declare function sweepDueCancels(deps: RestingEntryCancelDeps): Promise<void>;
|
|
41
|
+
//# sourceMappingURL=resting-entry-cancel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resting-entry-cancel.d.ts","sourceRoot":"","sources":["../../src/runtime/resting-entry-cancel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAkC,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpG,sFAAsF;AACtF,eAAO,MAAM,+BAA+B,QAAS,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,6BAA6B,QAAS,CAAC;AAoBpD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,kBAAkB,CAAC;IAC3B,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IACvE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAM9D;AAYD,2FAA2F;AAC3F,wBAAsB,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwFjF"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cancels the runtime's own resting entry orders once their pending window ends.
|
|
3
|
+
*
|
|
4
|
+
* A resting entry counts toward slots, margin and the daily-entry cap only for
|
|
5
|
+
* {@link PENDING_RESTING_TTL_MS}. Left on the book past that, a late fill would land after it
|
|
6
|
+
* stopped counting and push the strategy one over all three. The ledger hands such an entry over
|
|
7
|
+
* as `cancelDue`; this sweep cancels its order and tells the ledger what happened.
|
|
8
|
+
*
|
|
9
|
+
* Only the exact oid the open path stored is ever cancelled. Runtime entries and agent manual
|
|
10
|
+
* orders both carry `AGT:` cloids, so the cloid cannot tell them apart. The guards around the oid
|
|
11
|
+
* are the coin, the order not being an exit leg, and the cloid not being a user's (`USR:`).
|
|
12
|
+
*/
|
|
13
|
+
import { emitEvent } from "../actions/event-derivation.js";
|
|
14
|
+
import { EVENT_NAME, eventAttrs } from "../utils/event-catalog.js";
|
|
15
|
+
import { isRecord } from "../utils/response.js";
|
|
16
|
+
import { pendingOpenKey } from "./pending-opens-ledger.js";
|
|
17
|
+
/** How often the sweep runs, so an entry is cancelled within this long of its TTL. */
|
|
18
|
+
export const RESTING_ENTRY_SWEEP_INTERVAL_MS = 30_000;
|
|
19
|
+
/**
|
|
20
|
+
* How long one read or cancel may take before the sweep counts it failed. The gateway transport
|
|
21
|
+
* has no time limit of its own, and stop and rebuild wait for an in-flight sweep.
|
|
22
|
+
*/
|
|
23
|
+
export const RESTING_ENTRY_CALL_TIMEOUT_MS = 45_000;
|
|
24
|
+
const USER_MARKER = "USR:";
|
|
25
|
+
function withDeadline(call, what) {
|
|
26
|
+
let timer;
|
|
27
|
+
const deadline = new Promise((_, reject) => {
|
|
28
|
+
timer = setTimeout(() => reject(new Error(`${what} gave no answer within ${RESTING_ENTRY_CALL_TIMEOUT_MS} ms`)), RESTING_ENTRY_CALL_TIMEOUT_MS);
|
|
29
|
+
});
|
|
30
|
+
return Promise.race([call, deadline]).finally(() => clearTimeout(timer));
|
|
31
|
+
}
|
|
32
|
+
/** The engine's cancel is idempotent: an order that filled or was cancelled first still answers success. */
|
|
33
|
+
function wasAlreadyGone(reply) {
|
|
34
|
+
return isRecord(reply) && isRecord(reply.cancelledOrder) && reply.cancelledOrder.wasAlreadyCancelled === true;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Whether a cloid carries the engine's user marker. On the venue the engine's mode-tagged id is
|
|
38
|
+
* hex-encoded into a 128-bit cloid, so the marker is read from the decoded bytes; a raw id is
|
|
39
|
+
* accepted too. The simulation venue hashes its cloids, and some rows carry none, so only a
|
|
40
|
+
* provable user order is refused: the oid, taken from this runtime's own create reply, is what
|
|
41
|
+
* makes the order ours.
|
|
42
|
+
*/
|
|
43
|
+
export function isUserCloid(cloid) {
|
|
44
|
+
if (!cloid)
|
|
45
|
+
return false;
|
|
46
|
+
if (cloid.startsWith(USER_MARKER))
|
|
47
|
+
return true;
|
|
48
|
+
const hex = cloid.replace(/^0x/i, "");
|
|
49
|
+
if (!/^[0-9a-f]{32}$/i.test(hex))
|
|
50
|
+
return false;
|
|
51
|
+
return Buffer.from(hex, "hex").toString("latin1").startsWith(USER_MARKER);
|
|
52
|
+
}
|
|
53
|
+
function isOwnEntryOrder(order, entry) {
|
|
54
|
+
return (pendingOpenKey(order.coin, entry.dex) === entry.key &&
|
|
55
|
+
!order.reduceOnly &&
|
|
56
|
+
!order.isTrigger &&
|
|
57
|
+
!order.isPositionTpsl &&
|
|
58
|
+
!isUserCloid(order.cloid));
|
|
59
|
+
}
|
|
60
|
+
/** One pass over every `cancelDue` entry. Never throws: a failure leaves the entry due. */
|
|
61
|
+
export async function sweepDueCancels(deps) {
|
|
62
|
+
const { wallet, ledger, logger } = deps;
|
|
63
|
+
const now = deps.now ?? Date.now;
|
|
64
|
+
const due = ledger.dueCancels();
|
|
65
|
+
if (due.length === 0)
|
|
66
|
+
return;
|
|
67
|
+
const books = new Map();
|
|
68
|
+
const bookFor = (dex) => {
|
|
69
|
+
let book = books.get(dex);
|
|
70
|
+
if (!book) {
|
|
71
|
+
book = withDeadline(deps.readOpenOrders(wallet, dex), "strategy_get_open_orders");
|
|
72
|
+
books.set(dex, book);
|
|
73
|
+
}
|
|
74
|
+
return book;
|
|
75
|
+
};
|
|
76
|
+
for (const entry of due) {
|
|
77
|
+
const oid = entry.orderId;
|
|
78
|
+
const base = {
|
|
79
|
+
"senpi.strategy.address": wallet,
|
|
80
|
+
"senpi.asset": entry.coin,
|
|
81
|
+
"senpi.order.id": oid,
|
|
82
|
+
"senpi.pending_open.age_ms": now() - entry.reservedAt,
|
|
83
|
+
};
|
|
84
|
+
const fail = (step, err) => {
|
|
85
|
+
logger.warn("resting entry cancel failed; retrying next sweep", err, { ...base, step });
|
|
86
|
+
emitEvent(logger, () => ({
|
|
87
|
+
name: EVENT_NAME.pendingOpenCancelFailed,
|
|
88
|
+
level: "warn",
|
|
89
|
+
body: `Could not cancel resting entry ${entry.coin} oid ${oid} (${step}); will retry`,
|
|
90
|
+
attributes: eventAttrs({
|
|
91
|
+
...base,
|
|
92
|
+
"senpi.pending_open.cancel_step": step,
|
|
93
|
+
}),
|
|
94
|
+
error: err,
|
|
95
|
+
}));
|
|
96
|
+
ledger.resolveCancel(entry.key, "failed");
|
|
97
|
+
};
|
|
98
|
+
let book;
|
|
99
|
+
try {
|
|
100
|
+
book = await bookFor(entry.dex);
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
fail("read", err);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const order = book.find((o) => String(o.oid) === oid);
|
|
107
|
+
if (!order) {
|
|
108
|
+
logger.info("resting entry order no longer open; counting it as landed", base);
|
|
109
|
+
ledger.resolveCancel(entry.key, "not_open");
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
if (!isOwnEntryOrder(order, entry)) {
|
|
113
|
+
logger.warn("open order with the entry's oid is not a runtime entry; leaving it", {
|
|
114
|
+
...base,
|
|
115
|
+
orderCoin: order.coin,
|
|
116
|
+
reduceOnly: order.reduceOnly,
|
|
117
|
+
isTrigger: order.isTrigger,
|
|
118
|
+
isPositionTpsl: order.isPositionTpsl,
|
|
119
|
+
cloid: order.cloid,
|
|
120
|
+
});
|
|
121
|
+
ledger.resolveCancel(entry.key, "not_open");
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
logger.info("cancelling resting entry order past its pending window", base);
|
|
125
|
+
let reply;
|
|
126
|
+
try {
|
|
127
|
+
reply = await withDeadline(deps.cancelOrder(wallet, order.oid), "cancel_order");
|
|
128
|
+
}
|
|
129
|
+
catch (err) {
|
|
130
|
+
fail("cancel", err);
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (wasAlreadyGone(reply)) {
|
|
134
|
+
logger.info("resting entry order filled or was cancelled before the cancel; counting it as landed", base);
|
|
135
|
+
ledger.resolveCancel(entry.key, "not_open");
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
logger.info("resting entry order cancelled", base);
|
|
139
|
+
emitEvent(logger, () => ({
|
|
140
|
+
name: EVENT_NAME.pendingOpenEntryCancelled,
|
|
141
|
+
level: "info",
|
|
142
|
+
body: `Cancelled resting entry ${entry.coin} oid ${oid} after its pending window`,
|
|
143
|
+
attributes: eventAttrs(base),
|
|
144
|
+
}));
|
|
145
|
+
ledger.resolveCancel(entry.key, "cancelled");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=resting-entry-cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resting-entry-cancel.js","sourceRoot":"","sources":["../../src/runtime/resting-entry-cancel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAiB,MAAM,2BAA2B,CAAC;AAElF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAA2C,MAAM,2BAA2B,CAAC;AAEpG,sFAAsF;AACtF,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC;AAEtD;;;GAGG;AACH,MAAM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UAAU,EAAE,UAAU,CAAwD,IAAI,CAAC;SACpF,CAAC,CAAC,CAAC;QACJ,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -80,6 +80,8 @@ export declare class Runtime {
|
|
|
80
80
|
private dslActivePositionsGaugeDispose;
|
|
81
81
|
/** Interval emitting this runtime's liveness heartbeat; set on start, cleared on stop. */
|
|
82
82
|
private livenessHeartbeatTimer;
|
|
83
|
+
private restingEntrySweepTimer;
|
|
84
|
+
private restingEntrySweepInFlight;
|
|
83
85
|
private runActionsForSignal;
|
|
84
86
|
private strategyConfig;
|
|
85
87
|
/**
|
|
@@ -367,6 +369,12 @@ export declare class Runtime {
|
|
|
367
369
|
* mid-flight at the venue.
|
|
368
370
|
*/
|
|
369
371
|
private teardownComponentsForRebuild;
|
|
372
|
+
private armRestingEntrySweep;
|
|
373
|
+
/**
|
|
374
|
+
* Leaves a sweep already at the venue to finish on its own: the ledger outlives a rebuild, and
|
|
375
|
+
* the in-flight guard is the runtime's, so a re-armed timer cannot start a second one beside it.
|
|
376
|
+
*/
|
|
377
|
+
private stopRestingEntrySweep;
|
|
370
378
|
removeStrategy(address: string): Promise<number>;
|
|
371
379
|
/** Tear down DSL for the runtime strategy before deleting the runtime (gateway / CLI). */
|
|
372
380
|
teardownDslForRuntimeDeletion(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/E,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB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