Setting Up KYT and AML Monitoring for Regulated DeFi

Key Takeaways
- KYT (Know Your Transaction) and AML monitoring are two distinct controls — regulators require both; most DeFi protocols run neither correctly
- Setup has two parts: the ChainAware Pixel (one script tag, detects wallet connections) and the Compliance Screener API/MCP (runs the actual compliance check)
- You do not need to identify users to run MiCA-compliant AML monitoring — wallet address behavioural scoring covers the obligations that apply to non-custodial DeFi
- Covers Ethereum, BNB Chain, Base, Polygon, TON, Tron, and HAQQ


Before You Start: KYT vs AML

These two terms are used interchangeably in vendor marketing. They are legally distinct controls that work differently and catch different things.

AML screening checks fund origins against sanctions lists and known-bad address clusters. It is backward-looking — it only catches funds that have already been flagged somewhere. A wallet that launders through clean, unflagged addresses passes AML screening without triggering a flag.

KYT (Know Your Transaction) scores the behavioural patterns of every transaction in real time — independent of whether any address in the chain has ever been flagged. It catches fraud committed with clean funds.

FATF, MiCA, and FinCEN require both as separate controls. An estimated 50,000–80,000 VASPs are legally required to run KYT independently from AML screening. Because the two are routinely conflated, most are not.

ChainAware runs both through the same compliance engine, accessed via the Compliance Screener API or MCP. The ChainAware Pixel handles wallet detection on the front end — it feeds the wallet address into your compliance pipeline.


Two Parts to the Setup

ChainAware Pixel Server-side track calls Compliance Screener API / MCP
What it does Detects wallet connections, tracks sessions and tool events Same as pixel — POST to /v2/track from your backend Runs the AML, KYT, sanctions and fraud checks
Where it runs Dapp front end — one script tag Your backend Your backend, AI agent pipeline, or direct API call
Engineering required One <script> tag + one init() call POST request on wallet connect event API key + POST request or MCP connection
Output Wallet address, session data → ChainAware Same Structured JSON Compliance Report: PASS / EDD / REJECT
Use when Standard Dapp Protocol policy: no client-side wallet instrumentation at all Always — this is the compliance check

Use the pixel or server-side track calls for wallet detection — not both. The Compliance Screener is always required for the actual AML/KYT check.


Part 1 — Pixel Setup

The ChainAware Pixel detects wallet connections across EVM chains and Solana. It is a single script tag — no GTM, no backend changes.

Step 1 — Embed the pixel

v2-track.js is provided directly by ChainAware — contact us to receive the file. Bundle it into your own codebase and add to your HTML <head>:

<script src="/your-bundle/v2-track.js" defer></script>

Step 2 — Initialise with your client ID

Call init() after the DOM is ready. Your client ID is in your ChainAware dashboard.

// Angular (SSR-safe)
afterNextRender(() => {
  (window as any).chainAwareTrack?.init('your-client-id');
});
// React
useEffect(() => {
  (window as any).chainAwareTrack?.init('your-client-id');
}, []);
// Plain JS / HTMX
document.addEventListener('DOMContentLoaded', () => {
  window.chainAwareTrack.init('your-client-id');
});

The pixel automatically detects wallet connections from WalletConnect, MetaMask, RainbowKit, Web3Modal, Wagmi, and Solana wallets. When a wallet connects, the address and chain are posted to api.chainaware.ai/v2/track — this is what makes the wallet address available for your compliance check.

Step 3 — Report tool events (optional)

If you surface ChainAware tools to users (fraud detector, token audit, wallet auditor), report their lifecycle events for analytics:

window.chainAwareTrack.reportToolEvent('fraud_detector', 'visited');
window.chainAwareTrack.reportToolEvent('fraud_detector', 'completed');

Supported statuses: visited, started, completed.

Server-Side Only (no client-side instrumentation)

v2-track.js is not loaded from a CDN — it is embedded directly into your own codebase, so there is no third-party runtime dependency. Some DeFi protocols nonetheless prefer zero client-side wallet instrumentation as a policy: no code that touches the wallet connection event runs in the browser, regardless of origin. If your protocol has this policy, skip the pixel entirely and call the track endpoint directly from your backend whenever a user connects a wallet. You get the same data with no client-side instrumentation at all.

Endpoint: POST https://api.chainaware.ai/v2/track

{
  "clientId": "your-client-id",
  "sessionId": "uuid-per-session",
  "visitorId": "uuid-per-user",
  "walletAddress": "0xABCD...1234",
  "network": "ETH",
  "pageUrl": "/app/dashboard",
  "toolEvent": null
}

Field reference:

Field Required Notes
clientId Yes Your ChainAware client ID from the dashboard
sessionId Yes UUID — generate per session, rotate after 30 min of inactivity
visitorId No UUID — persist per user across sessions (cookie or database)
walletAddress No The connected wallet address (20–100 chars)
network No ETH, BNB, BASE, HAQQ, or SOLANA
pageUrl No Current page path
toolEvent No {"tool": "fraud_detector", "status": "completed"} — statuses: visited, started, completed

Call this endpoint each time a wallet connects, on each page navigation, and when a tool event fires. The response is always {"ok": true} — it is fire-and-forget; errors are swallowed server-side.

The wallet address captured here feeds directly into your Compliance Screener calls in Part 2.


Part 2 — Compliance Screener Setup

This is the compliance check itself — AML, KYT, sanctions screening, fraud scoring. It runs in your backend or AI agent pipeline once the pixel has captured a wallet address.

Step 1 — Get your API key

Subscribe at chainaware.ai/pricing. No annual contract, no procurement cycle.

Step 2 — Connect via MCP or REST API

MCP (for Claude-based AI agents):

claude mcp add --transport sse chainaware-behavioral-prediction \
  https://prediction.mcp.chainaware.ai/sse --header "X-API-Key: YOUR_KEY"

REST API: POST to https://prediction.mcp.chainaware.ai with your wallet address and chain.

Step 3 — Run a compliance check

The Compliance Screener runs four sub-agents in sequence for every wallet submitted:

  • chainaware-fraud-detector — OFAC/EU/UN sanctions, mixer history, darknet exposure, fraud clustering. Output: fraud probability 0.00–1.00, status classification.
  • chainaware-aml-scorer — Normalised AML compliance score (0–100) for decision workflows.
  • chainaware-transaction-monitor — Real-time transaction risk scoring: ALLOW / FLAG / HOLD / BLOCK.
  • chainaware-counterparty-screener — Pre-transaction go/no-go. Returns PROCEED / REJECT with evidence.
# Single wallet compliance check
"MiCA compliance check on 0xABCD...1234 on Ethereum"

# Pre-transaction check
"Screen this transaction: sender 0xABCD...1234, receiver 0xEFGH...5678, 50 USDC on Base"

Step 4 — Handle the Compliance Report

Each check returns a structured JSON report:

{
  "verdict": "PASS",
  "risk_rating": "LOW",
  "flags": [],
  "recommended_action": "ALLOW",
  "scope_disclaimer": "...",
  "timestamp": "2026-11-13T10:00:00Z"
}

Act on each verdict:

Verdict Meaning Recommended action
PASS No flags triggered Allow platform access
EDD Soft flags — worth monitoring Restrict to lower-risk functions or flag for manual review
REJECT Hard flags — sanctions hit, confirmed fraud Block and log

Store the full JSON report in your compliance log. The timestamp and structured flags are your audit record — the documented evidence your risk-based approach requires under FATF and MiCA.

Step 5 — Batch screening (optional)

For token launches, airdrops, and DAO whitelist screening:

"Batch compliance screen the following 500 wallets for our IDO whitelist: [list]"

Output: per-wallet verdict table plus a cluster map flagging coordinated wallet groups.


What Gets Logged — Your Audit Record

Every compliance check generates a timestamped record. Under MiCA's risk-based approach requirement, this is the core evidence of your compliance programme.

Each record includes:
- Wallet address and chain
- Timestamp (ISO-8601)
- Verdict: PASS / EDD / REJECT
- Specific flags triggered with evidence (e.g. OFAC_SDN_HIT, MIXER_EXPOSURE, FRAUD_CLUSTER)
- Hop distance for indirect exposure flags
- Scope disclaimer

Persist the JSON response to your compliance database before discarding it. For EDD verdicts, log your response action alongside the report.


What Is and Is Not Covered

Covered:
- Sanctions screening — OFAC SDN, EU Consolidated Sanctions List, UN Security Council
- AML behavioural monitoring — mixer use, darknet exposure, layering patterns, structuring
- Fraud and bot detection — 95% accuracy on Ethereum; 8 chains, 16M+ wallet profiles
- Transaction risk scoring — real-time, pre-execution
- Documented audit records — timestamped, structured for compliance log storage

Not covered:
- PEP screening — requires identity fields not present in a wallet address. Add separately ($500–$5K/year via ComplyAdvantage, Refinitiv, or Dow Jones)
- Travel Rule — does not apply to pure DeFi smart contract interactions
- SAR filing — a process requirement; ChainAware generates the evidence, the compliance officer files

Total coverage: approximately 70–75% of practical MiCA requirements for pure DeFi protocols.


Frequently Asked Questions

Do I need to identify users to run AML monitoring?
No. ChainAware screens wallet addresses against behavioural profiles — no identity data is required or collected. The wallet address is the data point; on-chain behavioural history is the input.

How do I handle an EDD verdict?
Soft flags — patterns worth monitoring but not an immediate block. Common responses: restrict the wallet to low-value functions, require additional verification at the next conversion point, or flag for manual review. Log your response action alongside the EDD record.

What is the latency impact on my Dapp?
The pixel fires asynchronously and does not block the UI. The compliance check runs in your backend — single-wallet screening averages under 100ms. Batch screening is asynchronous.

Can I test before going live?
Yes. Use test wallet addresses from your ChainAware dashboard — these trigger predictable PASS, EDD, and REJECT verdicts for integration testing without consuming API credits.


Further Reading


Get API Access →    Book a Compliance Demo →    See Pricing →