Skip to content

Release: develop -> main#4366

Merged
TaprootFreak merged 1 commit into
mainfrom
develop
Jul 24, 2026
Merged

Release: develop -> main#4366
TaprootFreak merged 1 commit into
mainfrom
develop

Conversation

@github-actions

Copy link
Copy Markdown

Automatic Release PR

This PR was automatically created after changes were pushed to develop.

Commits: 1 new commit(s)

Checklist

  • Review all changes
  • Verify CI passes
  • Approve and merge when ready for production

…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.
@TaprootFreak
TaprootFreak merged commit eac3b88 into main Jul 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant