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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user