DEV Community

RajLol
RajLol

Posted on

I Built Cryptographic Proof for DeFi Liquidations Using Pyth Network

Every time I got liquidated in DeFi, I had one question —
was that price actually fair?

There's no way to verify. So I built PythReceipt.

What it does

PythReceipt creates an immutable, on-chain receipt for every
liquidation — stamped with Pyth Network's live oracle data
at the exact moment of execution.

The Confidence Gate

Before any liquidation executes, PythReceipt checks Pyth Pro's
confidence interval:

  • Confidence < 0.2% → ✅ Liquidation allowed
  • Confidence 0.2-0.5% → ⚠️ Warning shown
  • Confidence > 0.5% → 🔴 Liquidation blocked

The Receipt

Every successful liquidation generates:

  • On-chain Solana transaction
  • Live Pyth price at exact moment
  • Confidence interval value
  • Best Bid / Best Ask
  • Downloadable JSON proof

Tech Stack

  • Next.js 14 + TypeScript
  • Solana Devnet + Anchor
  • Pyth Pro Lazer WebSocket
  • Vercel

Try it: https://pyth-receipt.vercel.app
GitHub: https://github.com/rajdeblol/PythReceipt

Top comments (0)