@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.cjs
CHANGED
|
@@ -7847,24 +7847,27 @@ const rateLimiters = {
|
|
|
7847
7847
|
/**
|
|
7848
7848
|
* Alpaca API rate limiter
|
|
7849
7849
|
*
|
|
7850
|
-
* Configured for
|
|
7850
|
+
* Configured for 1000 requests per minute (paid tier).
|
|
7851
|
+
* The token bucket allows burst up to maxTokens, then refills at the steady rate.
|
|
7851
7852
|
* See: https://alpaca.markets/docs/api-references/trading-api/#rate-limit
|
|
7852
7853
|
*/
|
|
7853
7854
|
alpaca: new TokenBucketRateLimiter({
|
|
7854
|
-
maxTokens:
|
|
7855
|
-
refillRate:
|
|
7855
|
+
maxTokens: 1000,
|
|
7856
|
+
refillRate: 1000 / 60, // 1000 requests per 60 seconds (~16.67/sec)
|
|
7856
7857
|
label: "alpaca",
|
|
7857
7858
|
timeoutMs: 60000,
|
|
7858
7859
|
}),
|
|
7859
7860
|
/**
|
|
7860
7861
|
* Massive.com API rate limiter
|
|
7861
7862
|
*
|
|
7862
|
-
* Configured for
|
|
7863
|
-
*
|
|
7863
|
+
* Configured generously for paid unlimited tier. The bucket exists only as a
|
|
7864
|
+
* safety net against runaway loops — the 1000 token burst and 500/sec refill
|
|
7865
|
+
* should never be hit under normal operation. If the paid plan truly has no
|
|
7866
|
+
* hard limit, this just prevents accidental self-DDoS.
|
|
7864
7867
|
*/
|
|
7865
7868
|
massive: new TokenBucketRateLimiter({
|
|
7866
|
-
maxTokens:
|
|
7867
|
-
refillRate:
|
|
7869
|
+
maxTokens: 1000,
|
|
7870
|
+
refillRate: 500, // 500 tokens/sec refill — effectively unlimited for paid tier
|
|
7868
7871
|
label: "massive",
|
|
7869
7872
|
timeoutMs: 30000,
|
|
7870
7873
|
}),
|