fix: reconcile KIS exchange rejections

This commit is contained in:
jordan
2026-07-28 13:29:43 +09:00
parent 24c42d1c92
commit d6c2e2d28a
5 changed files with 89 additions and 7 deletions
+1 -1
View File
@@ -461,7 +461,7 @@ get_current_price(symbol: str, market: str = "J") -> Optional[Decimal]
- `filled` :: 전량 체결 → `pending_buy→holding` / `pending_sell→inactive` + 원장 1건.
- `cancelled`(체결 0 외부 취소) :: `is_terminal_reject` → 롤백(`pending_sell→holding` / `pending_buy→inactive`), `clear_dispatch` → 자동 재매도 가능.
- `partially_filled` + `cancelled=True`(부분 체결 후 외부 취소) :: `is_partial_cancel` → 체결분 원장 1회 기록 + 슬롯 qty 차감(매도: 잔여 held / 매수: 체결분만) + `holding` 복귀. 매도는 cost basis(`avg_price`) 유지.
- KIS 매핑: `inquire-daily-ccld` 응답 row 의 `cncl_yn="Y"` 를 취소로 해석한다(미지/부재 값은 보수적으로 비취소 처리, stale 워치독이 backstop).
- KIS 매핑: `inquire-daily-ccld` 응답 row 의 `cncl_yn="Y"` 를 취소로 해석한다(미지/부재 값은 보수적으로 비취소 처리, stale 워치독이 backstop). 체결수량이 0이고 `rjct_qty >= ord_qty > 0`이면 브로커 접수 뒤 거래소 전량거부로 해석해 `rejected`로 종료한다. `rjct_qty` 일부만으로는 미체결 잔여 상태를 추정하지 않는다.
## Interface: `MessagingTransport` (Protocol, BAT-007)