Skip to content

feat: carry Open Corridor nets below a per-currency minimum to a later settle - #2965

Open
hongwei1 wants to merge 2 commits into
OpenBankProject:developfrom
hongwei1:feat/open-corridor-min-settlement
Open

hongwei1 wants to merge 2 commits into
OpenBankProject:developfrom
hongwei1:feat/open-corridor-min-settlement

Conversation

@hongwei1

@hongwei1 hongwei1 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Adds open_corridor.min_settlement_amount.<CURRENCY>, the smallest net that is settled in a currency. When a pair's net is above zero but below it, POST /obp/v7.0.0/banks/BANK_ID/open-corridor/settlements answers 400 OBP-40068 before anything is written, so the promises stay PENDING and are covered together by a later settle once their net reaches the minimum (net zero still discharges as before; unset means no minimum). The outbox relay also parks the Bank Node's new OBP-BANK-NODE-SETTLEMENT-BELOW-MINIMUM reply as STICKY at once, since resending the same instruction cannot change it. Documented in sample.props.template and on the endpoint; a Cardano corridor needs a minimum above 1 ADA in its currency, e.g. open_corridor.min_settlement_amount.KES=50.

Tests: a new Http4s700RoutesTest scenario (7.00 under a 10.00 minimum is refused and stays PENDING, then 12.00 settles all three promises) and OpenCorridorReplyClassificationTest for the relay; Http4s700RoutesTest and DuplicatedMessages pass on H2. Also run on a local cluster with two Bank Nodes on Cardano preprod: with KES=50, a 20 KES net is refused and carried into the next settle, which reaches FINAL.

A Bank Node answers a settlement instruction whose net sizes to less than
one Cardano output with OBP-BANK-NODE-SETTLEMENT-BELOW-MINIMUM. The amount
is fixed by the instruction, so every resend gets the same answer: the
relay now parks the row STICKY at once for an operator instead of
retrying it until the attempt limit. The classification is a small
package-private function with its own test.
…r settle

open_corridor.min_settlement_amount.<CURRENCY> sets the smallest net that
is settled in a currency. When a pair's net is above zero but below it,
POST .../open-corridor/settlements is refused with OBP-40068 before
anything is written: the promises stay PENDING and are covered together
by a later settle once their net reaches the minimum. Unset means no
minimum, as before. Documented in sample.props.template and on the
endpoint.
@sonarqubecloud

sonarqubecloud Bot commented Nov 7, 2026

Copy link
Copy Markdown

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