UNPKG

@barfinex/types

Version:

Core TypeScript type definitions and shared interfaces for the Barfinex ecosystem. Provides strongly-typed contracts for modules, services, and plugins.

66 lines 2.86 kB
export declare const CONVICTION_CALIBRATION_SCHEMA_VERSION: "1.0.0"; export declare const CONVICTION_CALIBRATION_FEATURES_VERSION: "v1"; export declare const CONVICTION_CALIBRATION_FEATURE_KEYS: readonly ["atrPct", "rangePct", "returnPct", "logReturn", "zScore", "spreadPct", "orderBookImbalance", "deltaRatio", "riskBudgetMaxPositionUsd", "riskBudgetMaxSpreadPct", "llmConfidence", "llmRiskBoost", "regimeTypeNumeric", "regimeConfidence", "marketPhaseNumeric", "phaseConfidence", "migrationFastStrength", "migrationIntradayStrength", "migrationDayStrength", "acceptanceScoreFast", "acceptanceScoreIntraday", "acceptanceScoreDay", "balanceRetentionFast", "balanceRetentionIntraday", "balanceRetentionDay", "pocMigrationFastBps", "pocMigrationIntradayBps", "pocMigrationDayBps", "pressureFast", "pressureIntraday", "pressureDay", "opportunityScore"]; export type ConvictionCalibrationFeatureKey = (typeof CONVICTION_CALIBRATION_FEATURE_KEYS)[number]; export type ConvictionCalibrationRecommendation = 'ALLOW' | 'DAMPEN' | 'BLOCK'; export interface CalibrationModelMetadata { name: string; version: string; trainedAt: string; featuresVersion: string; schemaVersion: string; } export interface ConvictionCalibrationInput { schemaVersion: typeof CONVICTION_CALIBRATION_SCHEMA_VERSION; symbol: string; timeframe: string; regime: { direction: 'bullish' | 'bearish' | 'neutral' | 'unknown'; regimeBucket: string; volatilityBucket: 'low' | 'normal' | 'high' | 'unknown'; trendBucket?: string; }; features: Partial<Record<ConvictionCalibrationFeatureKey, number>>; llmDecision: { intent?: 'ENTER' | 'HOLD' | 'EXIT' | 'STAND_DOWN'; direction?: 'LONG' | 'SHORT'; confidence?: number; riskBoost?: number; }; riskGate: { budgetPct?: number; maxPositionUsd?: number; maxSpreadPct?: number; factorKey?: string; }; context: { aiMode: 'strategic' | 'lightweight' | 'disabled'; scope: 'decision'; }; } export interface ConvictionCalibrationOutput { calibratedWinProb: number; calibratedConfidence: number; capitalMultiplier: number; riskAdjustment: number; decisionRecommendation?: ConvictionCalibrationRecommendation; reasons: string[]; model: CalibrationModelMetadata; inference: { latencyMs: number; usedFallback?: boolean; fallbackReason?: string; }; } export interface CalibrationDecisionMeta { winProb: number; calibratedConfidence: number; capitalMultiplier: number; recommendation: ConvictionCalibrationRecommendation; modelName: string; modelVersion: string; featuresVersion: string; usedFallback?: boolean; fallbackReason?: string; } //# sourceMappingURL=conviction-calibration.interface.d.ts.map