hedgequantx 2.9.67 → 2.9.68
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/package.json
CHANGED
|
@@ -88,13 +88,22 @@ const oneAccountMenu = async (service) => {
|
|
|
88
88
|
|
|
89
89
|
// Load contracts to find the saved symbol (match by baseSymbol first, then exact symbol)
|
|
90
90
|
const contractsResult = await accountService.getContracts();
|
|
91
|
-
if (contractsResult.success) {
|
|
91
|
+
if (contractsResult.success && contractsResult.contracts.length > 0) {
|
|
92
92
|
// Try baseSymbol match first (more stable across contract rolls)
|
|
93
|
-
|
|
93
|
+
if (lastConfig.baseSymbol) {
|
|
94
|
+
contract = contractsResult.contracts.find(c => c.baseSymbol === lastConfig.baseSymbol);
|
|
95
|
+
}
|
|
94
96
|
// Fall back to exact symbol match
|
|
95
|
-
if (!contract) {
|
|
97
|
+
if (!contract && lastConfig.symbol) {
|
|
96
98
|
contract = contractsResult.contracts.find(c => c.symbol === lastConfig.symbol);
|
|
97
99
|
}
|
|
100
|
+
// Last resort: try to extract base symbol from saved symbol (e.g., MESH6 -> MES)
|
|
101
|
+
if (!contract && lastConfig.symbol) {
|
|
102
|
+
const extractedBase = lastConfig.symbol.replace(/[A-Z]\d+$/, '');
|
|
103
|
+
if (extractedBase) {
|
|
104
|
+
contract = contractsResult.contracts.find(c => c.baseSymbol === extractedBase);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
98
107
|
}
|
|
99
108
|
|
|
100
109
|
// Find strategy
|