create_throttled_hypersync_client
Documentation for eth_defi.hypersync.session.create_throttled_hypersync_client function.
- create_throttled_hypersync_client(config, requests_per_minute=150, limiter=None, *, concurrency=None, batch_size=None, min_batch_size=None, max_batch_size=None, response_bytes_ceiling=None, response_bytes_floor=None, response_bytes_target=None, max_buffered_bytes=None)
Create a Hypersync client with built-in SQLite-backed rate limiting.
For stream tuning parameter documentation see Envio HyperSync StreamConfig tuning.
- Parameters
config (hypersync.ClientConfig) – Hypersync client configuration (URL, bearer token, etc.).
requests_per_minute (int) – Maximum API requests per minute. Defaults to 150 (75% of the Hypersync free-tier 200 RPM limit). Ignored when limiter is provided.
limiter (Optional[pyrate_limiter.limiter.Limiter]) – Optional pre-existing
pyrate_limiter.Limiterto share across multiple clients (e.g. lead discovery + price scanning on the same API key). WhenNone, a new limiter is created.concurrency (Optional[int]) – Number of requests in flight — the main throughput knob.
Noneuses the Hypersync server default (10).batch_size (Optional[int]) – Initial block range for the first wave of requests.
Noneuses the server default (1000).min_batch_size (Optional[int]) – Lower limit on projected block count per request.
max_batch_size (Optional[int]) – Hard cap on blocks per request.
response_bytes_ceiling (Optional[int]) – Upper target for response size in bytes (macOS wheel).
response_bytes_floor (Optional[int]) – Lower target for response size in bytes (macOS wheel).
response_bytes_target (Optional[int]) – Target response size in bytes (Linux wheel).
max_buffered_bytes (Optional[int]) – Cap on bytes of fetched-but-undelivered data (Linux wheel).
- Returns
A
ThrottledHypersyncClientwrapping a nativeHypersyncClient.- Return type