exchange.IO("rps", ...)
When called as exchange.IO("rps", ...), this function sets the rate of requests to the Jupiter API on a Jupiter exchange object.
exchange.IO(k)
exchange.IO(k, n)Examples
Raise the rate when an API key on the Developer plan is configured.
javascript
function main() {
exchange.IO("rps", 10)
var t = Date.now()
exchange.GetDepth("SOL_USDC")
Log("Depth took:", Date.now() - t, "ms")
}Returns
| Type | Description |
number | Returns the current maximum number of requests per second. |
Arguments
| Name | Type | Required | Description |
k | string | Yes | Selects what the |
n | number | No | Maximum number of requests per second. Its range is 0.1 to 500 and its default is 1. Omit it to query the current value. |
See Also
Remarks
Jupiter limits requests per second: about 0.5 to 1 per second without an API key, 1 per second with a free API key, and 10 to 150 per second on paid plans. The connector queues requests one after another, at least 1/n seconds apart; if it still receives 429 it backs off and retries, and returns a null value after repeated failures. A value higher than your plan allows triggers rate limiting frequently.