Initial commit: Predictalytics solution
Clean Architecture .NET 8 solution (Domain/Application/Infrastructure/Api/Worker/WinFormsHost) for analyzing Polymarket traders for copytrading/strategy-replication candidates. Includes EF Core InitialBaseline migration and DB secrets removed from source/config in preparation for version control.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using Predictalytics.Domain.Entities;
|
||||
using Predictalytics.Domain.Enums;
|
||||
|
||||
namespace Predictalytics.Domain.Interfaces;
|
||||
|
||||
public interface ITraderRepository
|
||||
{
|
||||
Task<Trader?> GetByIdAsync(int id, CancellationToken ct = default);
|
||||
Task<Trader?> GetByPlatformIdAsync(PlatformType platform, string platformUserId, CancellationToken ct = default);
|
||||
Task<IReadOnlyList<Trader>> GetAllAsync(PlatformType? platform = null, int skip = 0, int take = 50, CancellationToken ct = default);
|
||||
Task<IReadOnlyList<Trader>> GetWatchlistedAsync(CancellationToken ct = default);
|
||||
Task<IReadOnlyList<Trader>> GetTopByScoreAsync(int count = 20, CancellationToken ct = default);
|
||||
Task<IReadOnlyList<Trader>> GetTopByPnLAsync(int count = 5, DateTime? since = null, CancellationToken ct = default);
|
||||
Task<int> GetCountAsync(PlatformType? platform = null, CancellationToken ct = default);
|
||||
Task AddAsync(Trader trader, CancellationToken ct = default);
|
||||
Task UpdateAsync(Trader trader, CancellationToken ct = default);
|
||||
Task DeleteAsync(int id, CancellationToken ct = default);
|
||||
|
||||
/// <summary>Get traders that need trade history update (LastTradesUpdatedAt is null or older than given hours).</summary>
|
||||
Task<IReadOnlyList<Trader>> GetTradersDueForTradeUpdateAsync(int cooldownHours = 6, int take = 20, CancellationToken ct = default);
|
||||
|
||||
/// <summary>Get traders that haven't been polled in a long time or have a prolonged API error for cleanup.</summary>
|
||||
Task<IReadOnlyList<Trader>> GetTradersForCleanupAsync(DateTime inactiveSince, DateTime errorSince, int take = 50, CancellationToken ct = default);
|
||||
|
||||
Task<IReadOnlyList<Trader>> SearchAsync(string query, int take = 20, CancellationToken ct = default);
|
||||
}
|
||||
Reference in New Issue
Block a user