feat: Add phantom trade detection and database tracking
- Detect position size mismatches (>50% variance) after opening - Save phantom trades to database with expectedSizeUSD, actualSizeUSD, phantomReason - Return error from execute endpoint to prevent Position Manager tracking - Add comprehensive documentation of phantom trade issue and solution - Enable data collection for pattern analysis and future optimization Fixes oracle price lag issue during volatile markets where transactions confirm but positions don't actually open at expected size.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Trade" ADD COLUMN "actualSizeUSD" DOUBLE PRECISION,
|
||||
ADD COLUMN "expectedSizeUSD" DOUBLE PRECISION,
|
||||
ADD COLUMN "isPhantom" BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN "phantomReason" TEXT;
|
||||
Reference in New Issue
Block a user