Implement A3, A4, A5, B3: Add MarketOutcomePriceSnapshot, implement Polymarket CLOB prices-history endpoint, improve strategy classification, introduce CopytradingScore, and decouple/optimize scoring pipeline into a separate worker

This commit is contained in:
Richard
2026-07-03 11:20:28 +02:00
parent e994e1ce72
commit f8c8230d99
21 changed files with 2035 additions and 22 deletions
@@ -295,4 +295,20 @@ public class PolymarketProvider : IPlatformProvider
return TradeSide.Unknown;
}
public async Task<IReadOnlyList<MarketOutcomePriceSnapshot>> GetPriceHistoryAsync(string tokenId, CancellationToken ct = default)
{
using var _ = PlatformLogContext.Push(PlatformName);
_logger.LogDebug("Fetching price history for CLOB Token {TokenId}", tokenId);
var rawHistory = await _api.GetPricesHistoryAsync(tokenId, "6h", ct);
_logger.LogInformation("Fetched {Count} price history entries for {TokenId}", rawHistory.Count, tokenId);
return rawHistory.Select(r => new MarketOutcomePriceSnapshot
{
Price = (decimal)r.Price,
Timestamp = DateTimeOffset.FromUnixTimeSeconds(r.Timestamp).UtcDateTime,
MarketOutcomeId = 0
}).ToList();
}
}