project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

BlockSense Ai

Real-time transaction risk monitor using The Graph, Chainlink, Flask, and AI

BlockSense Ai

Created At

ETHGlobal New York 2025

Project Description

BlockSense AI is a real-time transaction intelligence platform that detects risky or unusual activity on blockchain networks. The system currently integrates with Ethereum mainnet through the Uniswap v3 subgraph and Chainlink price feeds, while also supporting mock data for Polygon, Arbitrum, and Avalanche to demonstrate multi-chain potential.

Incoming transactions are analyzed against several heuristics such as bursty fan-out behavior, ping-pong transfers, large transaction volume, stablecoin bursts, and interactions with newly seen wallets. Each transaction is scored on a scale of 0 to 100, and those with higher scores are flagged as risky. A built-in blocklist ensures known malicious addresses are automatically rated as high risk.

To increase transparency, BlockSense AI can optionally use the OpenAI API to generate concise natural language summaries that explain why a transaction may be risky. If no API key is provided, the system falls back to deterministic explanations so that results remain interpretable.

The frontend dashboard is built with vanilla JavaScript and styled with TailwindCSS. It polls the Flask backend every two seconds to display live transactions, provides statistics like throughput, latency, and flagged counts, and supports filtering by chain, minimum amount, search by hash or address, and flagged-only mode. Selecting a transaction reveals detailed metadata and AI-generated insights.

BlockSense AI highlights real integrations with The Graph for data indexing and Chainlink for on-chain price feeds. Stablecoin logic is also included as part of the scoring rules. The design emphasizes reliability by providing a mock data fallback so that the demo continues to function even if APIs are temporarily unavailable.

How it's Made

The backend is written in Python using Flask. A background thread continuously fetches swaps from the Uniswap v3 subgraph on Ethereum. If live data is unavailable, the system generates realistic mock transactions so the dashboard never appears empty. Each transaction is enriched with USD values using Chainlink price feeds when an Ethereum RPC is available.

Risk scoring is handled in-memory using Python data structures such as deques and dictionaries. Heuristics are implemented to catch patterns like large transfers, frequent reverse transactions, and new wallet activity. Stablecoins receive special consideration because rapid bursts of stablecoin transfers can indicate scams. Scores are capped between 0 and 100, and flagged transactions can optionally receive AI-generated explanations for clarity.

The frontend is a single-page dashboard built without heavy frameworks. It uses TailwindCSS for styling and simple JavaScript to query backend APIs and update the interface. Users can filter by chain, amount, address or hash, and whether transactions are flagged. Statistics such as throughput, latency, and flagged counts are calculated on the backend and displayed in real time.

By combining The Graph for subgraph queries, Chainlink for reliable price data, Flask for backend logic, TailwindCSS for styling, and optional AI summaries for interpretability, BlockSense AI creates a complete end-to-end solution for monitoring blockchain transactions with clarity and resilience.

background image mobile

Join the mailing list

Get the latest news and updates