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