SafeFi
DeFi today is powerful but risky fragmented tools, confusing swaps and constant phishing threats make it difficult to trade securely. Traders must juggle multiple tabs, watch for fake sites and manually check token prices before making moves.
SafeFi solves this by acting as a DeFi companion browser extension.
It automatically detects tokens on any DeFi site, fetches real time prices and enables one click swaps directly from the extension using Gluex Apis. On top of that, it includes phishing detection powered by fuzzy matching (Levenshtein distance), helping users avoid malicious lookalike domains.
With SafeFi, DeFi becomes smarter & safer all inside your browser extension.
How SafeFi Works
Architecture Overview
SafeFi runs as a browser extension with three main components:
Content Script (content.ts) → scans webpages for tokens/domains
Background Script (background.ts) → manages data flow & APIs
Popup UI (App.tsx) → clean user interface for swaps & alerts
Step by Step Operation
Token Detection → Content script scans webpage text with regex, identifies tokens (ETH, BTC, USDC, etc.) sends them to the popup.
Phishing Detection → Every site is checked against more than 4,000+ verified DeFi sites using Levenshtein distance to catch lookalike (typosquatting) domains. Suspicious sites trigger warning banners.
Real Time Pricing → Detected tokens are queried via GlueX Exchange Rates API for live prices + 24h changes.
User Actions → From the popup, users can:
See detected tokens with prices
Execute one click swaps (via GlueX Router + MetaMask)
View website security status
Yield Optimization → Extension suggests higher APY opportunities through GlueX Yield API.
Data Flow
MetaMask integration for secure wallet interactions
GlueX APIs for swaps, pricing and yield strategies
Safe URL database for phishing detection & warnings
Security Features
Phishing detection via Levenshtein distance
Real time suspicious domain alerts
Explicit wallet consent for every interaction
Technical Implementation
Manifest V3 (modern Chrome extension standard)
TypeScript + React (type safe, modern UI)
GlueX APIs for pricing, swaps and yields
MetaMask for secure DeFi execution
User Experience
Install extension
Browse any DeFi site
Extension auto detects tokens & prices
Swap tokens in one click
Get real time phishing alerts
Team