SafeFi

SafeFi is a browser extension for secure and smarter DeFi on Hyperliquid, combining token management, phishing detection, seamless swaps and yield optimization in one place

github
  • 405 Raised
  • 287 Views
  • 2 Judges

Categories

  • 02. 🚀 Hyperliquid Frontier Track
  • 06. Best use of GlueX Router API

Gallery

Description

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

  1. Token Detection → Content script scans webpage text with regex, identifies tokens (ETH, BTC, USDC, etc.) sends them to the popup.

  2. 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.

  3. Real Time Pricing → Detected tokens are queried via GlueX Exchange Rates API for live prices + 24h changes.

  4. User Actions → From the popup, users can:

    • See detected tokens with prices

    • Execute one click swaps (via GlueX Router + MetaMask)

    • View website security status

  5. 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

Attachments