Release: develop -> main#4366
Merged
Merged
Conversation
…4358) * fix(liquidity): include balance amounts in exchange rejection errors When an exchange rejects an order for insufficient balance, the adapters re-threw the raw exchange message. The replenish step that many actions chain via onFail (LiquidityPipelineAdapter.buy) recovers the shortfall by parsing "(balance: X, min. requested: Y, max. requested: Z)" out of the previous order's error message. The local pre-check in the same methods already emits that format; the exchange-rejection branch did not. The parse then failed, the step threw a generic Error, the pipeline failed and the whole rule was paused - including its opposite direction, since pause is per rule. Append the structured suffix in the balance-too-low branches, reusing each method's own pre-check values: ccxt-exchange (withdraw, buy, sell, transfer; inherited by Binance, MEXC, Kraken, XT) and scrypt (withdraw, buy). Only the message is extended - control flow, exception types and amounts are untouched. ScryptAdapter.executeSell is left as is: the values are not in its scope, and the only Scrypt sell action in production has no onFail chaining, so its message never reaches the parser. * test(liquidity): move parser spec to __tests__ and cover noisy raw messages Follow-up to review feedback: - Move liquidity-pipeline.adapter.spec.ts into __tests__/, matching the convention of the other adapter specs (imports adjusted). - Add a case where the raw exchange message contains parentheses/JSON before the appended suffix, locking in that the parser still extracts the right amounts (the regex anchors on the literal appended at the end). - Apply prettier formatting. - Document in ScryptAdapter.executeSell why the structured suffix is deliberately omitted there: the values are not in scope, and the only production Scrypt sell action has no onFail/onSuccess chain, so its message never reaches the parser.
github-actions
Bot
requested review from
TaprootFreak and
davidleomay
as code owners
July 24, 2026 13:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatic Release PR
This PR was automatically created after changes were pushed to develop.
Commits: 1 new commit(s)
Checklist