DEV Community

Sueno
Sueno

Posted on

I built PythGuard — a real-time DeFi liquidation shield powered by Pyth Network

Getting liquidated on a leveraged position is brutal, especially when you could have seen it coming. I built PythGuard to fix that.

What it does:
PythGuard monitors your leveraged positions in real-time and alerts you before you hit your liquidation price. You add a position (collateral asset, size, liquidation price), and it gives you a live health score, a visual price bar, and a countdown to liquidation in both $ and %.

What makes it different — it uses all three Pyth Network features:

🔹 Pyth Network Price Feeds — Live prices for 8 crypto assets (BTC, ETH, SOL, PYTH, BNB, XRP, DOGE, AVAX) via Hermes, updating every 3 seconds with confidence intervals shown on each position card.

🔹 Pyth Network Pro — Commodity and FX feeds (Gold, WTI Crude, EUR/USD, GBP/USD) power a Macro Danger Score in the right panel. Gold surging + dollar strengthening has historically preceded crypto selloffs — this score watches those signals so you get a heads-up before the market moves against your position.

🔹 Pyth Network Entropy — Every time you register a price alert, Pyth Entropy generates a tamper-proof receipt (sequence number + hash). This cryptographically proves your alert existed before the price moved.

⚠️ Risks to be aware of:

  • Oracle risk: PythGuard relies entirely on Pyth Network price feeds. If Pyth feeds are delayed, manipulated, or return stale data, liquidation alerts may fire late or not at all.
  • No on-chain reading: Positions are entered manually — PythGuard does not connect to your actual on-chain positions. If you enter wrong numbers, the health score will be wrong.
  • Browser storage only: Positions and alerts are stored in localStorage. Clearing your browser or switching devices loses all your data.
  • Not financial advice: PythGuard is a monitoring tool, not a trading system. It does not execute any transactions on your behalf.
  • Pyth Network smart contract risk: As with any protocol, Pyth's underlying contracts carry inherent smart contract risk despite audits.

Pyth Network Audit: https://github.com/pyth-network/audit-reports
(Most recent: September 2024 — conducted by independent third-party auditors)

Live demo: https://pythguard-mu.vercel.app/

Tech stack: Next.js 14, TypeScript, Tailwind CSS — no backend, no wallet connection required.

Built for the Pyth Community Hackathon 2026. Happy to answer questions about the Pyth Network integration — the Entropy receipt flow in particular was interesting to implement.

Top comments (0)