Initial quant trader service baseline

This commit is contained in:
Codex
2026-06-23 22:09:06 +08:00
commit 7ff786f658
137 changed files with 6664 additions and 0 deletions
@@ -0,0 +1,44 @@
package com.quantai.trader.domain;
import com.quantai.trader.enums.TraderFeedbackSource;
import com.quantai.trader.enums.TraderFeedbackType;
import java.math.BigDecimal;
import java.time.Instant;
import java.util.Map;
public record TraderAppFeedback(
String runId,
String cycleId,
String actionId,
TraderFeedbackType feedbackType,
TraderFeedbackSource feedbackSource,
String proxyMethod,
String simulatorVersion,
boolean realFill,
String orderId,
String positionId,
String orderStatus,
Instant appReceivedTime,
Instant exchangeAckTime,
Instant filledTime,
BigDecimal filledPrice,
BigDecimal filledQuantity,
BigDecimal fee,
BigDecimal slippageBps,
String closeReason,
String closeSignalSource,
String exchangeErrorCode,
String platformErrorCode,
Map<String, Object> rawFeedback
) {
public TraderAppFeedback {
rawFeedback = Maps.immutable(rawFeedback);
boolean sourceCanBeReal = feedbackSource == TraderFeedbackSource.PAPER_APP
|| feedbackSource == TraderFeedbackSource.REAL_APP;
if (realFill != sourceCanBeReal) {
throw new IllegalArgumentException("feedback_source and realFill are inconsistent");
}
}
}