Real-time fraud detection for trading
Fraud checks on hours-old copies catch fraud too late. Otterstax scores each transaction from Kafka as it arrives, with an ONNX model called as a SQL function, and replaces ETL plus separate analytical systems.
fraud after moving to real-time detection · trading customer
Otterstax in action
- Kafkatransactions
- Anti-fraud servicereads the score
SELECT t.id, t.amount, fraud_score(t.features) AS score
FROM kafka.transactions t
WHERE fraud_score(t.features) > 0.9; | id | amount | score |
|---|---|---|
| tx_81723 | 2,940.00 | 0.97 |
| tx_81741 | 1,120.50 | 0.93 |
Fraud in real time
Every transaction arrives from Kafka, without an ETL job or a copy in a warehouse.
An ONNX fraud model runs as a SQL function inside Otterstax (Enterprise) and scores the stream as it arrives.
The anti-fraud service reads the score as soon as the transaction lands, instead of about 2 hours later.
mysql://app@otterstax:8816unchangedSELECT u.country, COUNT(o.id) AS orders, SUM(o.total) AS revenue
FROM orders o
JOIN users u ON u.id = o.user_id
GROUP BY u.country
ORDER BY revenue DESC; | country | orders | revenue |
|---|---|---|
| US | 1,284 | 184,920.40 |
| DE | 702 | 96,311.75 |
| GB | 518 | 71,048.10 |
| FR | 391 | 52,776.00 |
| NL | 233 | 31,502.65 |
SELECT u.country, COUNT(o.id) AS orders, SUM(o.total) AS revenue
FROM orders o
JOIN users u ON u.id = o.user_id
GROUP BY u.country
ORDER BY revenue DESC; | country | orders | revenue |
|---|---|---|
| US | 1,284 | 184,920.40 |
| DE | 702 | 96,311.75 |
| GB | 518 | 71,048.10 |
| FR | 391 | 52,776.00 |
| NL | 233 | 31,502.65 |
Move a database without changing the app
- MariaDBorders
- PostgreSQLusers
- ClickHouseevents
- MongoDBcatalog
- ScyllaDBcarts
- S3archive
- Your appMariaDB driver
SELECT u.country, COUNT(o.id) AS orders, COUNT(e.id) AS sessions
FROM mariadb_prod.orders o
JOIN pg_billing.users u ON u.id = o.user_id
JOIN clickhouse_events.sessions e ON e.user_id = u.id
GROUP BY u.country; | country | orders | sessions |
|---|---|---|
| US | 1,284 | 9,870 |
| DE | 702 | 5,114 |
| GB | 518 | 3,902 |
One JOIN instead of glue code
The app opened a connection to every source and joined the results in its own code.
The same join is one SQL statement. The app connects to Otterstax with its usual MariaDB driver.
Otterstax pushes the work down to each source where the data lives and returns one result.
- Live data sourcesproduction
- Dashboards
- A/B tests
SELECT variant, COUNT(*) AS orders, SUM(total) AS revenue
FROM orders
WHERE created_at > now() - INTERVAL 1 HOUR
GROUP BY variant; | variant | orders | revenue |
|---|---|---|
| A | 412 | 38,204.10 |
| B | 447 | 41,950.75 |
Dashboards and A/B tests without ETL
ETL jobs copied data every 3 hours, so dashboards and A/B tests were up to 3 hours behind.
Dashboards and A/B tests query the live data sources through Otterstax.
The ETL jobs are gone, and results include what happened a moment ago.
- MariaDB
- PostgreSQL
- ClickHouse
- AI agentMCP
-- sent by the agent over MCP
SELECT c.name, SUM(p.amount) AS paid
FROM customers c
JOIN payments p ON p.customer_id = c.id
GROUP BY c.name; | name | paid |
|---|---|
| Acme Ltd | 12,400.00 |
| Northwind | 8,915.30 |
An AI agent reads production safely
The agent connects to one MCP gateway instead of a separate connector for every data source.
The agent reads the live sources, so there are no copies to drift apart.
Every MCP call runs with the user’s permissions and lands in the audit log (Enterprise).
every MCP call runs with the user’s permissions and is logged (Enterprise)
How it works for AI agents →Why teams trust Otterstax
In production
- Banking PostgreSQL → MariaDB migration, 80–100 TB, in 1 year instead of 2
- Payments 30–50% faster time-to-production for ML features
- Trading −36.8% fraud with real-time scoring in SQL
Security
- On-prem / self-hosted only
- no telemetry, no phone-home
- zero copy: queries run where the data lives
Talks
As presented at Internals Berlin 2025 and PyData Yerevan 2026
The problem
- Fraud detected about 2 hours after it happened.
- ETL plus several analytical systems to run and keep in sync.
What Otterstax does
- Transactions stream in from Kafka, and an ONNX model scores each one as a SQL function (Enterprise).
- Detection runs on live data instead of hours-old copies.
- Queries through one engine replace ETL and separate analytical systems.
A trading company
fraud after moving to real-time detection
time to detect fraud
Replaced ETL plus Greenplum, ClickHouse and Databricks with queries through one engine.
Read the customer story →The short version for whoever signs off
Money and speed
- −36.8%fraud after moving to real-time detection · a trading company
- 1 yearmigration time, instead of the estimated 2 · a fintech company
- 30–50%faster time-to-production for anti-fraud ML features · a payments company
Risk, taken off the table
- On-prem and self-hosted only, no telemetry: data never leaves your infrastructure.
- Apache 2.0 core: your team can read, audit and fork the code.
- Start with a 2-week pilot on your own data sources.
See Otterstax on your own data sources
In a 30-minute call we'll map your stack and show a working query across your data sources.