@adaptic/utils 0.0.962 → 0.0.963
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -7
- package/dist/index.mjs.map +1 -1
- package/dist/types/rate-limiter.d.ts +6 -3
- package/dist/types/rate-limiter.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7845,24 +7845,27 @@ const rateLimiters = {
|
|
|
7845
7845
|
/**
|
|
7846
7846
|
* Alpaca API rate limiter
|
|
7847
7847
|
*
|
|
7848
|
-
* Configured for
|
|
7848
|
+
* Configured for 1000 requests per minute (paid tier).
|
|
7849
|
+
* The token bucket allows burst up to maxTokens, then refills at the steady rate.
|
|
7849
7850
|
* See: https://alpaca.markets/docs/api-references/trading-api/#rate-limit
|
|
7850
7851
|
*/
|
|
7851
7852
|
alpaca: new TokenBucketRateLimiter({
|
|
7852
|
-
maxTokens:
|
|
7853
|
-
refillRate:
|
|
7853
|
+
maxTokens: 1000,
|
|
7854
|
+
refillRate: 1000 / 60, // 1000 requests per 60 seconds (~16.67/sec)
|
|
7854
7855
|
label: "alpaca",
|
|
7855
7856
|
timeoutMs: 60000,
|
|
7856
7857
|
}),
|
|
7857
7858
|
/**
|
|
7858
7859
|
* Massive.com API rate limiter
|
|
7859
7860
|
*
|
|
7860
|
-
* Configured for
|
|
7861
|
-
*
|
|
7861
|
+
* Configured generously for paid unlimited tier. The bucket exists only as a
|
|
7862
|
+
* safety net against runaway loops — the 1000 token burst and 500/sec refill
|
|
7863
|
+
* should never be hit under normal operation. If the paid plan truly has no
|
|
7864
|
+
* hard limit, this just prevents accidental self-DDoS.
|
|
7862
7865
|
*/
|
|
7863
7866
|
massive: new TokenBucketRateLimiter({
|
|
7864
|
-
maxTokens:
|
|
7865
|
-
refillRate:
|
|
7867
|
+
maxTokens: 1000,
|
|
7868
|
+
refillRate: 500, // 500 tokens/sec refill — effectively unlimited for paid tier
|
|
7866
7869
|
label: "massive",
|
|
7867
7870
|
timeoutMs: 30000,
|
|
7868
7871
|
}),
|