fix: scope USD buffer guard to US markets and add boundary tests

This commit is contained in:
agentson
2026-02-27 00:52:44 +09:00
parent 4d9f3e2cfc
commit b206c23fc9
2 changed files with 49 additions and 2 deletions

View File

@@ -437,7 +437,12 @@ def _should_block_overseas_buy_for_fx_buffer(
order_amount: float,
settings: Settings | None,
) -> tuple[bool, float, float]:
if market.is_domestic or action != "BUY" or settings is None:
if (
market.is_domestic
or not market.code.startswith("US")
or action != "BUY"
or settings is None
):
return False, total_cash - order_amount, 0.0
remaining = total_cash - order_amount
required = settings.USD_BUFFER_MIN