Implement precision error handling in MakerPointsEngine

- Added a new `isPrecisionError` function to identify precision-related errors in the error utility module.
- Updated the MakerPointsEngine to handle precision errors by logging warnings and synchronizing precision when such errors occur during order processing and stop-loss execution.
- Enhanced the `syncPrecision` method to allow forced synchronization, improving the handling of precision-related issues.
This commit is contained in:
discountry
2026-01-13 20:23:18 +08:00
parent 9866e8068f
commit 4915dc574e
2 changed files with 35 additions and 3 deletions
+24
View File
@@ -61,3 +61,27 @@ export function isInsufficientBalanceError(error: unknown): boolean {
message.includes("NOT ENOUGH")
);
}
export function isPrecisionError(error: unknown): boolean {
const message = extractMessage(error).toUpperCase();
return (
message.includes("PRECISION") ||
message.includes("TICK_SIZE") ||
message.includes("TICKSIZE") ||
message.includes("STEP_SIZE") ||
message.includes("STEPSIZE") ||
message.includes("LOT_SIZE") ||
message.includes("LOTSIZE") ||
message.includes("INVALID_QUANTITY") ||
message.includes("INVALID QUANTITY") ||
message.includes("QUANTITY_INVALID") ||
message.includes("INVALID_PRICE") ||
message.includes("INVALID PRICE") ||
message.includes("PRICE_INVALID") ||
message.includes("QTY_STEP") ||
message.includes("PRICE_TICK") ||
message.includes("DECIMAL") ||
message.includes("FILTER_FAILURE") ||
message.includes("NOTIONAL")
);
}