@hitrading/ctp-node 2.0.0 → 3.0.0
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/CHANGELOG.md +67 -0
- package/README.md +47 -32
- package/README.zh-CN.md +37 -27
- package/RELEASING.md +78 -0
- package/dist/client.d.ts +36 -15
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +234 -62
- package/dist/client.js.map +1 -1
- package/dist/codec.d.ts.map +1 -1
- package/dist/codec.js +84 -19
- package/dist/codec.js.map +1 -1
- package/dist/generated/structs.gen.d.ts +5461 -5461
- package/dist/generated/structs.gen.d.ts.map +1 -1
- package/dist/generated/trader.gen.d.ts.map +1 -1
- package/dist/generated/trader.gen.js +788 -94
- package/dist/generated/trader.gen.js.map +1 -1
- package/dist/index.cjs +1875 -415
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/market-data.d.ts +41 -24
- package/dist/market-data.d.ts.map +1 -1
- package/dist/market-data.js +148 -29
- package/dist/market-data.js.map +1 -1
- package/dist/native-binding.d.ts.map +1 -1
- package/dist/native-binding.js +4 -0
- package/dist/native-binding.js.map +1 -1
- package/dist/trader.d.ts +111 -71
- package/dist/trader.d.ts.map +1 -1
- package/dist/trader.js +774 -180
- package/dist/trader.js.map +1 -1
- package/dist/validation.d.ts +27 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +85 -0
- package/dist/validation.js.map +1 -0
- package/docs/API.md +1437 -0
- package/docs/API.zh-CN.md +1278 -0
- package/docs/MIGRATION.md +54 -0
- package/docs/assets/validation.svg +27 -0
- package/docs/integration.md +60 -0
- package/docs/native-hooks.md +281 -0
- package/docs/native-hooks.zh-CN.md +205 -0
- package/docs/troubleshooting.md +257 -0
- package/docs/troubleshooting.zh-CN.md +220 -0
- package/package.json +12 -4
- package/prebuilds/linux-x64/@hitrading+ctp-node.node +0 -0
- package/prebuilds/win32-x64/@hitrading+ctp-node.node +0 -0
- package/scripts/bench-decode.mjs +37 -0
- package/scripts/bench-fullmarket-offline.mjs +207 -0
- package/scripts/stress-fullmarket.mjs +255 -0
- package/src/addon.cc +2 -2
- package/src/client.ts +255 -65
- package/src/codec.ts +86 -19
- package/src/generated/structs.gen.ts +5461 -5461
- package/src/generated/trader.gen.ts +309 -94
- package/src/generated/traderreq.gen.cc +194 -18
- package/src/generated/traderreq.gen.h +4 -0
- package/src/generated/traderspi.gen.cc +129 -15
- package/src/generated/traderspi.gen.h +4 -2
- package/src/index.ts +8 -1
- package/src/market-data.ts +199 -46
- package/src/native/arm.cc +114 -30
- package/src/native/arm.h +16 -4
- package/src/native/channel.cc +209 -81
- package/src/native/channel.h +65 -24
- package/src/native/ctp_field.h +23 -0
- package/src/native/mdapi.cc +582 -69
- package/src/native/mdspi.cc +219 -16
- package/src/native/mdspi.h +59 -10
- package/src/native/order_capability.h +75 -0
- package/src/native/risk.cc +2030 -213
- package/src/native/risk.h +431 -78
- package/src/native/shared_handle.h +37 -0
- package/src/native/snapshot.h +75 -16
- package/src/native/traderapi.cc +753 -124
- package/src/native-binding.ts +4 -0
- package/src/trader.ts +971 -204
- package/src/validation.ts +96 -0
package/dist/trader.d.ts
CHANGED
|
@@ -3,43 +3,61 @@ import type { CallbackOptions } from "./client.js";
|
|
|
3
3
|
import type { Order, Trade, InputOrder, RspUserLogin } from "./generated/structs.gen.js";
|
|
4
4
|
import type { MarketData } from "./market-data.js";
|
|
5
5
|
/** Pre-trade risk limits, enforced in C++ before each order is sent. */
|
|
6
|
-
export interface
|
|
6
|
+
export interface RiskLimits {
|
|
7
7
|
/** Max volume per single order. Omit/0 = disabled. */
|
|
8
8
|
maxOrderVolume?: number;
|
|
9
9
|
/** Reject if order price deviates from the reference by > this ratio (e.g.
|
|
10
10
|
* 0.02 = 2%). Feed the reference via trackMarketData(md) (the MD snapshot is
|
|
11
|
-
* read in C++);
|
|
11
|
+
* read in C++); missing or stale data rejects opening orders. */
|
|
12
12
|
maxPriceDeviation?: number;
|
|
13
|
-
/** Max notional (price × volume) per order.
|
|
13
|
+
/** Max futures notional (price × volume × multiplier) per opening order.
|
|
14
|
+
* Unknown/unsupported product metadata fails closed. Omit/0 = disabled. */
|
|
14
15
|
maxNotional?: number;
|
|
15
|
-
/** Max order sends per second (token bucket). Omit/0 = disabled. */
|
|
16
|
+
/** Max opening-order sends per second (token bucket). Omit/0 = disabled. */
|
|
16
17
|
maxOrdersPerSec?: number;
|
|
17
18
|
/** Token-bucket burst; defaults to maxOrdersPerSec. */
|
|
18
19
|
orderBurst?: number;
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
/** Independent rate for risk-reducing close inserts. Disabled by default so
|
|
21
|
+
* emergency exits are not throttled by the opening-order bucket. */
|
|
22
|
+
maxCloseOrdersPerSec?: number;
|
|
23
|
+
/** Close-order token-bucket burst; defaults to maxCloseOrdersPerSec. */
|
|
24
|
+
closeOrderBurst?: number;
|
|
25
|
+
/** Maximum age of the market-data reference used by the deviation guard.
|
|
26
|
+
* Default 3000 ms. Missing or older data fails closed when the guard is on. */
|
|
27
|
+
maxReferenceAgeMs?: number;
|
|
23
28
|
/** Cap on total open-position MARGIN (Σ open price × volume × multiplier ×
|
|
24
|
-
*
|
|
29
|
+
* absolute by-money/by-volume margin schedule) — a zero-lag hard cap enforced in
|
|
25
30
|
* C++ on every opening order (regular AND armed). 0/undefined = disabled.
|
|
26
31
|
* Margin rates are fed automatically from CTP's OnRspQryInstrumentMarginRate
|
|
27
32
|
* inside C++ (populate them by calling reqQryInstrumentMarginRate); until a
|
|
28
|
-
*
|
|
33
|
+
* multiplier or usable absolute schedule is missing, opening orders fail
|
|
34
|
+
* closed. Both by-money and per-lot components are included; relative
|
|
35
|
+
* investor schedules are combined with their exchange base schedule.
|
|
29
36
|
* Multipliers / existing positions are picked up via syncMultipliers() /
|
|
30
37
|
* syncPositions(). */
|
|
31
|
-
|
|
38
|
+
maxAccountMargin?: number;
|
|
32
39
|
}
|
|
33
40
|
/** A per-instrument lot cap: a single number caps both sides at that value;
|
|
34
41
|
* `{ long, short }` caps each side separately (omit a side to leave it open). */
|
|
35
|
-
export type
|
|
42
|
+
export type InstrumentPositionLimit = number | {
|
|
36
43
|
long?: number;
|
|
37
44
|
short?: number;
|
|
38
45
|
};
|
|
46
|
+
/** One bucket in a complete manually reconciled held-position snapshot. */
|
|
47
|
+
export interface PositionSeed {
|
|
48
|
+
instrumentId: string;
|
|
49
|
+
side: "long" | "short";
|
|
50
|
+
hedgeFlag: "1" | "2" | "3" | "5" | "6" | "7";
|
|
51
|
+
volume: number;
|
|
52
|
+
margin: number;
|
|
53
|
+
}
|
|
39
54
|
/** Options for the one-call post-connect handshake, {@link Trader.session}. */
|
|
40
55
|
export interface SessionOptions {
|
|
41
56
|
brokerId: string;
|
|
42
57
|
userId: string;
|
|
58
|
+
/** Trading account. Defaults to userId for ordinary retail accounts; set it
|
|
59
|
+
* explicitly when the login operator UserID differs from InvestorID. */
|
|
60
|
+
investorId?: string;
|
|
43
61
|
password: string;
|
|
44
62
|
/** Terminal authentication (real accounts require it; SimNow uses
|
|
45
63
|
* appId "simnow_client_test" / authCode of 16 zeros). Omit both to skip. */
|
|
@@ -49,10 +67,14 @@ export interface SessionOptions {
|
|
|
49
67
|
* before trading (brokers reject orders otherwise). Default true; set false
|
|
50
68
|
* for environments that don't need it. */
|
|
51
69
|
confirmSettlement?: boolean;
|
|
52
|
-
/** Which risk inputs to fetch after login
|
|
70
|
+
/** Which risk inputs to fetch after login. Multipliers/positions/orders default
|
|
71
|
+
* on; margin rates require an explicit contract list. `multipliers` may
|
|
53
72
|
* be `true` (all instruments) or a list of symbols. */
|
|
54
73
|
sync?: {
|
|
55
74
|
multipliers?: boolean | string[];
|
|
75
|
+
/** Contracts whose speculation margin schedules should be queried. Omitted
|
|
76
|
+
* by default because CTP requires one rate query per contract. */
|
|
77
|
+
marginRates?: string[];
|
|
56
78
|
positions?: boolean;
|
|
57
79
|
orders?: boolean;
|
|
58
80
|
};
|
|
@@ -78,18 +100,31 @@ export declare class Trader extends TraderBase {
|
|
|
78
100
|
private investor?;
|
|
79
101
|
private orderRefSeq;
|
|
80
102
|
constructor(flowPath: string, fronts: string | string[]);
|
|
81
|
-
|
|
82
|
-
|
|
103
|
+
/** A raw login Promise may resolve only with a structurally usable session.
|
|
104
|
+
* Account confirmation itself happens in session(), after request-vs-response
|
|
105
|
+
* identity validation; merely observing a protocol event never grants order
|
|
106
|
+
* authority. */
|
|
107
|
+
protected onRequestResolved(eventName: string | undefined, value: unknown, _options: CallbackOptions): void;
|
|
108
|
+
/** Generated login/logout methods call this only after their request has
|
|
109
|
+
* encoded successfully. Revoke the confirmed JS account at that same atomic
|
|
110
|
+
* transition boundary, so a concurrent sync helper cannot start with the old
|
|
111
|
+
* identity while native risk state is already fail-closed for the new session. */
|
|
112
|
+
protected beginRequestContextTransition(reason: string): void;
|
|
113
|
+
protected shouldTimeoutRequest(requestId: number, sessionTransition: boolean): boolean;
|
|
114
|
+
get apiVersion(): string;
|
|
115
|
+
get tradingDay(): string;
|
|
83
116
|
/**
|
|
84
117
|
* One-call post-connect handshake. Call it from the `front-connected` handler
|
|
85
118
|
* (and again after a reconnect): authenticate (if appId/authCode given) →
|
|
86
|
-
* login → confirm settlement → sync multipliers /
|
|
119
|
+
* login → confirm settlement → sync multipliers / margin rates / orders /
|
|
120
|
+
* positions. Each
|
|
87
121
|
* step just wraps the matching req / sync method, so you can hand-roll your
|
|
88
122
|
* own flow instead when you need finer control. Returns the row counts from
|
|
89
123
|
* the sync steps. Must run on a connected front (queries need the session up).
|
|
90
124
|
*/
|
|
91
125
|
session(opts: SessionOptions): Promise<{
|
|
92
126
|
multipliers: number;
|
|
127
|
+
marginRates: number;
|
|
93
128
|
positions: number;
|
|
94
129
|
orders: number;
|
|
95
130
|
}>;
|
|
@@ -97,6 +132,8 @@ export declare class Trader extends TraderBase {
|
|
|
97
132
|
* OrderRef as a per-session sequence and rejects a duplicate or non-numeric
|
|
98
133
|
* ref with "不允许重复报单", so an unset ref would otherwise collide. */
|
|
99
134
|
private withAutoOrderRef;
|
|
135
|
+
private commitOrderRef;
|
|
136
|
+
private validateOrder;
|
|
100
137
|
/**
|
|
101
138
|
* Insert an order through the C++ pre-trade risk gate. Resolves on submission:
|
|
102
139
|
* CTP sends no success acknowledgement for an accepted order - only
|
|
@@ -107,73 +144,74 @@ export declare class Trader extends TraderBase {
|
|
|
107
144
|
*/
|
|
108
145
|
reqOrderInsert(req?: Partial<InputOrder>): Promise<void>;
|
|
109
146
|
/** Publish pre-trade risk limits to the C++ enforcer (takes effect at once). */
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
*
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
|
|
118
|
-
|
|
147
|
+
setRiskLimits(config: RiskLimits): this;
|
|
148
|
+
/** Enter REDUCE_ONLY atomically at the final vendor-API send barrier. Armed
|
|
149
|
+
* opens remain registered but cannot send until resume(). */
|
|
150
|
+
reduceOnly(): this;
|
|
151
|
+
/** Enter HALT_ALL atomically: both opening and closing order inserts, advanced
|
|
152
|
+
* mutations and bank/futures transfers are refused, and all existing armed
|
|
153
|
+
* triggers are cleared. New arm() calls are rejected until resume().
|
|
154
|
+
* Cancellation actions remain available so working
|
|
155
|
+
* exchange orders can still be withdrawn. */
|
|
156
|
+
haltAll(): this;
|
|
157
|
+
/** Return to NORMAL mode after reduceOnly() or haltAll(). */
|
|
119
158
|
resume(): this;
|
|
120
159
|
/** Use a MarketData feed as the live reference for the maxPriceDeviation check.
|
|
121
160
|
* Wires the feed's C++ snapshot cache straight into this Trader's risk engine,
|
|
122
161
|
* so the deviation check reads current prices in C++ on the order path (no JS
|
|
123
162
|
* round-trip, and it also covers armed orders that fire with no JS in the loop).
|
|
124
|
-
* Without
|
|
163
|
+
* Without a fresh reference, an enabled deviation check fails closed. */
|
|
125
164
|
trackMarketData(md: MarketData): this;
|
|
126
165
|
/**
|
|
127
166
|
* Cap the open position (in lots) for one instrument, enforced in C++ on
|
|
128
167
|
* every opening order. Pass a number to cap both sides at once, or
|
|
129
168
|
* `{ long, short }` to cap each side separately. Within `{ long, short }`,
|
|
130
169
|
* **omitting a side leaves that side's current cap unchanged** (on a re-call it
|
|
131
|
-
* is NOT reset to uncapped), and passing
|
|
170
|
+
* is NOT reset to uncapped), and passing `0` for a side removes its cap.
|
|
132
171
|
* Long and short are always tracked independently.
|
|
133
172
|
*
|
|
134
|
-
*
|
|
135
|
-
* so rapid bursts of opens can momentarily overshoot before the fills land —
|
|
136
|
-
* size the cap with that in mind.
|
|
173
|
+
* Held positions and in-flight working opens are counted atomically.
|
|
137
174
|
*
|
|
138
|
-
* td.
|
|
139
|
-
* td.
|
|
175
|
+
* td.setInstrumentPositionLimit("rb2610", 100);
|
|
176
|
+
* td.setInstrumentPositionLimit("ru2610", { long: 100, short: 20 });
|
|
140
177
|
*/
|
|
141
|
-
|
|
178
|
+
setInstrumentPositionLimit(instrumentId: string, limit: InstrumentPositionLimit): this;
|
|
142
179
|
/** Cap several instruments at once, e.g.
|
|
143
180
|
* `{ rb2610: 100, ru2610: { long: 100, short: 20 } }`. */
|
|
144
|
-
|
|
181
|
+
setInstrumentPositionLimits(limits: Record<string, InstrumentPositionLimit>): this;
|
|
182
|
+
private normalizePositionLimit;
|
|
145
183
|
/**
|
|
146
|
-
* Cap one instrument's open
|
|
147
|
-
* long and short summed
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* `maxCost <= 0` to remove it. Fill-based, same caveat as maxPositionCost.
|
|
184
|
+
* Cap one instrument's scheduled open margin (CTP by-money + by-volume,
|
|
185
|
+
* long and short summed), enforced in C++ on every opening order. This is
|
|
186
|
+
* independent of the account-wide maxAccountMargin cap; both apply. Pass
|
|
187
|
+
* `limit = 0` to remove it. Held and in-flight exposure both count.
|
|
151
188
|
*/
|
|
152
|
-
|
|
153
|
-
/** Cap several instruments' open
|
|
189
|
+
setInstrumentMarginLimit(instrumentId: string, limit: number): this;
|
|
190
|
+
/** Cap several instruments' scheduled open margin at once, e.g.
|
|
154
191
|
* `{ ag2608: 2_000_000, au2608: 5_000_000 }`. */
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* sum both sides so the bucket doesn't matter for them, but a per-side *volume*
|
|
166
|
-
* cap on a net-mode instrument would track the wrong side — for net-mode
|
|
167
|
-
* accounts, seed those via seedPosition() with the side you intend. */
|
|
192
|
+
setInstrumentMarginLimits(limits: Record<string, number>): this;
|
|
193
|
+
/** Atomically replace held positions from a complete manually reconciled
|
|
194
|
+
* snapshot. `margin` is CTP InvestorPosition.UseMargin. An empty array is an
|
|
195
|
+
* authoritative flat book. Partial/incremental seeding is intentionally not
|
|
196
|
+
* exposed because armed orders can run between JS calls. */
|
|
197
|
+
seedPositions(positions: ReadonlyArray<PositionSeed>): this;
|
|
198
|
+
private replacePositionSeeds;
|
|
199
|
+
/** Atomically replace held position margin from complete gross-mode query rows
|
|
200
|
+
* (`posiDirection` '2' long, '3' short). Net/unknown direction is rejected
|
|
201
|
+
* because guessing a side corrupts per-side volume caps. */
|
|
168
202
|
seedFromPositions(positions: ReadonlyArray<{
|
|
169
203
|
instrumentId: string;
|
|
170
204
|
posiDirection: string;
|
|
205
|
+
hedgeFlag: string;
|
|
171
206
|
position: number;
|
|
172
207
|
useMargin: number;
|
|
173
208
|
}>): this;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
209
|
+
private aggregatePositions;
|
|
210
|
+
/** Current total open-position margin tracked by the C++ risk engine. */
|
|
211
|
+
get accountMargin(): number;
|
|
212
|
+
/** Clear held position state only and mark it uncertain. Working-order
|
|
213
|
+
* reservations are preserved; openings remain blocked until a complete
|
|
214
|
+
* seedFromPositions() or syncPositions() succeeds. */
|
|
177
215
|
resetPositions(): this;
|
|
178
216
|
/**
|
|
179
217
|
* Run a CTP query with flow-control retries. CTP rate-limits queries (~1/sec)
|
|
@@ -184,18 +222,23 @@ export declare class Trader extends TraderBase {
|
|
|
184
222
|
* position book, so a flat account doesn't waste the full retry budget).
|
|
185
223
|
*/
|
|
186
224
|
private queryWithRetry;
|
|
225
|
+
/** Empty position/order snapshots are ambiguous immediately after login. Require
|
|
226
|
+
* the same empty result twice, one query interval apart, before treating it as
|
|
227
|
+
* authoritative. */
|
|
228
|
+
private authoritativeQuery;
|
|
187
229
|
/** Query instruments so the C++ risk engine picks up their multipliers (it
|
|
188
230
|
* sources them directly from OnRspQryInstrument — no JS feed). No args queries
|
|
189
231
|
* all instruments (one request); otherwise the given symbols. Retries through
|
|
190
232
|
* cold-start flow control. Returns the count of contracts with a multiplier. */
|
|
191
233
|
syncMultipliers(instrumentIds?: string[]): Promise<number>;
|
|
192
|
-
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
234
|
+
/** Query investor margin schedules for a bounded universe. The exchange-base
|
|
235
|
+
* query is issued only when the investor row is relative; the shared query
|
|
236
|
+
* scheduler enforces spacing. Returns the number of usable schedules. */
|
|
237
|
+
syncMarginRates(instrumentIds: string[], hedgeFlag?: "1" | "2" | "3" | "5" | "6" | "7"): Promise<number>;
|
|
238
|
+
/** Replace held position margin from CTP (`reqQryInvestorPosition`). The
|
|
239
|
+
* replacement is revision-checked: if an order/trade callback races the
|
|
240
|
+
* snapshot it retries without clearing live state or reservations. */
|
|
241
|
+
syncPositions(): Promise<number>;
|
|
199
242
|
/**
|
|
200
243
|
* Rebuild the in-flight reservation from CTP's currently-working orders
|
|
201
244
|
* (reqQryOrder) - an authoritative resync. Call it after login and after any
|
|
@@ -205,10 +248,7 @@ export declare class Trader extends TraderBase {
|
|
|
205
248
|
* of working open orders re-reserved. Run syncMultipliers() first so the
|
|
206
249
|
* reserved cost uses the right contract multiplier.
|
|
207
250
|
*/
|
|
208
|
-
syncOrders(
|
|
209
|
-
brokerId?: string;
|
|
210
|
-
investorId?: string;
|
|
211
|
-
}): Promise<number>;
|
|
251
|
+
syncOrders(): Promise<number>;
|
|
212
252
|
/**
|
|
213
253
|
* Arm a latency-critical trigger: when `md` sees the condition, the order is
|
|
214
254
|
* sent from C++ on the callback thread (through this Trader's risk gate),
|
|
@@ -220,7 +260,7 @@ export declare class Trader extends TraderBase {
|
|
|
220
260
|
* how many fired and were sent vs were refused by the risk gate / send.
|
|
221
261
|
* A blocked armed order is otherwise invisible, so poll this after a trigger
|
|
222
262
|
* you expected to fire. */
|
|
223
|
-
armStats(): {
|
|
263
|
+
get armStats(): {
|
|
224
264
|
fired: number;
|
|
225
265
|
blocked: number;
|
|
226
266
|
};
|
|
@@ -234,8 +274,8 @@ export declare class Trader extends TraderBase {
|
|
|
234
274
|
on(event: "rtn-trade", cb: (data: Trade, opts: CallbackOptions) => void): this;
|
|
235
275
|
on(event: "front-connected", cb: (data: undefined, opts: CallbackOptions) => void): this;
|
|
236
276
|
on(event: "front-disconnected", cb: (reason: number, opts: CallbackOptions) => void): this;
|
|
237
|
-
on(event: "rsp-user-login", cb: (data: RspUserLogin, opts: CallbackOptions) => void): this;
|
|
238
|
-
on(event: "err-rtn-order-insert", cb: (data: InputOrder, opts: CallbackOptions) => void): this;
|
|
277
|
+
on(event: "rsp-user-login", cb: (data: RspUserLogin | undefined, opts: CallbackOptions) => void): this;
|
|
278
|
+
on(event: "err-rtn-order-insert", cb: (data: InputOrder | undefined, opts: CallbackOptions) => void): this;
|
|
239
279
|
on(event: string, cb: (...args: never[]) => void): this;
|
|
240
280
|
}
|
|
241
281
|
export { TraderEvent };
|
package/dist/trader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trader.d.ts","sourceRoot":"","sources":["../src/trader.ts"],"names":[],"mappings":"AASA,OA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