Data EngineeringText-to-SQLCrypto

Turning a Generic Text-to-SQL Tool into a Business-Aware Analytics Assistant for a Leading Indian Crypto Platform

Author: Team Aays3-5 min readUpdated: Sep 2, 2026

AI powered analytics platform

Discover how Aays reconfigured a generic text-to-SQL tool into a business-aware analytics assistant for one of India's leading crypto platforms, enabling non-technical teams to explore user funnels and campaign performance without waiting on the data team.

6 Funnel Stages Mapped

From signup to NAP, tracked end-to-end

67 Benchmark Queries

Built and tested to validate real business questions

5 Key Metrics Standardized

Conversion rates, stage transitions, D5 trends, and more

About the Client

Our client is one of India's largest cryptocurrency platforms, trusted by over 1.5 crore registered users to invest, trade, and learn about crypto. Their platform spans 500+ digital assets across buying and selling, futures and options trading, and passive earning products, alongside a crypto academy that helps first-time users navigate the space with confidence. Operating in a heavily regulated environment, they maintain strict compliance and security standards, including FIU registration and ISO/IEC 27001 certification. As one of the top players in India's crypto industry, they process significant trading volumes daily, making fast, reliable access to internal data critical for every business decision.

The Problem

Could Business Teams Answer Their Own Data Questions?

Every time business teams needed insight into user funnels, campaign performance, or conversion rates, they had to submit a request to the data team and wait. Non-technical users had no way to explore user behavior on their own, which meant they couldn't spot conversion drop-offs, test hypotheses, or react quickly when something looked off.

The client already had a natural language query tool. It just wasn't set up for their business:

Missing Business Context

No table or column descriptions, so the tool couldn't generate accurate queries.

Undefined Domain Terms

Concepts like "PAN verification" or "D5 conversion rate" had no meaning to the system until someone defined them manually.

No Learning Loop

Incorrect SQL needed manual correction and re-feeding into the system every time, which slowed everything down.

The root issue was that a generic tool had never been configured to understand this specific business. Without metadata, defined terms, and real queries to test against, it had no way to reliably translate business questions into SQL.

The Solution

Building a Business-Aware, Self-Tuning Analytics Assistant

Rather than treating text-to-SQL as something you switch on, we treated it as something you have to teach. We ran a structured, iterative process to align the tool with how this business actually works:

  1. Understand the business. We ran exploratory data analysis and mapped the client's core funnel, Signup → PAN → KYC → Bank Verification → INR Deposit → NAP, to specific columns in the database.
  2. Define the metrics. We configured the key metrics teams actually cared about: conversion rates, stage transitions, D5 trends, IQR-based anomaly detection, and associated changes across stages, so the tool could interpret business logic embedded in plain-English questions.
  3. Build a query benchmark. We wrote and tested 67 natural language queries covering funnel metrics, time-based analysis, trend and anomaly detection, and schema understanding, giving us a real yardstick for accuracy instead of internal guesswork.
  4. Run an iterative alignment loop. We repeated a cycle of clarifying usage context, adding terms and formulas, annotating the schema, testing queries, and evaluating results, saving successful query pairs as reusable examples along the way.
  5. Enable manual overrides and learning. We built a feedback mechanism so incorrect SQL could be corrected by the team and fed back into the system, creating a loop that made the tool smarter over time.

What made this work:

Richer Schema Metadata

Detailed table and column descriptions, including filter conditions and assumptions, gave the tool real business context to draw on.

Domain-Defined Terms

Business-specific language was explicitly defined so the tool stopped guessing what users meant.

A Closed Feedback Loop

Manual corrections fed back into the system, steadily improving accuracy over time.

The Impact

By reconfiguring the tool around how the business actually operates, teams could explore funnel data, test hypotheses, and investigate anomalies directly, without waiting on the data team for every question.

6 Funnel Stages

Fully mapped from signup to NAP for structured tracking

67 Queries Validated

Benchmarked against real business questions before rollout

5 Metrics Standardized

Common definitions any team could query without help

Why It Matters

For a fast-growing crypto platform, speed matters as much as accuracy. Teams that once waited on the data team for basic funnel insights can now explore user behavior and catch anomalies themselves. It's proof that self-serve analytics isn't about swapping in a smarter model, it's about giving the model the business context it needs to actually be trusted.