Fix API offset limit 400 Bad Request, implement requested UI/UX improvements

This commit is contained in:
Richard
2026-07-06 22:34:33 +02:00
parent fb703b6c81
commit 10eefd3546
35 changed files with 4900 additions and 145 deletions
@@ -111,6 +111,16 @@ public class PolymarketApiClient
return result ?? [];
}
/// <summary>
/// Fetch CLOB orderbook for a given token ID.
/// </summary>
public async Task<OrderBookResponse?> GetOrderBookAsync(string tokenId, CancellationToken ct = default)
{
var url = $"/book?token_id={tokenId}";
_logger.LogDebug("Fetching orderbook for token: {TokenId}", tokenId);
return await ExecuteWithRetryAsync<OrderBookResponse>(_clobClient, url, "CLOB", ct);
}
private async Task<T?> ExecuteWithRetryAsync<T>(HttpClient client, string url, string endpointGroup, CancellationToken ct, int attempt = 1)
{
await _rateLimiter.WaitAsync(PlatformType.Polymarket, ct, endpointGroup);