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
@@ -198,4 +198,23 @@ public class MarketRepository : IMarketRepository
.Take(take)
.ToListAsync(ct);
}
public async Task<IReadOnlyList<MarketOutcomePriceSnapshot>> GetPriceSnapshotsAsync(int marketOutcomeId, CancellationToken ct = default)
{
return await _db.MarketOutcomePriceSnapshots
.Where(ps => ps.MarketOutcomeId == marketOutcomeId)
.OrderBy(ps => ps.Timestamp)
.ToListAsync(ct);
}
public async Task SavePriceSnapshotsAsync(int marketOutcomeId, IEnumerable<MarketOutcomePriceSnapshot> snapshots, CancellationToken ct = default)
{
var existing = await _db.MarketOutcomePriceSnapshots
.Where(ps => ps.MarketOutcomeId == marketOutcomeId)
.ToListAsync(ct);
_db.MarketOutcomePriceSnapshots.RemoveRange(existing);
_db.MarketOutcomePriceSnapshots.AddRange(snapshots);
await _db.SaveChangesAsync(ct);
}
}