Inspiration

While researching corporate banking workflows, we discovered a shocking inefficiency: Post-closing loan management is still manual.

Banks lend millions, but once the deal is signed, they track critical financial health markers (covenants) using static spreadsheets. A CFO has to manually export data from accounting software, type it into Excel, print a Word document, sign it, and email it to the bank. This process happens 100+ times over the life of a single loan.

We realized that one missed data point or calculation error could hide a default, costing millions. We asked: "Why can't the loan agreement 'talk' to the accounting software?" That was the spark for Live Covenant Monitor.

What it does

Live Covenant Monitor is an end-to-end automation platform that ensures borrowers never accidentally breach a loan agreement.

  • 📄 AI Contract Extraction: Users drag-and-drop a 50-page PDF Facility Agreement. Our system uses OpenAI (GPT-4) to extract complex financial covenants (e.g., "Leverage Ratio must not exceed 4.0x"), definitions, and reporting deadlines.
  • 🔄 Real-Time Financial Sync: Instead of manual data entry, the app connects directly to the borrower's QuickBooks Online via OAuth2. It pulls live P&L and Balance Sheet data (EBITDA, Total Debt, Cash, Interest Expense).
  • 🧮 Auto-Calculation & Alerts: The system runs the math instantly. If a borrower's Leverage Ratio hits 3.9x (dangerously close to the 4.0x limit), it sends an early warning alert 90 days before the official test date.
  • ✍️ One-Click Compliance: It automatically generates the official LMA Schedule 8 Compliance Certificate as a PDF—pre-filled with the correct calculations—ready for the CFO to e-sign.

How we built it

We built a robust desktop application using Python as our core engine.

  1. Backend: We used Flask to handle the OAuth2 handshake with Intuit (QuickBooks) and manage the local SQLite database.
  2. AI Engine: We implemented pdfplumber to extract raw text from loan agreements, then piped that text into the OpenAI API with strict prompt engineering to structure the legal jargon into JSON covenant rules.
  3. Frontend: The user interface is built with PyQt5, providing a responsive, professional dashboard that banks expect.
  4. Reporting: We used ReportLab to programmatically generate the legal PDF compliance certificates based on the live data.

Challenges we ran into

  • Legal Jargon vs. AI: Loan agreements are dense. Teaching the AI to distinguish between "Total Net Debt" and "Total Senior Debt" was difficult. We had to iterate on our system prompts to ensure the extraction was 100% accurate.
  • The "Stepped Covenant" Problem: Real loans change rules over time (e.g., limit is 4.5x in Year 1, but drops to 3.5x in Year 3). We had to build a custom logic engine to handle these time-based thresholds instead of static numbers.
  • QuickBooks OAuth2: Handling the token refresh flow within a desktop application context required some creative engineering to ensure the user stays authenticated without constant logins.

Accomplishments that we're proud of

  • True End-to-End Automation: We didn't just build a dashboard; we closed the loop. From a raw PDF contract to a signed legal certificate without a single manual calculation.
  • Accuracy: Our parser successfully handles complex "stepped" covenants that change year-over-year.
  • Speed: What usually takes a finance team 4–5 hours per quarter now takes less than 5 minutes.

What we learned

  • Fintech is 90% Trust: The technology is useless if the bank doesn't trust the math. We learned the importance of "showing our work"—our generated PDFs include the detailed calculation breakdown, not just the final result.
  • Data Standardization: Mapping the messy chart of accounts from a small business's QuickBooks to the rigid definitions of an LMA Facility Agreement is an art form.

What's next for Live covenant monitoring

  • Multi-Bank Support: Integrating Xero and Sage to support a wider range of borrowers.
  • Lender Portal: Building a "Bank View" where a credit officer can see the real-time health of their entire €500M portfolio on one map.
  • Predictive AI: Using historical cash flow trends to predict a covenant breach 6 months in advance, giving the bank and borrower time to renegotiate before a crisis.

Built With

Share this project:

Updates