Inspiration
DeFi is often swarmed by bots who steal millions via Sandwich Attacks. While wallets show price, they hide danger. We built GapWrap to be a radar for the mempool, making these invisible algorithmic attacks visible so everyday traders can dodge them.
What it does
GapWrap is a real-time defense dashboard for Uniswap traders:
- Attack Visualizer: Renders "Sandwich Attacks" on a live graph with red danger indicators.
- Slippage Engine: Calculates the exact slippage tolerance (e.g., 0.5% vs 3.0%) needed to stay safe based on volatility.
- Risk Score: A simple Green/Yellow/Red traffic light system for token safety.
- AI Assistant: A Groq-powered chatbot that explains threats and answers security questions instantly.
How we built it
- Frontend: React + Recharts for the financial graphing and Framer Motion for fluid "danger" animations.
- Backend: Python FastAPI handles the simulation logic and attack pattern generation.
- AI: Integrated Groq (Llama-3) for lightning-fast, real-time responses.
- Resilience: Built a hybrid engine that falls back to a local "Offline Mode" if APIs failed, ensuring the demo always works.
Challenges we ran into
- Visualizing Speed: Real attacks happen in milliseconds. We had to tune our simulation to slow them down enough for humans to see without losing the "live" feel.
- The "Zero" Problem: Charting libraries struggled with meme tokens worth fractions of a penny. We built custom formatters to handle the precision.
- AI Guardrails: Our AI initially wanted to write poems. We had to engineer strict system prompts to keep it focused solely on crypto security.
Accomplishments that we're proud of
- The "Demo Mode": We successfully visualized an abstract concept into a clear, red-alert graph animation that anyone can understand.
- Speed: Switching to Groq made the AI assistant feel instantaneous, matching the high-speed vibe of the app.
- Universal Design: The dashboard works for both stablecoins and volatile memecoins. ## What we learned
- UX is Safety: Traders don't want raw data; they want a "Safe/Unsafe" verdict.
- Simulation Realism: accurately model the price impact of a sandwich bot was harder than expected but crucial for the educational value.
What's next for Gap wrap
- Live Mainnet Feed: Connection to Flashbots RPC to visualize real attacks on Ethereum as they occur.
- Mobile App: Bringing mempool visibility to mobile traders.
Built With
- alchemyapi
- coingecko
- groq
- javascript
- python
- react
- recharts
- tailwind
- typescript
- vite
Log in or sign up for Devpost to join the conversation.