← Lab /Security & privacy

Dynamic defense detects stablecoin attacks with 96.6% accuracy

The proposed real-time anomaly detection model can identify malicious stablecoin attacks with 96.61% classification accuracy and 97.70% recall

Security & privacy arXiv 26 Aug 2026 Defense Prototype evidence

Published as “Defending the Peg: Real-Time Dynamic Protection and Anomaly Detection in DeFi Stablecoins”

Why it matters

The approach could be deployed at node or RPC gateway level to block malicious transactions before they are included in a block, reducing the risk of costly DeFi exploits.

Summary

The paper shows that its Bi-LSTM anomaly detection model attains 96.61% accuracy and 97.70% recall in spotting malicious stablecoin transactions, and that its layered dynamic defenses prevent reentrancy and flash-loan governance attacks and mitigate oracle manipulation. The evidence comes from experiments on a locally deployed Ethereum testbed using a simulated dataset of 100,000 transactions, so the results are strong within that controlled setting but lack real-world validation.

What they found 5

  1. Reentrancy attacks are prevented by the proposed guard and CEI-based mechanism.

    “Reentrancy Attack Reentrancy Guard + CEI Principle Prevented”

  2. Oracle manipulation attacks are mitigated by TWAP and multi-source oracle aggregation.

    “Oracle Manipulation TWAP + Multi-source Oracle Mitigated”

  3. Flash-loan governance attacks are prevented by a time-lock execution mechanism.

    “Flash Loan Governance Time-lock Mechanism Prevented”

  4. The Bi-LSTM detection model reaches 96.61% accuracy and 97.70% recall on the test set.

    “The proposed model achieves an accuracy of 96.61% and a recall of 97.70%, demonstrating its effectiveness in identifying malicious transaction behaviors.”

  5. Inference latency of the model is between 1.5 ms and 2.8 ms per transaction, enabling real-time screening.

    “The average inference latency ranges from 1.5 ms to 2.8 ms for a single transaction feature sequence.”

Caveats 4

  • Precision is relatively lower (60.66%) compared with recall, leading to many false positives.
  • The evaluation relies on a simulated transaction dataset rather than real-world blockchain data.
  • However, the precision value is relatively lower compared with recall. This is mainly caused by the highly imbalanced transaction distribution, where certain legitimate high-frequency DeFi operations may exhibit behaviors similar to malicious activities.
  • Although the current evaluation is based on simulated transaction data, this work provides a practical foundation for combining intelligent detection with multi-layer security protection in decentralized financial systems.

What’s new here 4

  • Real-time mempool-level transaction screening using a Bi-LSTM model.
  • A full-lifecycle dynamic defense architecture covering pre-deployment, mid-execution, and post-incident phases.
  • Integration of a reentrancy guard with checks-effects-interactions principle, TWAP-based multi-source oracle, and time-lock governance mechanisms.
  • Evaluation of both contract-level protections and transaction-level AI detection in a unified framework.