From 148ff5f495e1382f1d3e552e72c8e27481581b37 Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Mon, 8 Dec 2025 07:51:51 +0100 Subject: [PATCH] docs: Add Bug #74 - Position Manager monitoring failure to Top 10 Critical Pitfalls - Moved from #10 to #1 (most critical) - This bug cost user 08 in real losses Dec 8, 2025 - Root cause: Container restart without verifying fix deployment - Prevention: ALWAYS verify container timestamp > commit timestamp --- .github/copilot-instructions.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 42beaac..412daee 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -747,16 +747,16 @@ docs/COMMON_PITFALLS.md ``` **Top 10 Critical Pitfalls (Summary):** -1. **Drift SDK Memory Leak (#1)** - JS heap OOM after 10+ hours → Smart health monitoring -2. **Wrong RPC Provider (#2)** - Alchemy breaks Drift SDK → Use Helius only -3. **P&L Compounding Race Condition (#48, #49, #61)** - Multiple closures → Atomic Map.delete() -4. **Database-First Pattern (#29)** - Save DB before Position Manager -5. **Container Deployment Verification (#31)** - Always check container timestamp -6. **Position.size Tokens vs USD (#24)** - SDK returns tokens → multiply by price -7. **External Closure Race Condition (#67)** - 16 duplicate notifications → Atomic lock -8. **Smart Entry Wrong Price (#66)** - Use Pyth oracle, not webhook percentage -9. **MAE/MFE Wrong Units (#54)** - Store percentages, not dollars -10. **Execute Endpoint Quality Bypass (#62)** - Quality check after timeframe validation +1. **Position Manager Never Monitors (#73, #74)** - Container running old code = NO MONITORING = $108 loss +2. **Drift SDK Memory Leak (#1)** - JS heap OOM after 10+ hours → Smart health monitoring +3. **Wrong RPC Provider (#2)** - Alchemy breaks Drift SDK → Use Helius only +4. **P&L Compounding Race Condition (#48, #49, #61)** - Multiple closures → Atomic Map.delete() +5. **Database-First Pattern (#29)** - Save DB before Position Manager +6. **Container Deployment Verification (#31)** - Always check container timestamp +7. **Position.size Tokens vs USD (#24)** - SDK returns tokens → multiply by price +8. **External Closure Race Condition (#67)** - 16 duplicate notifications → Atomic lock +9. **Smart Entry Wrong Price (#66)** - Use Pyth oracle, not webhook percentage +10. **MAE/MFE Wrong Units (#54)** - Store percentages, not dollars **How to Use:** - **Quick lookup:** Check Quick Reference Table in `docs/COMMON_PITFALLS.md`