Enumerate all bank accounts requiring intraday monitoring and store their internal identifiers; for each account, determine the bank's reporting mechanism — some banks offer real-time balance API endpoints, others deliver intraday BAI2 files via SFTP on a schedule (e.g., every 30-60 minutes), and others provide camt.052 intraday statements
Implement a polling loop that, for each account, calls the balance endpoint or retrieves the latest intraday file at the bank's stated refresh frequency; do not poll faster than the bank's update cadence as this returns stale data and may trigger rate-limit responses
Build a cash position model that combines: the prior-day closing ledger balance (from the overnight BAI2 or camt.053), plus intraday credits received (incoming wires, ACH settlements, lockbox credits), minus intraday debits posted (outgoing wires, ACH debits, fees), to produce a running available balance per account
Tag each balance observation with the as-of timestamp from the bank's response rather than the polling timestamp, since bank balance refreshes are batch cycles and the observed balance may be minutes old even when just retrieved
Aggregate individual account positions into a consolidated treasury position view; apply funding rules (e.g., if account A falls below threshold X, initiate a transfer from account B) based on the consolidated position rather than per-account balances in isolation
Alert on position anomalies: flag any account where the intraday available balance drops below the configured minimum operating buffer, and flag any account where intraday debits exceed the opening balance by more than an expected variance threshold
Known gotchas
Intraday BAI2 files delivered by banks on a schedule are cumulative within the day at some banks and delta-only at others — loading cumulative files multiple times without clearing previous intraday entries first produces doubled transaction entries and inflated balance calculations
Bank API balance endpoints frequently return the current ledger balance (all booked items) rather than available balance (ledger minus float and holds) — using ledger balance as the basis for payment authorization decisions can cause payments to fail due to holds that are excluded from ledger but reduce actual availability
Multi-bank treasury operations require mapping each bank's proprietary transaction codes and balance type codes to a common internal taxonomy before aggregation; without this normalization step, the consolidated position model sums incomparable balance types across banks
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp