@riocrypto/common-server 1.0.2789 → 1.0.2790
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.
|
@@ -35,19 +35,6 @@ const NON_COSIGNER_PROVIDERS = new Set([
|
|
|
35
35
|
common_1.FXProvider.Matching,
|
|
36
36
|
common_1.FXProvider.Other,
|
|
37
37
|
]);
|
|
38
|
-
/**
|
|
39
|
-
* Providers for which a `tradeAsTwoWaySettlementDateOffset` override on
|
|
40
|
-
* the band is meaningful. Matching is internal book netting and has no
|
|
41
|
-
* upstream tenor; Other is the manual fallback. The runtime ignores the
|
|
42
|
-
* override for these providers even if it was somehow persisted on the
|
|
43
|
-
* band, so a stale value can never accidentally affect routing.
|
|
44
|
-
*/
|
|
45
|
-
const PROVIDERS_SUPPORTING_TRADE_AS_OVERRIDE = new Set([
|
|
46
|
-
common_1.FXProvider.Emarkets,
|
|
47
|
-
common_1.FXProvider.Transnetwork,
|
|
48
|
-
common_1.FXProvider.StoneX,
|
|
49
|
-
]);
|
|
50
|
-
const isOverrideAllowedForProvider = (provider) => PROVIDERS_SUPPORTING_TRADE_AS_OVERRIDE.has(provider);
|
|
51
38
|
const FALLBACK_RESOLUTION = {
|
|
52
39
|
provider: common_1.FXProvider.Other,
|
|
53
40
|
automatic: true,
|
|
@@ -289,10 +276,11 @@ const resolveFXProviderForAmount = (policy, fiat, amountFiat, offset, now = new
|
|
|
289
276
|
// when set, otherwise the trade's own offset). This lets an operator
|
|
290
277
|
// route a T+0 band to StoneX by overriding to T+1, or a T+3 band to
|
|
291
278
|
// Emarkets/Transnetwork by overriding to T+2 - the upstream provider
|
|
292
|
-
// only ever sees the override.
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
279
|
+
// only ever sees the override. For Matching / Other the override is
|
|
280
|
+
// applied to the FX trade's operative settlement date (which is what
|
|
281
|
+
// matching nets by) even though those providers have no upstream
|
|
282
|
+
// value-date concept.
|
|
283
|
+
const tradeAsTwoWaySettlementDateOffset = matchedAmountRange.tradeAsTwoWaySettlementDateOffset;
|
|
296
284
|
const effectiveOffset = tradeAsTwoWaySettlementDateOffset !== null && tradeAsTwoWaySettlementDateOffset !== void 0 ? tradeAsTwoWaySettlementDateOffset : offset;
|
|
297
285
|
if (!isProviderEligible(matchedAmountRange.provider, fiat, amountFiat, effectiveOffset)) {
|
|
298
286
|
return Object.assign(Object.assign({}, FALLBACK_RESOLUTION), { executionThresholdMs });
|