@win-trader/config 0.3.4 → 0.3.5
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/constants.d.ts +30 -7
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +30 -7
- package/dist/constants.js.map +1 -1
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -13,11 +13,19 @@ export declare const SECONDS_PER_LEDGER = 5;
|
|
|
13
13
|
export declare const PRECISION = 10000000n;
|
|
14
14
|
/** Polling interval for CEX REST APIs. */
|
|
15
15
|
export declare const ORACLE_POLL_INTERVAL_MS = 1000;
|
|
16
|
-
/** Reject CEX prints whose embedded source-timestamp is older than this.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
/** Reject CEX prints whose embedded source-timestamp is older than this.
|
|
17
|
+
* NOTE: KuCoin's level1 `time` is when the top of book last *changed*, not
|
|
18
|
+
* when the data was served. A thin pair (XLM-USDT) legitimately holds the
|
|
19
|
+
* same best bid/ask for tens of seconds, so a tight bound here rejects a
|
|
20
|
+
* perfectly good price and starves that market's feed entirely. Sized for
|
|
21
|
+
* the thinnest pair we quote, not the most liquid one. */
|
|
22
|
+
export declare const ORACLE_KUCOIN_STALENESS_MS = 60000;
|
|
23
|
+
/** Per-tick sanity cap: reject prints whose delta vs the last *observed*
|
|
24
|
+
* price exceeds this. Bounded so a single rogue print cannot poison the
|
|
25
|
+
* on-chain median. Deliberately measured against the last observation
|
|
26
|
+
* rather than the last successful push — basing it on the push makes the
|
|
27
|
+
* gate an absorbing state, since a failed submit then freezes the baseline
|
|
28
|
+
* forever (see ORACLE_CONFIRMING_SAMPLES). */
|
|
21
29
|
export declare const ORACLE_MAX_DELTA_BPS_PER_TICK = 200;
|
|
22
30
|
/** Minimum interval between two consecutive on-chain pushes for one symbol. */
|
|
23
31
|
export declare const ORACLE_MIN_INTERVAL_BETWEEN_PUSHES_MS = 500;
|
|
@@ -25,9 +33,24 @@ export declare const ORACLE_MIN_INTERVAL_BETWEEN_PUSHES_MS = 500;
|
|
|
25
33
|
export declare const ORACLE_MAX_PUSHES_PER_MINUTE = 60;
|
|
26
34
|
/** HTTP fetch timeout for upstream CEX calls. */
|
|
27
35
|
export declare const ORACLE_FETCH_TIMEOUT_MS = 2000;
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
36
|
+
/** Consecutive agreeing samples required before an out-of-band move is
|
|
37
|
+
* accepted as genuine and the outlier baseline re-bases onto it. One rogue
|
|
38
|
+
* print is discarded when the next tick disagrees with it; a real move is
|
|
39
|
+
* adopted after this many samples. This is what keeps the delta gate from
|
|
40
|
+
* latching permanently. */
|
|
30
41
|
export declare const ORACLE_CONFIRMING_SAMPLES = 2;
|
|
42
|
+
/** Publish unconditionally when the last on-chain push is older than this,
|
|
43
|
+
* bypassing the delta gate. A stale price halts the market outright at the
|
|
44
|
+
* router's staleness/quorum gates, whereas a moved price is still a price —
|
|
45
|
+
* so the publisher fails toward freshness. Must stay well under the
|
|
46
|
+
* router's `staleness_threshold`. */
|
|
47
|
+
export declare const ORACLE_FORCE_PUBLISH_AFTER_MS = 20000;
|
|
48
|
+
/** Bounded retries for a failed on-chain submit (TRY_AGAIN_LATER and other
|
|
49
|
+
* transient RPC/congestion failures). `set_price` is a blind overwrite, so
|
|
50
|
+
* a duplicate landing is harmless and retrying is safe. */
|
|
51
|
+
export declare const ORACLE_SUBMIT_RETRIES = 2;
|
|
52
|
+
/** Base backoff between submit retries; doubles per attempt. */
|
|
53
|
+
export declare const ORACLE_SUBMIT_RETRY_BACKOFF_MS = 250;
|
|
31
54
|
/** User-Agent string sent to upstream CEX APIs. */
|
|
32
55
|
export declare const ORACLE_USER_AGENT = "stellars-oracle/0.1";
|
|
33
56
|
/** Max fee in stroops the keeper will pay per Soroban submission. */
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":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,CAAC;AAC5C,yEAAyE;AACzE,eAAO,MAAM,+BAA+B,cAAiB,CAAC;AAC9D,mDAAmD;AACnD,eAAO,MAAM,+BAA+B,QAAS,CAAC;AACtD,mCAAmC;AACnC,eAAO,MAAM,gCAAgC,OAAQ,CAAC;AACtD,2EAA2E;AAC3E,eAAO,MAAM,iCAAiC,OAAQ,CAAC;AACvD,mFAAmF;AACnF,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAMnD,6DAA6D;AAC7D,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAChD,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AAMxC,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,8CAA8C;AAC9C,eAAO,MAAM,yBAAyB,OAAQ,CAAC;AAC/C,gCAAgC;AAChC,eAAO,MAAM,wBAAwB,QAAS,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -23,11 +23,19 @@ export const PRECISION = 10000000n;
|
|
|
23
23
|
// ---------------------------------------------------------------------------
|
|
24
24
|
/** Polling interval for CEX REST APIs. */
|
|
25
25
|
export const ORACLE_POLL_INTERVAL_MS = 1_000;
|
|
26
|
-
/** Reject CEX prints whose embedded source-timestamp is older than this.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
/** Reject CEX prints whose embedded source-timestamp is older than this.
|
|
27
|
+
* NOTE: KuCoin's level1 `time` is when the top of book last *changed*, not
|
|
28
|
+
* when the data was served. A thin pair (XLM-USDT) legitimately holds the
|
|
29
|
+
* same best bid/ask for tens of seconds, so a tight bound here rejects a
|
|
30
|
+
* perfectly good price and starves that market's feed entirely. Sized for
|
|
31
|
+
* the thinnest pair we quote, not the most liquid one. */
|
|
32
|
+
export const ORACLE_KUCOIN_STALENESS_MS = 60_000;
|
|
33
|
+
/** Per-tick sanity cap: reject prints whose delta vs the last *observed*
|
|
34
|
+
* price exceeds this. Bounded so a single rogue print cannot poison the
|
|
35
|
+
* on-chain median. Deliberately measured against the last observation
|
|
36
|
+
* rather than the last successful push — basing it on the push makes the
|
|
37
|
+
* gate an absorbing state, since a failed submit then freezes the baseline
|
|
38
|
+
* forever (see ORACLE_CONFIRMING_SAMPLES). */
|
|
31
39
|
export const ORACLE_MAX_DELTA_BPS_PER_TICK = 200;
|
|
32
40
|
/** Minimum interval between two consecutive on-chain pushes for one symbol. */
|
|
33
41
|
export const ORACLE_MIN_INTERVAL_BETWEEN_PUSHES_MS = 500;
|
|
@@ -35,9 +43,24 @@ export const ORACLE_MIN_INTERVAL_BETWEEN_PUSHES_MS = 500;
|
|
|
35
43
|
export const ORACLE_MAX_PUSHES_PER_MINUTE = 60;
|
|
36
44
|
/** HTTP fetch timeout for upstream CEX calls. */
|
|
37
45
|
export const ORACLE_FETCH_TIMEOUT_MS = 2_000;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
46
|
+
/** Consecutive agreeing samples required before an out-of-band move is
|
|
47
|
+
* accepted as genuine and the outlier baseline re-bases onto it. One rogue
|
|
48
|
+
* print is discarded when the next tick disagrees with it; a real move is
|
|
49
|
+
* adopted after this many samples. This is what keeps the delta gate from
|
|
50
|
+
* latching permanently. */
|
|
40
51
|
export const ORACLE_CONFIRMING_SAMPLES = 2;
|
|
52
|
+
/** Publish unconditionally when the last on-chain push is older than this,
|
|
53
|
+
* bypassing the delta gate. A stale price halts the market outright at the
|
|
54
|
+
* router's staleness/quorum gates, whereas a moved price is still a price —
|
|
55
|
+
* so the publisher fails toward freshness. Must stay well under the
|
|
56
|
+
* router's `staleness_threshold`. */
|
|
57
|
+
export const ORACLE_FORCE_PUBLISH_AFTER_MS = 20_000;
|
|
58
|
+
/** Bounded retries for a failed on-chain submit (TRY_AGAIN_LATER and other
|
|
59
|
+
* transient RPC/congestion failures). `set_price` is a blind overwrite, so
|
|
60
|
+
* a duplicate landing is harmless and retrying is safe. */
|
|
61
|
+
export const ORACLE_SUBMIT_RETRIES = 2;
|
|
62
|
+
/** Base backoff between submit retries; doubles per attempt. */
|
|
63
|
+
export const ORACLE_SUBMIT_RETRY_BACKOFF_MS = 250;
|
|
41
64
|
/** User-Agent string sent to upstream CEX APIs. */
|
|
42
65
|
export const ORACLE_USER_AGENT = "stellars-oracle/0.1";
|
|
43
66
|
// ---------------------------------------------------------------------------
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8EAA8E;AAC9E,qDAAqD;AACrD,8EAA8E;AAE9E,oCAAoC;AACpC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAC3C,mDAAmD;AACnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,qEAAqE;AACrE,MAAM,CAAC,MAAM,SAAS,GAAG,SAAW,CAAC;AAErC,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,0CAA0C;AAC1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAC7C
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8EAA8E;AAC9E,qDAAqD;AACrD,8EAA8E;AAE9E,oCAAoC;AACpC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAC3C,mDAAmD;AACnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,qEAAqE;AACrE,MAAM,CAAC,MAAM,SAAS,GAAG,SAAW,CAAC;AAErC,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,0CAA0C;AAC1C,MAAM,CAAC,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