mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-10 08:48:07 +00:00
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:
@@ -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")
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user