Our REST and WebSocket APIs use trading rate limits to protect the APIs against malicious usage, and to protect our markets against order book manipulation.

Our trading rate limits are designed to keep our markets fair for all market participants, while providing the resources needed by different types of traders (investors, active traders, automated trading bots, and so on).

Most traders will never encounter the trading rate limits, but for those that are placing/cancelling orders at higher then usual frequencies or placing/cancelling higher numbers of orders, the rate limits might be reached resulting in an ** EOrder:Rate limit exceeded** error.

Note that the trading rate limits apply separately per currency pair, so reaching the rate limits for one currency pair (XBT/USD for example) does not affect trading on any other currency pair (LTC/EUR for example).

## Rate Limit Basics

For many traders, knowing the specific details of the trading rate limit algorithms is not necessary; it is sufficient to know approximately how many order events can happen within a certain amount of time (essentially answering the question *"How many orders can I place/cancel per minute?"*).

As there are potentially unlimited combinations of orders events (placing, executing, cancelling) and order lifetimes (how long an order remains posted to the order book), it is not possible to provide a single exact value, but the following chart provides examples for several typical combinations.

The starter, intermediate, and pro columns indicate the account verification level, along with the maximum number of order events that can occur per minute on a consistent basis without reaching the trading rate limits.

As shown above, verifying an account to a higher level, increasing the order fill rate, or increasing the order lifetime will all significantly decrease the rate limit usage, thereby allowing a higher sustained number of order events per minute.

## Rate Limit Details (Advanced)

Our trading rate limits are based upon a counter that increases as orders are placed, executed, and cancelled, and decreases over time at a fixed decay rate. The rate limits are reached whenever this counter exceeds a maximum value (which varies depending upon the account verification level).

The maximum counter values (the rate limit reached values) for each account type are as follows:

**Starter = 60****Intermediate = 125****Pro = 180**

The decay rate (the rate at which the counter decreases) is also based upon the account verification level. The following are the decay rates for each account type:

**Starter = 1 per second****Intermediate = 2.34 per second****Pro = 3.75 per second**

The rate limit counter increases as each order event (placing, executing, cancelling) occurs, with certain order events (namely cancellations) causing a larger increase than others. The following chart shows the amount of counter increase (known as the penalty) for each type of order event:

The following is an example of how the maximum counter value, the counter increase due to order events, and the counter decrease due to the decay rate combine together to implement the trading rate limits for a pro level account.

*Placing 20 limit orders and cancelling each order after 3 seconds, would incur a penalty of 9 points per order, or a cumulative total of 180 points:*

*(20 orders x 1 order placing point) + (20 orders x 8 order cancellation points) = 180 points*

*The 180 point penalty would then be reduced by 3.75 points per second, hence it would take only 1 second before three new orders could be placed (as each new order would incur 1 order placing penalty), but it would take 48 seconds for the rate limits to be cleared entirely (back to zero):*

*180 points / 3.75 points per second = 48 seconds*

The following calculations show how to determine the maximum number of order events per minute that can be sustained without reaching the rate limits:

**Order penalty = (Penalty points * Fill rate) + (Penalty points * Fill rate) ... (up to 100%)****Order events per minute = 60 seconds / (Order penalty / Decay rate)**

As an example for a pro level account placing limit orders, 60% of which were filled after 3 seconds, and 40% of which were cancelled after 8 seconds:

**Order penalty = (3 * 60%) + (7 * 40%) = 4.6 points****Order events per minute = 60 / (4.6 / 3.75) = 48 events**

## Chronological Example

As a real world example of the trading rate limits, the following is a chronological transcript of how the penalty counter increases and decreases as orders are placed/cancelled.

In this example, the account type is a pro level account (hence a maximum counter value of 180 with a decay rate of 3.75 per second), and the order activity is placing 3 orders (at a rate of 1 order every 0.5 seconds) and then cancelling 3 orders (using a FIFO so that the oldest order is cancelled first).

## Further Questions

We will shortly be releasing a trading rate limit calculator (a spreadsheet) that allows the maximum number of order events to be determined for various combinations of order fill rate and order lifetime. In the meantime, please reach out to our API support team if you need any further assistance understanding the trading rate limits.