ibkr: emit ibkr_cash_balance{currency, account} per CashReport row
Each daily run now pushes one Pushgateway metric per currency row from the Flex Activity Query's CashReport section (typically BASE_SUMMARY aggregate + one row per held currency). Makes dormant-account balance checks trivial and adds a Grafana surface for cash drift alerting. Requires the Activity Flex Query in IBKR Client Portal to have the CashReport section enabled. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
17c2a69c6c
commit
3427f5c9e1
4 changed files with 59 additions and 0 deletions
4
tests/fixtures/ibkr/sample_flex.xml
vendored
4
tests/fixtures/ibkr/sample_flex.xml
vendored
|
|
@ -16,6 +16,10 @@
|
|||
<OpenPosition symbol="VUAG" position="8" markPrice="108.20" currency="GBP" assetCategory="STK"/>
|
||||
<OpenPosition symbol="AAPL" position="5" markPrice="181.00" currency="USD" assetCategory="STK"/>
|
||||
</OpenPositions>
|
||||
<CashReport>
|
||||
<CashReportCurrency accountId="U12345678" currency="BASE_SUMMARY" levelOfDetail="BaseCurrency" startingCash="1.23" endingCash="1.23" endingSettledCash="1.23"/>
|
||||
<CashReportCurrency accountId="U12345678" currency="USD" levelOfDetail="Currency" startingCash="1.23" endingCash="1.23" endingSettledCash="1.23"/>
|
||||
</CashReport>
|
||||
</FlexStatement>
|
||||
</FlexStatements>
|
||||
</FlexQueryResponse>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue