Skip to content
Datablare
Claude Code Banking Risk & compliance

Card transaction risk monitor

41,022 card transactions worth ₹16.73M, a 2.46% failure rate, and where failures concentrate by risk level and merchant.

Data
Synthetic retail bank demo data (PostgreSQL)
Asked in
Claude Code
Updated
Try this on your data

1 · The brief

What Claude Code was asked

I need a risk view of card transactions this year: volume and value, the failed-transaction rate and flagged transactions, how value and failures split across customer risk levels, the monthly trend, and which merchant categories fail most often.

Given exactly like this. Claude Code asked Datablare which tables it could read, wrote the SQL itself, ran each query through Datablare and built the dashboard from what came back.

2 · The dashboard

The dashboard Claude Code built

Card transaction risk monitor dashboard: Transaction value per month, Failed rate by customer risk level, Failed rate by merchant category, Monthly failed rate

Built from 4 read-only queries. Every figure on the dashboard was read from the database through Datablare; nothing was estimated or typed in.

Headline numbers (January–October 2026):

  • Transactions: 41,022 (2026 so far)
  • Transaction value: ₹16.73M (All channels)
  • Failed transactions: 2.46% (Share of all transactions)
  • Flagged for review: 180 (Held by fraud rules)

What stands out:

  • Transaction value per month: ₹36.55M since January 2025
  • Failed rate by customer risk level: High-risk customers fail 2.0× as often as low-risk
  • Failed rate by merchant category: Travel and Gaming fail most often
  • Monthly failed rate: Between 1.99% and 3.32% each month

The data is a synthetic retail bank dataset made for this example, so the numbers describe no real company. The queries, the dashboard and the audit entries are real: Claude reached the database only through Datablare, read-only, and every query is on record with the question it served.

3 · What Datablare ran

4 read-only queries, nothing changed

Each query below is copied from the audit log of this run. Datablare checked that it only reads, ran it read-only, and gave only the rows to Claude Code; it never stores them.

  1. Query 1

    Transaction count, value, failed rate and flagged count for 2026

    1 row · 240 ms

    SELECT count(*) AS transactions, round(sum(amount), 0) AS value,
           round(avg(CASE WHEN status = 'failed' THEN 1.0 ELSE 0 END), 4) AS failed_rate,
           count(*) FILTER (WHERE status = 'flagged') AS flagged
    FROM banking.transactions
    WHERE ts >= TIMESTAMP '2026-01-01'
  2. Query 2

    Value and failed rate by customer risk level, 2026

    3 rows · 116 ms

    SELECT cu.risk_level, count(DISTINCT cu.id) AS customers, round(sum(t.amount), 0) AS value,
           round(avg(CASE WHEN t.status = 'failed' THEN 1.0 ELSE 0 END), 4) AS failed_rate
    FROM banking.transactions t
    JOIN banking.cards c ON c.id = t.card_id
    JOIN banking.customers cu ON cu.id = c.customer_id
    WHERE t.ts >= TIMESTAMP '2026-01-01'
    GROUP BY 1
    ORDER BY 3 DESC
  3. Query 3

    Monthly transaction value and failed rate since January 2025

    22 rows · 243 ms

    SELECT to_char(date_trunc('month', ts), 'YYYY-MM') AS month, round(sum(amount), 0) AS value,
           round(avg(CASE WHEN status = 'failed' THEN 1.0 ELSE 0 END), 4) AS failed_rate
    FROM banking.transactions
    WHERE ts >= TIMESTAMP '2025-01-01'
    GROUP BY 1
    ORDER BY 1
  4. Query 4

    Failed-transaction rate by merchant category, 2026

    9 rows · 76 ms

    SELECT merchant_category, count(*) AS transactions,
           round(avg(CASE WHEN status = 'failed' THEN 1.0 ELSE 0 END), 4) AS failed_rate
    FROM banking.transactions
    WHERE ts >= TIMESTAMP '2026-01-01'
    GROUP BY 1
    ORDER BY 3 DESC
Tables read banking.cardsbanking.customersbanking.transactions

4 · The audit entry

Who asked what, on record

Every query is recorded with the person who asked, the question in their words and why the agent ran it. Admins see this in the audit log; nothing reaches the database without it.

How the audit log works

query_data_source

via Claude Code

Allowed
Who
The person signed in (hidden on this public page)
Question
I need a risk view of card transactions this year: volume and value, the failed-transaction rate and flagged transactions, how value and failures split across customer risk levels, the monthly trend, and which merchant categories fail most often.
Intent
Transaction count, value, failed rate and flagged count for 2026
Result
4 queries, 35 rows, read-only

More use cases

All examples
  • Customer activity by city and segment dashboard: Active customers per month, Approved value by city, 2026, Spend per active customer per month, Customers by city and risk level
    Claude Code Banking Customer analytics

    Customer activity by city and segment

    2,277 of 3,000 customers active this year, spend per active customer each month, value by city, and the risk mix in each city.

    Updated Open

  • Card spending mix and portfolio dashboard: Spend by merchant category, Transactions by channel, Spend by card brand and type, Average ticket by segment
    Claude Code Banking Revenue & growth

    Card spending mix and portfolio

    4,184 active cards with a ₹405 average ticket; Travel leads spend and 33% of transactions are online.

    Updated Open

  • E-commerce sales and retention dashboard dashboard: Monthly revenue, Revenue by category, 2026, Lifetime revenue per customer, by channel, Orders per month
    Claude Code E-commerce Executive overview

    E-commerce sales and retention dashboard

    ₹5.21M revenue from 11,897 orders this year, a 57.9% repeat-customer rate, and which channels bring the customers who spend most.

    Updated Open

Build this on your own data.

Connect your database, choose the tables Claude may read, and give it the same brief. Claude is connected in about two minutes.

30 minutes with the founder. Or WhatsApp / [email protected]