Lakewright solutions / brief
Convert BAI2 bank balance files to Iceberg tables Snowflake can query
BAI2 balance-reporting files from your banks become typed Iceberg tables — account balances and transaction detail with typed amounts — queryable from Snowflake without hand-written parsers.
What is BAI2?
The Bank Administration Institute format for prior-day/intra-day balance reporting: comma-delimited records with positional meaning, continuation records, and control totals — close enough to CSV to fool tools, different enough to break them.
How are records handled?
Account records (03) and transaction detail (16) become rows carrying their file/group context; control totals (49/98/99) are available for reconciliation. Amounts convert from implied-decimal.
The steps
lakewright scan sftp-drop/treasury/ lakewright approve plans/treasury_bai.plan.yaml lakewright load plans/treasury_bai.plan.yaml --rest $CATALOG
FAQ
The question that matters
"Which accounts closed below their sweep threshold more than five times last month, and at which banks?"
Six accounts, at three banks, and one bank accounts for four of them.
The assistant answered from the generated dimensions — bank, account, closing balance, date — and ordered by breach count, then showed the average shortfall per account, which is what actually determines whether this is a threshold-tuning problem or a funding problem. In the sample data one account breaches often but narrowly, which is a threshold set too tight; another breaches rarely but deeply, which is a genuine liquidity event that nobody escalated at the time.
The numbers reconcile, because the control totals from the original BAI2 records landed alongside the detail and can be checked against the sum — which is the first thing treasury asks and the reason spreadsheet-based versions of this analysis get quietly distrusted.
Want this run against your data?
We start with a read-only scan and an inventory report — no installation on your systems, nothing leaves your environment. Most engagements produce findings the team didn't know about in the first afternoon.