Drift Trade Hack

TOTAL LOST $14.5M
High realized PnL withdrawal bug solana

Summarize with AI

Affected Chain solana Incident surface
Recovered - No recovery reported
All-Time Rank #266 By amount stolen
Auditors 1 Prior security audit

Incident Overview

Drift brings on-chain, cross-margined perpetual futures to Solana. Making futures DEXs the best way to trade.

Incident Report

Protocol / Project Drift Trade
Date of Incident
Affected Chain(s) solana
Attack Technique realized PnL withdrawal bug
Classification Protocol Logic
Primary Source View Post-Mortem

Protocol Information

Protocol Type Derivatives
Smart Contract Language Rust
Protocol Twitter/X @DriftProtocol

What the Attacker Needed to Succeed

Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.

Technical Knowledge Deep understanding of realized pnl withdrawal bug and Rust/Anchor program internals and the Solana account model
Capital Required Seed capital to cover Solana network fees and initial position setup
On-Chain Access Ability to interact with solana Solana programs and deploy a custom exploit program or signer account
Protocol Analysis Identification of the exploitable vulnerability in Drift Trade's program logic - root cause: protocol logic
Execution Speed Precise transaction ordering and timing to exploit the vulnerability within a single Solana transaction (atomic across instructions)
Obfuscation Plan A strategy to launder and move stolen funds - typically through mixers, cross-chain bridges, or decentralized DEX swaps to resist tracing

What Auditors Should Check

Could this have been caught in audit? Likely — with a thorough realized PnL withdrawal bug audit checklist and test coverage
Audited by Audit Report 1 — still lost $14.5M. Prior audits don't guarantee safety, especially after post-audit code changes.

If you're auditing a protocol with similar architecture to Drift Trade, these are the critical security checks that could have prevented this incident (May 2022).

  • Verify all logic paths related to realized PnL withdrawal bug are guarded by proper access controls and input validation
  • Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs

Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.

Free Trial

Security Audit History

Sources & References

Learn to Prevent the Next Drift Trade

The Drift Trade hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.

Recreate exploit patterns safely Free Trial