fix: 주간 리포트가 적립 입금을 수익으로 계산하던 문제 - #461
Merged
Merged
Conversation
performance_lens는 flows 인자로 유입을 중화할 수 있는데 주간 리포트가 그걸 안 넘겼다. 어제 kr_pocket에 적립 10만원을 넣자 NAV가 284,499 → 385,460이 됐고, 그날이 통째로 +35% 수익으로 계산됐다. 연환산 변동성 109.2% → 29.5% 샤프 +2.28 → -1.18 하락일 41% → 59% 리포트가 오너에게 '샤프 +2.28'이라고 말하고 있었다. 실제로는 -1.18이다. 방향이 반대라 숫자 하나 틀린 것과는 다르다 — 위험 지표가 정반대 결론을 주고 있었다. 어제 첫 적립을 넣기 전까지는 흐름이 없어서 드러나지 않았다. 적립식 트랙은 이 경로가 상시라 한 번 새면 매주 샌다. 호출부가 잊을 수 있는 인자였던 게 원인이라, 유입 수집을 account_flows_by_day로 빼고 테스트로 고정했다. 함수가 flows를 지원하는 것과 호출부가 실제로 넘기는 것은 다른 문제다 — 전자만 테스트하고 있었다. 국면 분해(aligned_returns)도 같은 인자를 쓰므로 함께 넘긴다.
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.
발견 경위
오너가 오늘 기준금리 인상(2.75% → 3.00%)의 영향을 물어서 지표를 뜯어보다 발견했다. 금리와는 무관한 버그다.
문제
core/performance_lens는flows인자로 외부 유입을 분모에서 중화할 수 있다. 그런데 주간 리포트 호출부가 그걸 안 넘겼다.어제 kr_pocket에 첫 적립 10만원을 넣자 NAV가 284,499 → 385,460이 됐고, 그 하루가 통째로 +35% 수익으로 계산됐다.
리포트가 오너에게 "샤프 +2.28"이라고 말하고 있었다. 부호가 반대다. 숫자 하나 틀린 것과 다른 층위의 문제다 — 위험 지표가 정반대 결론을 주고 있었다.
왜 이제 드러났나
어제 첫 적립을 넣기 전까지
cash_flows가 비어 있어서 중화할 게 없었다. 적립식 트랙은 이 경로가 상시라, 한 번 새면 매주 샌다.조치
호출부가 잊을 수 있는 인자였던 게 원인이라 유입 수집을
account_flows_by_day로 빼고 테스트로 고정했다.함수가
flows를 지원하는 것과 호출부가 실제로 넘기는 것은 다른 문제다. 기존 테스트는 전자만 보고 있었다(test_deposits_are_neutralised). 이번에 추가한 것:account_flows_by_day)국면 분해(
aligned_returns)도 같은 인자를 쓰므로 함께 넘긴다.전체 스위트 1987개 통과.