@riocrypto/common 1.0.2594 → 1.0.2595
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.
|
@@ -15,8 +15,22 @@ export interface FXTrade {
|
|
|
15
15
|
price: number;
|
|
16
16
|
provider: FXProvider;
|
|
17
17
|
partiallyFilledOrderTTL: number;
|
|
18
|
+
/**
|
|
19
|
+
* Operative settlement (what the trade is *hedged* at upstream).
|
|
20
|
+
* Equals the underlying settlement unless the matched FX trading
|
|
21
|
+
* policy band carries a `tradeAsTwoWaySettlementDateOffset` override
|
|
22
|
+
* (or a cosigner-alternative approval swapped the tenor).
|
|
23
|
+
*/
|
|
18
24
|
twoWaySettlementDateOffset: number;
|
|
19
25
|
twoWaySettlementDate: Date;
|
|
26
|
+
/**
|
|
27
|
+
* Customer-facing settlement derived from the underlying order(s).
|
|
28
|
+
* Optional for backwards-compat with trades created before this
|
|
29
|
+
* field existed; readers fall back to `twoWaySettlementDate*` when
|
|
30
|
+
* missing.
|
|
31
|
+
*/
|
|
32
|
+
underlyingTwoWaySettlementDateOffset?: number;
|
|
33
|
+
underlyingTwoWaySettlementDate?: Date;
|
|
20
34
|
executedTrades: {
|
|
21
35
|
status: ExternalTradeStatus;
|
|
22
36
|
amount: number;
|
|
@@ -15,12 +15,28 @@ import { Side } from "./side";
|
|
|
15
15
|
* approval workflow (Emarkets, Transnetwork, StoneX). For Matching / Other
|
|
16
16
|
* the runtime always treats this band as automatic regardless of the
|
|
17
17
|
* stored value.
|
|
18
|
+
*
|
|
19
|
+
* `tradeAsTwoWaySettlementDateOffset` is an optional hedge-tenor override.
|
|
20
|
+
* When set, the band declares "match this band by the order's own offset,
|
|
21
|
+
* but place the hedge as if it were this offset instead" - useful when ops
|
|
22
|
+
* wants to hedge T+0 orders as T+1 (or vice versa) for liquidity reasons.
|
|
23
|
+
* It affects:
|
|
24
|
+
* - the offset / value-date sent to the upstream provider at placement;
|
|
25
|
+
* - provider eligibility (`isProviderEligible` is checked against the
|
|
26
|
+
* effective offset, so a T+0 band that overrides to T+1 can use StoneX
|
|
27
|
+
* even though StoneX refuses T+0).
|
|
28
|
+
* It does NOT touch the customer-facing `twoWaySettlementDate` /
|
|
29
|
+
* `twoWaySettlementDateOffset` on the order or the FX trade - those
|
|
30
|
+
* always reflect what the customer was promised. Only allowed for
|
|
31
|
+
* Emarkets / Transnetwork / StoneX (Matching / Other have no upstream
|
|
32
|
+
* tenor to override).
|
|
18
33
|
*/
|
|
19
34
|
export interface FXTradingPolicyAmountRange {
|
|
20
35
|
minAmount: number;
|
|
21
36
|
maxAmount: number;
|
|
22
37
|
provider: FXProvider;
|
|
23
38
|
automatic: boolean;
|
|
39
|
+
tradeAsTwoWaySettlementDateOffset?: number;
|
|
24
40
|
}
|
|
25
41
|
/**
|
|
26
42
|
* One time-of-day window within a (fiat, settlement offset, side) policy.
|
|
@@ -101,10 +117,17 @@ export type FXTradingPolicies = {
|
|
|
101
117
|
* the next FX-trade status (e.g. cosigner-notification, alternative
|
|
102
118
|
* approval) build a synthetic `ResolvedFXProvider` because the
|
|
103
119
|
* threshold is irrelevant to that decision.
|
|
120
|
+
*
|
|
121
|
+
* `tradeAsTwoWaySettlementDateOffset` mirrors the field on the matched
|
|
122
|
+
* `FXTradingPolicyAmountRange`. When present the caller must persist
|
|
123
|
+
* it onto the FX trade and use it at placement time in place of the
|
|
124
|
+
* trade's `twoWaySettlementDateOffset`. Absent means "place at the
|
|
125
|
+
* trade's own tenor", which is the existing behavior.
|
|
104
126
|
*/
|
|
105
127
|
export interface ResolvedFXProvider {
|
|
106
128
|
provider: FXProvider;
|
|
107
129
|
automatic: boolean;
|
|
130
|
+
tradeAsTwoWaySettlementDateOffset?: number;
|
|
108
131
|
}
|
|
109
132
|
/**
|
|
110
133
|
* Full output of `resolveFXProviderForAmount`. Adds the time-window's
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Country } from "./country";
|
|
2
2
|
import { DeferredPaymentType } from "./deferred-payment-type";
|
|
3
|
-
import { EmarketsSettlementType } from "./emarkets-settlement-type";
|
|
4
3
|
import { Fiat } from "./fiat";
|
|
5
4
|
import { FXProvider } from "./fx-provider";
|
|
6
5
|
import { FXTradingPolicies } from "./fx-trading-policy";
|
|
7
6
|
import { Processor } from "./processor";
|
|
8
|
-
import { TransnetworkSettlementType } from "./transnetwork-settlement-type";
|
|
9
7
|
import { Side } from "./side";
|
|
10
8
|
import { TVFXDataProvider } from "./TV-FX-data-provider";
|
|
11
9
|
export interface RioSettings {
|
|
@@ -48,10 +46,6 @@ export interface RioSettings {
|
|
|
48
46
|
fxProviders: {
|
|
49
47
|
[key in FXProvider]: {
|
|
50
48
|
enabled: boolean;
|
|
51
|
-
defaultSettlementType?: {
|
|
52
|
-
buy: EmarketsSettlementType | TransnetworkSettlementType;
|
|
53
|
-
sell: EmarketsSettlementType | TransnetworkSettlementType;
|
|
54
|
-
};
|
|
55
49
|
};
|
|
56
50
|
};
|
|
57
51
|
/**
|
|
@@ -17,8 +17,6 @@ export declare enum UserAttribute {
|
|
|
17
17
|
DisburseMorningSellOrdersWithoutCosigner = "disburseMorningSellOrdersWithoutCosigner",
|
|
18
18
|
DisburseEveningBuyOrdersWithoutCosigner = "disburseEveningBuyOrdersWithoutCosigner",
|
|
19
19
|
DisburseEveningSellOrdersWithoutCosigner = "disburseEveningSellOrdersWithoutCosigner",
|
|
20
|
-
PlaceBuyOrderAutoFXWithoutCosigner = "placeBuyOrderAutoFXWithoutCosigner",
|
|
21
|
-
PlaceSellOrderAutoFXWithoutCosigner = "placeSellOrderAutoFXWithoutCosigner",
|
|
22
20
|
UseFireblocksOvernightAndWeekendVault = "useFireblocksOvernightAndWeekendVault",
|
|
23
21
|
SkipPeriodicWalletComplianceCheck = "skipPeriodicWalletComplianceCheck",
|
|
24
22
|
UseSTPForMXNWithdrawals = "useSTPForMXNWithdrawals",
|
|
@@ -21,8 +21,6 @@ var UserAttribute;
|
|
|
21
21
|
UserAttribute["DisburseMorningSellOrdersWithoutCosigner"] = "disburseMorningSellOrdersWithoutCosigner";
|
|
22
22
|
UserAttribute["DisburseEveningBuyOrdersWithoutCosigner"] = "disburseEveningBuyOrdersWithoutCosigner";
|
|
23
23
|
UserAttribute["DisburseEveningSellOrdersWithoutCosigner"] = "disburseEveningSellOrdersWithoutCosigner";
|
|
24
|
-
UserAttribute["PlaceBuyOrderAutoFXWithoutCosigner"] = "placeBuyOrderAutoFXWithoutCosigner";
|
|
25
|
-
UserAttribute["PlaceSellOrderAutoFXWithoutCosigner"] = "placeSellOrderAutoFXWithoutCosigner";
|
|
26
24
|
UserAttribute["UseFireblocksOvernightAndWeekendVault"] = "useFireblocksOvernightAndWeekendVault";
|
|
27
25
|
UserAttribute["SkipPeriodicWalletComplianceCheck"] = "skipPeriodicWalletComplianceCheck";
|
|
28
26
|
UserAttribute["UseSTPForMXNWithdrawals"] = "useSTPForMXNWithdrawals";
|