dYdX Hack

TOTAL LOST $211K
Low Other

Summarize with AI

Affected Chain 2021 Incident surface
Recovered - No recovery reported
All-Time Rank #1273 By amount stolen
Protocol Type Exploit/Other Target category

Incident Overview

Affected contract:

https://etherscan.io/address/0x53773fE5…51Ba2C

Nov 27 05:21. The dydX team received a report from a member of a trading firm regarding a vulnerability in the dYdX deposit proxy contract.

Nov 27 06:40. The dYdX team confirmed the bug. They asked samczsun and Georgios from Paradigm to join them in the war room as they respond to the vulnerability.

Nov 27 06:50. The dYdX and Paradigm teams together decided the best course of action is to execute a white-hat hack of vulnerable funds to move them to a safe location.

Nov 27 07:33. As samczsun finished a proof of concept for a white-hat hack, the dydX began implementing the recovery flow in the frontend and implementing a bot to save any additional funds that become vulnerable.

Nov 27 08:01. The dydX determined that ~700 addresses had allowances set on the vulnerable proxy contract. Of these, about 180 had funds at risk, totaling ~$2M.

Nov 27 09:27. The dydX team asked Etherscan to remove the verified source code from the proxy contract and they made the source code on GitHub private.

Nov 27 10:33. The white-hat escrow contract was deployed.

Nov 27 10:56. The setAllowance() function was disabled in the dYdX exchange frontend.

Nov 27 12:04. The first white-hat hack was executed via flashbots.

Nov 27 12:22. The front end was updated to show the warning and recovery process to users affected by the bug. Allowances for deposits were re-enabled using the old deposit flow.

Nov 27 12:32. Announcement was made on Twitter and Discord:

https://twitter.com/dydxprotocol/status/1464572467872247815?s=20

Nov 27 12:43. The second white-hat hack was executed via flashbots for two more addresses.

Nov 27 13:16. A recovery bot was deployed to automatically retrieve and escrow any more funds that become vulnerable.

As of Dec 8 at 18:00 UTC, $533,000 of additional funds were rescued by the bot, and nearly 80% of affected addresses have revoked approval from the vulnerable contract. Another estimated $211,000 in funds were exploited by frontrunner bots.

Incident Report

Protocol / Project dYdX
Date of Incident
Attack Technique Other
Classification Exchange (DEX)
Primary Source View Post-Mortem

Protocol Information

Protocol Type Exploit/Other
Affected Token DYDX
Official Website dydx.exchange/
Protocol Twitter/X @dydxprotocol
Team Anonymous
Source Code Unverified

Market Context at Time of Hack

Token Categories
Decentralized Exchange (DEX) Token Derivatives Layer 1 Made in America Binance Ecosystem Binance Listing Perp dex coins

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 other and Solidity and EVM internals
Capital Required Seed capital to cover gas and initial position setup
On-Chain Access Ability to interact with smart contracts and deploy a custom exploit contract
Protocol Analysis Identification of the exploitable vulnerability in dYdX's contract logic - root cause: exchange (dex)
Execution Speed Precise transaction ordering and timing to exploit the vulnerability within a single atomic block
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 Other audit checklist and test coverage

If you're auditing a protocol with similar architecture to dYdX, these are the critical security checks that could have prevented this incident (November 2021).

  • Verify all logic paths related to Other 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

Sources & References

Learn to Prevent the Next dYdX

The dYdX 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